Skip to content

Use secure/non-secure rom for bl modes #10113

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 3 commits into from
Mar 15, 2019

Conversation

theotherjimmy
Copy link
Contributor

@theotherjimmy theotherjimmy commented Mar 14, 2019

Description

Previously, a porter or application author could configure
secure or non-secure rom through the use of:

  • target.secure-rom-start
  • target.secure-rom-size
  • target.non-secure-rom-start
  • target.non-secure-rom-size

This allows them to configure this once, and have the same
values for both a secure build and a non-secure build.

This was not used by the bootloader modes and combining
these with either bootloader mode would lead to problems and
heartbreak.

This PR mends these broken hearts by heeding the secure and
non secure start and size in the bootloder modes.

Pull request type

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

@theotherjimmy
Copy link
Contributor Author

@dannybenor You asked offline for this. Could you give feedback on if this works for you?

@theotherjimmy
Copy link
Contributor Author

Note for maintainers: the first commit cleans up all the lint warnings in the config system, so if you're only looking for the functionality change, look at the 3rd commit.

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.

Looks fine.

@ciarmcom ciarmcom requested review from a team March 14, 2019 22:00
@ciarmcom
Copy link
Member

@theotherjimmy, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@cmonr
Copy link
Contributor

cmonr commented Mar 15, 2019

@dannybenor You asked offline for this. Could you give feedback on if this works for you?

Waiting (making a note here)

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

+1 for mending broken hearts 💔 ➡️ ❤️

I notice in this PR you've added the override behavior for just the ROM memories. Would it be appropriate to do add a similar override for RAM? Or is it not necessary in this case?

if hasattr(self.target, "mbed_rom_start"):
mem_start = getattr(self.target, "mbed_rom_start")
if hasattr(self.target, "mbed_rom_size"):
mem_size = getattr(self.target, "mbed_rom_size")
Copy link
Contributor

@bridadan bridadan Mar 15, 2019

Choose a reason for hiding this comment

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

Should this section be using the same config object (the return value from get_config_data()) as the PSA section below?

Copy link
Contributor

Choose a reason for hiding this comment

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

Talked offline with @theotherjimmy : PSA target memory config (ex (non-)secure-rom-start and (non-)secure-rom-size) actually uses the config system, where normal targets use "target data", hence the different way to access the data.

@orenc17
Copy link
Contributor

orenc17 commented Mar 15, 2019

PSA targets already get the RAM defines injected to the linker

@cmonr
Copy link
Contributor

cmonr commented Mar 15, 2019

Bumping to RC3 since this is needed for another PR.

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

Talked offline with @theotherjimmy: Sounds like RAM is not needed immediately for bootloader mode, so it was limited to ROM. There's no reason why RAM can't follow this PR as well.

LGTM

if hasattr(self.target, "mbed_rom_start"):
mem_start = getattr(self.target, "mbed_rom_start")
if hasattr(self.target, "mbed_rom_size"):
mem_size = getattr(self.target, "mbed_rom_size")
Copy link
Contributor

Choose a reason for hiding this comment

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

Talked offline with @theotherjimmy : PSA target memory config (ex (non-)secure-rom-start and (non-)secure-rom-size) actually uses the config system, where normal targets use "target data", hence the different way to access the data.

@cmonr
Copy link
Contributor

cmonr commented Mar 15, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 15, 2019

Test run: SUCCESS

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

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