satman: backport JESD204 STPL fix from 73271600

pull/1598/head
Sebastien Bourdeauducq 2020-12-14 18:11:35 +08:00
parent a694d130b7
commit 33a15a6513
2 changed files with 18 additions and 4 deletions

View File

@ -104,10 +104,6 @@ pub mod jdac {
basic_request(dacno, jdac_requests::PRBS, 0)?;
jesd::prbs(dacno, false);
jesd::stpl(dacno, true);
basic_request(dacno, jdac_requests::STPL, 0)?;
jesd::stpl(dacno, false);
basic_request(dacno, jdac_requests::INIT, 0)?;
clock::spin_us(5000);
@ -129,4 +125,19 @@ pub mod jdac {
}
}
}
pub fn stpl() -> Result<(), &'static str> {
for dacno in 0..csr::JDCG.len() {
let dacno = dacno as u8;
info!("Running STPL test on DAC-{}...", dacno);
jesd::stpl(dacno, true);
basic_request(dacno, jdac_requests::STPL, 0)?;
jesd::stpl(dacno, false);
info!(" ...done STPL test");
}
Ok(())
}
}

View File

@ -526,6 +526,9 @@ pub extern fn main() -> i32 {
let rep0_is_up = repeaters[0].is_up();
if rep0_is_up && !rep0_was_up {
jdcg::jdac::init();
if let Err(e) = jdcg::jdac::stpl() {
error!("STPL test failed: {}", e);
}
}
rep0_was_up = rep0_is_up;
}