Skip to content

Conversation

@sasdf
Copy link
Contributor

@sasdf sasdf commented Jan 28, 2026

This change introduces a new bit flag in the rescue configuration's size field to indicate whether the rescue region should be erased in both flash slots/banks.

Since the rescue config is not expandable and there's no reserved words, I repurpose the MSB of the rescue region size field for this bit flag.

  /**
   * The size of the rescue region in flash (in pages).
   *
   *           15 14                 0
   * +-----------+--------------------+
   * | EraseBoth |               Size |
   * +-----------+--------------------+
   *
   * EraseBoth:
   *  0 - Erase the requested region to be rescue.
   *  1 - Erase rescuable regions in both slots.
   */
  uint16_t size;

When EraseBoth (bit 15) is set, the rescue protocol will erase the specified page range in both Bank 0 and Bank 1, regardless of which slot is currently being targeted for rescue. If the recuse target is ROM_EXT, it will erase both configured ranges plus the inactive ROM_EXT slot.

This change costs 56 bytes in ROM_EXT.

This change updates the `TEST_OWNER_CONFIGS` in the `rom_ext` BUILD file to use
the virtual slot linker script and the corresponding dice x509 imm_section.
This allows for more flexible slot assignment during testing.

Change-Id: I319ed9e559e4ed034fea2bddde96b15768e70e4e
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
@sasdf sasdf force-pushed the mgT2644fe4c branch 4 times, most recently from e126612 to 54199ed Compare January 28, 2026 08:34
This change introduces a new bit in the rescue configuration's `size`
field to indicate whether the rescue region should be erased in both
flash slots.

When `EraseBoth` (bit 15) is set, the rescue protocol will erase the
specified page range in both Bank 0 and Bank 1, regardless of which
slot is currently being targeted for rescue.

Change-Id: I2644fe4c4ce21a7b36086cef2e54885062d70ff7
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
@sasdf sasdf marked this pull request as ready for review January 28, 2026 17:55
@sasdf sasdf requested a review from a team as a code owner January 28, 2026 17:55
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