Skip to content

Conversation

cfrantz
Copy link
Contributor

@cfrantz cfrantz commented Oct 6, 2025

Allow rescue mode to be configured such that a watchdog timeout can
trigger entry into rescue mode.

  1. Rename RESCUE_GPIO to RESCUE_MISC_GPIO.
  2. Add an configuration bit to the RESCUE_MISC_GPIO byte.
  3. Trigger rescue when the configuration bit is true and the reset reason includes a watchdog timeout.
  4. Add tests to verify entry into rescue after a watchdog timeout.
  5. Update opentitanlib to understand the enter_on_watchdog field.

Allow rescue mode to be configured such that a watchdog timeout can
trigger entry into rescue mode.

1. Add an configuration bit to the `RESCUE_MISC_GPIO` byte.
2. Trigger rescue when the configuration bit is true and the reset
   reason includes a watchdog timeout.
3. Add tests to verify entry into rescue after a watchdog timeout.

Signed-off-by: Chris Frantz <[email protected]>
Update the rescue configuration struct to understand the
`enter_on_watchdog` field.

Signed-off-by: Chris Frantz <[email protected]>
@cfrantz cfrantz requested review from a team as code owners October 6, 2025 17:53
@cfrantz cfrantz removed request for a team October 6, 2025 17:53
Copy link
Contributor

@moidx moidx left a comment

Choose a reason for hiding this comment

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

Hi @cfrantz, can you add some documentation with recommendations on when to use this mode of operation? Is it only intended to be used in development and/or test environments?

@cfrantz
Copy link
Contributor Author

cfrantz commented Oct 7, 2025

Hi @cfrantz, can you add some documentation with recommendations on when to use this mode of operation? Is it only intended to be used in development and/or test environments?

I updated the documentation. This option is an owner configuration decision; I don't anticipate any special restrictions on its use.

The change was motivated by a customer accidentally bricking one of their dev boards by flashing a correctly signed but invalid image (ie: the image contained garbage code which hung until the WDT reset). The customer was able to use rescue on their dev board (with SW_STRAPs as the rescue trigger).

The customer anticipated that if the same type of image error occurred in a production environment, they'd have a difficult time recovering the device without automatic entry into rescue mode. Since a valid and properly functioning owner firmware should always manage the watchdog, a watchdog timeout is a reasonable configuration for entering rescue mode in the ROM_EXT.

Document the rescue configuration options.

Signed-off-by: Chris Frantz <[email protected]>
@cfrantz cfrantz force-pushed the rescue-trigger-watchdog branch from 2649804 to cc73748 Compare October 7, 2025 17:49
@cfrantz cfrantz merged commit 03a7f4d into lowRISC:earlgrey_1.0.0 Oct 8, 2025
34 checks passed
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.

2 participants