firmware/liboard/sdram.rs: iterate read multiple times in read_delays to avoid false positives

This commit is contained in:
Florent Kermarrec 2018-02-21 14:15:35 +01:00
parent 86ceee570f
commit afc16a67b6
1 changed files with 12 additions and 10 deletions

View File

@ -177,11 +177,12 @@ mod ddr {
let delay = Cell::new(0); let delay = Cell::new(0);
let incr_delay_until = |expected| { let incr_delay_until = |expected| {
while delay.get() < DDRPHY_MAX_DELAY { while delay.get() < DDRPHY_MAX_DELAY {
let mut working = true;
for _ in 0..64 {
sdram_phy::command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS| sdram_phy::command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|
DFII_COMMAND_RDDATA); DFII_COMMAND_RDDATA);
spin_cycles(15); spin_cycles(15);
let mut working = true;
for p in 0..DFII_NPHASES { for p in 0..DFII_NPHASES {
for &offset in [n, n + DQS_SIGNAL_COUNT].iter() { for &offset in [n, n + DQS_SIGNAL_COUNT].iter() {
let addr = DFII_PIX_RDDATA_ADDR[p].offset(offset as isize); let addr = DFII_PIX_RDDATA_ADDR[p].offset(offset as isize);
@ -191,6 +192,7 @@ mod ddr {
} }
} }
} }
}
if working == expected { if working == expected {
break break