Skip to content

Commit 832d8f0

Browse files
committed
wip
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent c516d4b commit 832d8f0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

framework_lib/src/chromium_ec/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl CrosEc {
566566
/// Check for success and returns Err if not successful
567567
pub fn retimer_enable_fwupd(&self, retimer: u8, enable: bool) -> EcResult<()> {
568568
if self.retimer_in_fwupd_mode(retimer)? == enable {
569-
info!("Retimer update mode already: {:?}", enable);
569+
error!("Retimer update mode already: {:?}", enable);
570570
return Ok(());
571571
}
572572
EcRequestRetimerControl {
@@ -579,6 +579,8 @@ impl CrosEc {
579579
}
580580
.send_command(self)?;
581581

582+
os_specific::sleep(1000_000);
583+
error!("Failed to set retimer update mode to: {}", enable);
582584
if self.retimer_in_fwupd_mode(retimer)? != enable {
583585
return Err(EcError::DeviceError(format!(
584586
"Failed to set retimer update mode to: {}",

framework_lib/src/commandline/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ fn selftest(ec: &CrosEc) -> Option<()> {
16391639
// - Parade Retimer on both back ports (with firmware)
16401640
fn selftest_retimer(ec: &CrosEc) -> EcResult<()> {
16411641
// TODO: Make sure that it can work for the NVIDIA dGPU retimer and increase to 3
1642-
for i in 0..2 {
1642+
for i in 1..2 {
16431643
let update_mode = ec.retimer_in_fwupd_mode(i);
16441644
if update_mode == Err(EcError::Response(EcResponseStatus::InvalidParameter)) {
16451645
println!(" Retimer status not supported on this platform. Cannot test");
@@ -1648,15 +1648,21 @@ fn selftest_retimer(ec: &CrosEc) -> EcResult<()> {
16481648
println!(" Retimers on PD Controller {}", i);
16491649
println!(" In update mode: {:?}", update_mode);
16501650
if update_mode? {
1651-
println!(" Unexpected! During normal operaton it should not be in update mode! Disabling...");
1651+
println!(" Disabling it to start test.");
16521652
ec.retimer_enable_fwupd(i, false)?;
1653+
os_specific::sleep(100);
16531654
}
1655+
16541656
println!(" Enabling update mode");
16551657
let success = ec.retimer_enable_fwupd(i, true);
1656-
println!(" Success: {:?}", success);
1658+
os_specific::sleep(100);
1659+
//println!(" Result: {:?}", success);
1660+
println!(" In update mode: {:?}", ec.retimer_in_fwupd_mode(i).unwrap());
16571661

16581662
println!(" Disabling again");
16591663
ec.retimer_enable_fwupd(i, false)?;
1664+
os_specific::sleep(100);
1665+
println!(" In update mode: {:?}", ec.retimer_in_fwupd_mode(i).unwrap());
16601666
success?;
16611667
}
16621668
Ok(())

0 commit comments

Comments
 (0)