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

[rom_ext] Ownership transfer manual cherry-picks from earlgrey_es_sival #24939

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

moidx
Copy link
Contributor

@moidx moidx commented Oct 30, 2024

Contains manual cherry-picks for commits included in the following PRs:

These changes are being merged into earlgrey_1.0.0.

@moidx moidx requested a review from timothytrippel October 30, 2024 04:07
@moidx moidx requested review from a team as code owners October 30, 2024 04:07
@moidx moidx removed request for a team October 30, 2024 04:08
Test the configuration options of the rescue protocol.

The `transfer_lib` is enhanced to allow for pre-set variations of the
ownership config through the `OwnerConfigKind` enum.  The rust-based
test harnesses are near-clones of the `transfer_test` harness, however,
they allow for certain expected errors during the transfer process
(such as a `Cancel` during the rescue upload) and test for specific
conditions after owner activation.

`rescue_limit_test`: Fixes lowRISC#24474.
`rescue_permission_test`: Fixes lowRISC#24475.

Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit f94ca18)
Initially we were considering the SPI bootstrap mechanism as the ROM_EXT
rescue mechanism, however, we ended up going a different direction.

1. Remove the ROM_EXT SPI bootstrap code.

Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit bff38c1)
1. Add the capability to perform lockdown of the MP region configuration
   via the REGION_CFG_REGWEN registers.
2. In `owner_block_flash_apply`, apply the PROTECT_WHEN_PRIMARY and LOCK
   properties only when lockdown is requested.
3. In the `{un,}locked_init` functions, do not perform lockdown:
   - We do not want regions locked for the `LockedOwner` state should
     the user request rescue mode.
   - We do not want regions locked in the ownership unlocked states.
4. Prior to execution handoff to owner code, engage the owner-configured
   locks.

Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit de7df51)
`flash_permission_test`: Fixes: lowRISC#24476
Adds a test harness that verifies the flash configuration state of data
regions.

Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit 890e5bf)
@moidx moidx force-pushed the a1-ownership-xfer-cherrypics-v1 branch from 93b473f to 52d6e0f Compare October 30, 2024 04:27
@moidx
Copy link
Contributor Author

moidx commented Oct 31, 2024

Ran the following test cases locally as well:

   48  [2024-10-30 17:02:54 -0700] bazel test --test_output=streamed //sw/device/silicon_creator/rom_ext/e2e/ownership:flash_permission_test_fpga_cw310_rom_ext
   49  [2024-10-30 17:07:03 -0700] bazel test --test_output=streamed //sw/device/silicon_creator/rom_ext/e2e/ownership:rescue_permission_test_fpga_cw310_rom_ext
   50  [2024-10-30 17:08:06 -0700] bazel test --test_output=streamed //sw/device/silicon_creator/rom_ext/e2e/ownership:rescue_limit_test_fpga_cw310_rom_ext

@moidx moidx merged commit 173c8a2 into lowRISC:earlgrey_1.0.0 Oct 31, 2024
27 of 29 checks passed
@moidx moidx deleted the a1-ownership-xfer-cherrypics-v1 branch October 31, 2024 00:09
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.

3 participants