lowRISC / opentitan

OpenTitan: Open source silicon root of trust
https://www.opentitan.org
Apache License 2.0
2.58k stars 775 forks source link

[rom_ext] Boot Log does not report the correct primary_bl0_slot after a next_bl0_slot_req #24768

Open zhangarino opened 1 month ago

zhangarino commented 1 month ago

Description

I'm seeing this issue occur using the ROM_EXT 0.4 prodc prebuilt on the earlgrey_es_sival branch.

The primary boot slot field is not being reported correctly via the boot log for the boot cycle where the ROM_EXT handles the boot service to switch the primary bl0 slot. Having the primary slot being correctly reported by ROM_EXT is useful to know if an image update was successful or not.

How to reproduce the issue:

  1. In each slot have two valid BL0 images. The primary slot is boot slot A, and the active slot is A as well.
  2. Put the boot service request to change the primary slot to the inactive slot B with the following fields next_bl0_slot=kBootSlotUnspecified and primary_bl0_slot=kBootSlotB
  3. Make a SW reset request through rstmgr peripheral
  4. On bl0 re-entry the primary slot is swapped because the active slot is now B. However he boot log reports the primary slot as A still.

If I reboot the device again, the primary slot updates to the correct value, so it seems like some issue with the ROM_EXT not updating the boot_log correctly after the service request.

cfrantz commented 1 month ago

Thanks for the bug report. #24785 should correct the error.