Skip to content

Commit

Permalink
[sival] Add option to skip reset on lc state read.
Browse files Browse the repository at this point in the history
Add `opentitantool` argument to skip reset on `LcStateRead`. This is
useful when debugging device alerts  as the device will report
escalation state as a result of an escalation. Since the escalation
status is not persisted across resets, we need to be able to connect to
LC_TAP to read without performing a reset. This is only possible in lc
states that support continuous PINMUX_TAP polling.

Signed-off-by: Miguel Osorio <[email protected]>
  • Loading branch information
moidx authored and timothytrippel committed Dec 14, 2024
1 parent a7168f5 commit a155cb2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sw/host/opentitantool/src/command/lc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ pub struct LcStateRead {

#[command(flatten)]
pub jtag_params: JtagParams,

// Skip device reset before connecting to LC controller. This is only
// applicable for lifecycle states that support PINMUX_TAP continuous
// sampling.
#[arg(short, long, action = clap::ArgAction::Set, default_value = "false")]
pub skip_reset: bool,
}

impl CommandDispatch for LcStateRead {
Expand All @@ -89,7 +95,13 @@ impl CommandDispatch for LcStateRead {
) -> Result<Option<Box<dyn Annotate>>> {
// Set the TAP straps for the lifecycle controller and reset.
transport.pin_strapping("PINMUX_TAP_LC")?.apply()?;
transport.reset_target(self.reset_delay, true)?;

if !self.skip_reset {
transport.reset_target(self.reset_delay, true)?;
} else {
// Unconditionally wait for the device to switch tap.
std::thread::sleep(Duration::from_millis(10));
}

// Spawn an OpenOCD process and connect to the LC JTAG TAP.
let mut jtag = self
Expand Down

0 comments on commit a155cb2

Please sign in to comment.