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

Link real IMM_ROM_EXT into ROM_EXT #25686

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lchiawei
Copy link
Contributor

This PR mainly does the work about the IMM_ROM_EXT linking, including following commits:

  • Refine the linker script and startup assembly for our real IMM_ROM_EXT.
  • Make ROM_EXT use prebuilt IMM_ROM_EXT binary during the linking phase, instead of calling imm_rom_ext_main() in rom_ext_main().
  • Modify some bazel rules to make the ROM_EXT choose correct IMM_ROM_EXT binary according to the exec_env. For silicon creator, also add a new exec_env that does not contain a manifest to skip the signing phase.
  • Support IMM_ROM_EXT for slot A & B besides original virtual slot usage.

The first two commits in this PR are authored by @sasdf and is included in #25294 and #25310. I will rebase my PR to ToT once they are merged.

@lchiawei lchiawei requested review from cfrantz and a team as code owners December 17, 2024 19:23
@lchiawei lchiawei requested review from moidx, a team and timothytrippel and removed request for a team December 17, 2024 19:23
sasdf and others added 2 commits December 18, 2024 01:48
Reconfigure ePMP in immutable ROM_EXT to remove executable permission on the
immutable data segment.

Now, ePMP will be reconfigured to the following layout before jumping to the
mutable ROM_EXT:
```
 *    6: MU_EXT   ----- ----
 *    7: MU_EXT     TOR LX-R
 *    8: IM_EXT   ----- ----
 *    9: IM_EXT     TOR LX-R
 *   10: VIRTUAL  NAPOT L--R
 *   11: STACK      NA4 L---
```

MU_EXT stands for mutable part of rom_ext, and IM_EXT is the immutable part.

Slot 10 will be empty if address translation is not enabled, and stack guard
is added back to slot 11.

Before jumping to Owner SW, all lock bits will be cleared, so all entries can
be recycled by Owner SW.

Owner SW will be placed at the same entries as before (2, 3, 4).

Change-Id: Id9b6cd68cc24a5816d3e3dc8374b5533a7c6eb75
Signed-off-by: Yi-Hsuan Deng <[email protected]>
* Refine ld and .S file for IMM_ROM_EXT.
* Update the hello-world IMM_ROM_EXT to access some data in .data and
  .bss sections to make sure the startup initialization is implemented
  correctly.

Signed-off-by: Chia-Wei Liu <[email protected]>
Remove calling imm_rom_ext_main in rom_ext_main, and use prebuilt
IMM_ROM_EXT instead.

Signed-off-by: Chia-Wei Liu <[email protected]>
* Add mechanism to select corresponding IMM_ROM_EXT sections when
  building ROM_EXT based on the exec_env
* Add a new exec_env that is as same as silicon creator except an empty
  manifest to skip the signing phase when building IMM_ROM_EXT

Signed-off-by: Chia-Wei Liu <[email protected]>
As now we always link IMM_ROM_EXT into ROM_EXT, the address of
IMM_ROM_EXT's linker for slot A/B ROM_EXT should be adjusted. Apply
similar solution from ROM_EXT's linker scripts on IMM_ROM_EXT ones.

Also cleaned up the hello-world ROM code as we do not need them anymore.

Signed-off-by: Chia-Wei Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants