Skip to content

Commit 7ad2fe2

Browse files
moidxgithub-actions[bot]
authored andcommitted
[ottool] Add support for RMA strapping to life-cycle transition command.
This is required for cases where regular bootstrap is not available. Signed-off-by: Miguel Osorio <[email protected]> (cherry picked from commit bbdae75)
1 parent 284ec94 commit 7ad2fe2

File tree

1 file changed

+12
-2
lines changed
  • sw/host/opentitantool/src/command

1 file changed

+12
-2
lines changed

sw/host/opentitantool/src/command/lc.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ pub struct Transition {
273273
#[arg(long, default_value = "0x00000000000000000000000000000000")]
274274
pub token: String,
275275

276+
/// Whether to assert ROM RMA bootstrap strapping during the transition.
277+
#[arg(long, default_value = "false")]
278+
pub use_rma_bootstrap: bool,
279+
276280
#[command(flatten)]
277281
pub jtag_params: JtagParams,
278282
}
@@ -293,14 +297,20 @@ impl CommandDispatch for Transition {
293297
.create(transport)?
294298
.connect(JtagTap::LcTap)?;
295299

300+
let strap_name = if self.use_rma_bootstrap {
301+
"RMA_BOOTSTRAP"
302+
} else {
303+
"ROM_BOOTSTRAP"
304+
};
305+
296306
// In order to be on the safe side, we're asserting ROM bootstrap and
297307
// reset the chip to prevent ROM from going into a reset loop.
298-
let rom_bootstrap = transport.pin_strapping("ROM_BOOTSTRAP")?;
308+
let rom_bootstrap = transport.pin_strapping(strap_name)?;
309+
log::info!("Asserting {} strapping during transition.", strap_name);
299310
rom_bootstrap.apply()?;
300311

301312
// Reset the chip so that LC_CTRL is in a clean state.
302313
let _ = transport.reset_with_delay(UartRx::Keep, Duration::from_millis(50));
303-
std::thread::sleep(Duration::from_millis(50));
304314

305315
// Check whether this is a valid transition.
306316
let token = parse_token_str(self.token.as_str())?;

0 commit comments

Comments
 (0)