Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSA: PSoc 6 configurable secure memory size #10034

Merged
merged 6 commits into from Mar 14, 2019

Conversation

Projects
None yet
7 participants
@evgenibo
Copy link
Contributor

commented Mar 11, 2019

Description

On M0 target the secure flash and ram section sizes should be configurable.
Flash secure ROM  size can be configured to 128K, 256K or 512K. 
Changed the defalut size to 256K.

SRAM size can be configured to 64K or 128K. 64K is a default value.

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@ARMmbed/team-cypress @ARMmbed/mbed-os-psa

Release Notes

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 11, 2019

@ARMmbed/mbed-os-psa Is this targeting 5.12rc2 ?

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

@ARMmbed/mbed-os-psa Is this targeting 5.12rc2 ?

rc3

@orenc17
Copy link
Contributor

left a comment

if one of the PSA macros is missing this is an error

Show resolved Hide resolved ...ess/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT_M0_PSA/cyprotection_config.h Outdated
Show resolved Hide resolved ...ess/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT_M0_PSA/cyprotection_config.h Outdated

@0xc0170 0xc0170 added the needs: work label Mar 11, 2019

@0xc0170 0xc0170 requested review from ARMmbed/mbed-os-psa Mar 11, 2019

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Also please add alignment check with static assert

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

@ARMmbed/team-cypress does the PSoC6 has any alignment requirement for flash and ram split between the cores?

@evgenibo evgenibo force-pushed the evgenibo:flash_protected_region_config branch Mar 11, 2019

@morser499

This comment has been minimized.

Copy link

commented Mar 11, 2019

Flash must be on a 512k boundary, not overlapping between cores. No specific requirements for SRAM.

@OlegKapshii

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Flash and RAM start addresses of protected areas have to be aligned to a number dividable by the protected area size. To use unaligned regions - subregion field is used. It is quite complex algo to do it automatically.
Will check in docs tomorrow, just to be 150% sure.

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Flash and RAM start addresses of protected areas have to be aligned to a number dividable by the protected area size. To use unaligned regions - subregion field is used. It is quite complex algo to do it automatically.
Will check in docs tomorrow, just to be 150% sure.

@OlegKapshii
i'm asking because i wanted @evgenibo to add a static assert like this:

static_assert( PSA_SECURE_ROM_START % PSA_SECURE_RAM_SIZE == 0)

@evgenibo evgenibo force-pushed the evgenibo:flash_protected_region_config branch to c87d5d4 Mar 12, 2019

@OlegKapshii

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

@orenc17 It would be great to have such assert.

@OlegKapshii

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

Is it reasonable to add all possible region sizes conversion in the if sequence?

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

@evgenibo i think @OlegKapshii request is acceptable,
for the RAM please create if sections for the following sizes: 32KB - 256KB ( 4 options)
for the FLASH please create if sections for the following sizes: 64KB - 1MB ( 5 options)

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

@evgenibo Would anything bad happen if this was retargeted to 5.12.1?

As is, this PR doesn't seem critical enough for RC3.

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

Or does it fall in this bucket? #10055 (comment)

@evgenibo

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

This is critical to run client application on this board and has the same significance as #10055

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

Still waiting on #10034 (comment) to be addressed before starting CI

Merge pull request #1 from orenc17/flash_protected_region_config
Finish memory protection and add static assert
@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

Still waiting on #10034 (comment) to be addressed before starting CI

Was this addressed by latest push?

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2019

there is another change required for kvstore config i've showed @evgenibo where the fix should be

evgenibo and others added some commits Mar 14, 2019

@orenc17
Copy link
Contributor

left a comment

I can confirm the PSA tests pass on the board with the changes

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

CI started

@OlegKapshii
Copy link
Contributor

left a comment

LGTM

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 14, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Mar 14, 2019

@0xc0170 0xc0170 merged commit b80c961 into ARMmbed:master Mar 14, 2019

28 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARMC5 Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR8 Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARMC5 Success
Details
jenkins-ci/mbed2-build-ARMC6 Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR8 Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 9198 cycles (-1044 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B (+0.00%)
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.