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

[bazel,otp,manuf] Support immutable ROM_EXT enabling during personalization #24826

Conversation

anthonychen1251
Copy link
Member

This PR has two commits that:

  1. Update ROM_EXT immutable section OTP gen tooling
    • Consider _rom_ext_start_address when determining the manifest start address to support the common rom_ext binary
    • Updates the OTP JSON file with data from an immutable ROM_EXT section only if the immutable ROM_EXT is enabled.
  2. Delay IMMUTABLE_ROM_EXT_EN provisioning to end of personalization
    • Separate the provisioning of the IMMUTABLE_ROM_EXT_EN OTP field from the rest of the CREATOR_SW_CFG partition
    • Use the ROM_EXT immutable section OTP gen tool by default when building personalization binary

This PR addresses #24610 partially.

Note: this depends on #24783 and #24789. Only review the last 2 commits.

@anthonychen1251 anthonychen1251 requested review from cfrantz and a team as code owners October 21, 2024 09:43
@anthonychen1251 anthonychen1251 requested review from engdoreis and removed request for a team October 21, 2024 09:43
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch 2 times, most recently from f66a3ce to d44c7ea Compare October 21, 2024 10:48
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch 2 times, most recently from db8a611 to 7dce6c3 Compare October 22, 2024 00:15
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch from 7dce6c3 to 83cd624 Compare October 22, 2024 05:41
Copy link
Contributor

@timothytrippel timothytrippel left a comment

Choose a reason for hiding this comment

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

few comments, otherwise LGTM.

util/design/gen-otp-immutable-rom-ext-json.py Outdated Show resolved Hide resolved
util/design/gen-otp-immutable-rom-ext-json.py Show resolved Hide resolved
* @return OK_STATUS if the IMMUTABLE_ROM_EXT_EN field was provisioned.
*/
OT_WARN_UNUSED_RESULT
status_t manuf_individualize_device_immutable_rom_ext_en_cfg(
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a thought here, since we now have a separate function for setting the:

  • flash_data_default_cfg
  • manuf_state
  • immutable_rom_ext_en
  • rom_bootstrap_dis
    perhaps we could combine these into a one function that take as inputs:
  • the OTP partition
  • the field / offset to program
    ?

This would consolidate a lot of very similar functionality. Ok to do in a follow up PR, or additional commit on this PR if you would like.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. That's a good improvement. If you don't mind, I could include this in the PR for #24617

This updates the logic to consider both `_ottf_start_address` and
 `_rom_ext_start_address` when determining the manifest start address.
This ensures compatibility with different ELF file formats that
generated from linker scripts such as `ottf_silicon_owner_a.ld` and
`rom_ext_slot_a.ld`, which may use either symbol to represent the start
address of the ROM_EXT section.

This also introduces a new feature that conditionally updates the OTP
JSON file with data from immutable ROM_EXT section. This update is
performed only if the immutable ROM_EXT is enabled.

Signed-off-by: Anthony Chen <[email protected]>
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch from 83cd624 to 59ae706 Compare October 23, 2024 05:52
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch from 59ae706 to 1f73ea3 Compare October 24, 2024 03:24
@anthonychen1251
Copy link
Member Author

The CI pipeline was failing (task:CI (Checkout repository) ) for this PR. I've pushed a small update with reworded commit messages to see if that resolves the issue.

This separates the provisioning of the IMMUTABLE_ROM_EXT_EN OTP field
from the rest of the CREATOR_SW_CFG partition. This is necessary because
the personalization firmware doesn't include an immutable ROM_EXT
section. Enabling immutable ROM_EXT earlier would prevent the
personalization firmware from being executed.

This also builds personalization firmware using the ROM_EXT immutable
section OTP generation tool by default.

Signed-off-by: Anthony Chen <[email protected]>
@anthonychen1251 anthonychen1251 force-pushed the support-provision-im-ext-during-perso branch from 1f73ea3 to e8897b0 Compare October 24, 2024 10:21
@timothytrippel timothytrippel merged commit 7fe8a9c into lowRISC:master Oct 24, 2024
42 checks passed
@timothytrippel timothytrippel added the CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0 label Oct 29, 2024
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants