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] Make the ROM_EXT protect itself in flash #26014

Open
wants to merge 1 commit into
base: earlgrey_1.0.0
Choose a base branch
from

Conversation

cfrantz
Copy link
Contributor

@cfrantz cfrantz commented Jan 24, 2025

Ownership flash lockdown was protecting and locking all regions in the same slot that booted the owner code. However, the ROM_EXT and owner code don't have to boot from the same side of the flash.

  1. Disallow ownership configurations that have flash regions that overlap with the ROM_EXT region. It is an error to upload such a configuration, but if one already exists in the chip, the owner-specified ROM_EXT regions are ignored in favor of the self-protection.
  2. Always protect the ROM_EXT by using flash regions 0 and 1.
  3. Update the tests.

This is a cherry-pick & rewrite of #25892 for earlgrey_a1.
Fixes #25435.

Ownership flash lockdown was protecting and locking all regions in the
same slot that booted the owner code.  However, the ROM_EXT and owner
code don't have to boot from the same side of the flash.

1. Disallow ownership configurations that have flash regions that
   overlap with the ROM_EXT region.  It is an error to upload such a
   configuration, but if one already exists in the chip, the
   owner-specified ROM_EXT regions are ignored in favor of the
   self-protection.
2. Always protect the ROM_EXT by using flash regions 0 and 1.
3. Update the tests.

Fixes lowRISC#25435.

Signed-off-by: Chris Frantz <cfrantz@google.com>
@cfrantz cfrantz requested review from moidx and jettr January 24, 2025 23:13
@cfrantz cfrantz requested review from a team as code owners January 24, 2025 23:13
@cfrantz cfrantz requested review from jwnrt and removed request for a team and jwnrt January 24, 2025 23:13
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.

1 participant