-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[manuf] consildate LC state read code into testutil
This consolidates the LC state read code into a testutil for reuse across test harnesses. Additionally, this fixes a bug in the FT provisioning test harness that was making an incorrect assumption about the current LC state of the device. Signed-off-by: Tim Trippel <[email protected]>
- Loading branch information
1 parent
c2a64f8
commit 26451b3
Showing
5 changed files
with
63 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright lowRISC contributors. | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use std::time::Duration; | ||
|
||
use anyhow::Result; | ||
|
||
use crate::app::TransportWrapper; | ||
use crate::dif::lc_ctrl::{DifLcCtrlState, LcCtrlReg}; | ||
use crate::io::jtag::{JtagParams, JtagTap}; | ||
|
||
pub fn read_lc_state( | ||
transport: &TransportWrapper, | ||
jtag_params: &JtagParams, | ||
reset_delay: Duration, | ||
) -> Result<DifLcCtrlState> { | ||
transport.pin_strapping("PINMUX_TAP_LC")?.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()?; | ||
DifLcCtrlState::from_redundant_encoding(raw_lc_state) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters