Skip to content

Commit

Permalink
[ottool] Apply rom_bootstrap before connecting to lc tap.
Browse files Browse the repository at this point in the history
Added to read_lc_state to make the call stable when ROM execution is
enabled.

Signed-off-by: Miguel Osorio <[email protected]>
  • Loading branch information
moidx committed Dec 22, 2023
1 parent a714e2e commit 283143d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sw/host/opentitanlib/src/test_utils/lc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ pub fn read_lc_state(
reset_delay: Duration,
) -> Result<DifLcCtrlState> {
transport.pin_strapping("PINMUX_TAP_LC")?.apply()?;

// Apply bootstrap pin to be able to connect to JTAG when ROM execution is
// enabled.
transport.pin_strapping("ROM_BOOTSTRAP")?.apply()?;
transport.reset_target(reset_delay, true)?;
let mut jtag = jtag_params.create(transport)?.connect(JtagTap::LcTap)?;
let raw_lc_state = jtag.read_lc_ctrl_reg(&LcCtrlReg::LcState)?;
jtag.disconnect()?;
transport.pin_strapping("PINMUX_TAP_LC")?.remove()?;
transport.pin_strapping("ROM_BOOTSTRAP")?.remove()?;
DifLcCtrlState::from_redundant_encoding(raw_lc_state)
}

0 comments on commit 283143d

Please sign in to comment.