Skip to content

PSA: PSoc 6 configurable secure memory size #10034

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

Merged
merged 6 commits into from
Mar 14, 2019

Conversation

evgenibo
Copy link
Contributor

@evgenibo evgenibo 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
Copy link
Contributor

0xc0170 commented Mar 11, 2019

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

@orenc17
Copy link
Contributor

orenc17 commented Mar 11, 2019

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

rc3

Copy link
Contributor

@orenc17 orenc17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@0xc0170 0xc0170 requested review from a team March 11, 2019 13:03
@orenc17
Copy link
Contributor

orenc17 commented Mar 11, 2019

Also please add alignment check with static assert

@orenc17
Copy link
Contributor

orenc17 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 flash_protected_region_config branch from 794801c to b28fea3 Compare March 11, 2019 17:18
@morser499
Copy link

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

@OlegKapshii
Copy link

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
Copy link
Contributor

orenc17 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 flash_protected_region_config branch from b28fea3 to c87d5d4 Compare March 12, 2019 09:21
@OlegKapshii
Copy link

@orenc17 It would be great to have such assert.

@OlegKapshii
Copy link

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

@orenc17
Copy link
Contributor

orenc17 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)

@0xc0170 0xc0170 requested a review from a user March 13, 2019 09:51
@cmonr
Copy link
Contributor

cmonr 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
Copy link
Contributor

cmonr commented Mar 13, 2019

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

@evgenibo
Copy link
Contributor Author

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

@cmonr
Copy link
Contributor

cmonr commented Mar 13, 2019

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

Finish memory protection and add static assert
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

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

Was this addressed by latest push?

@orenc17
Copy link
Contributor

orenc17 commented Mar 14, 2019

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

Copy link
Contributor

@orenc17 orenc17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

CI started

Copy link

@OlegKapshii OlegKapshii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbed-ci
Copy link

mbed-ci commented Mar 14, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 merged commit b80c961 into ARMmbed:master Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants