Skip to content

Commit fae58fa

Browse files
committed
Check for DIMM failures in cosmo
check the various DIMM PCAMP signals
1 parent 0256d22 commit fae58fa

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

task/cosmo-spd/src/main.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ enum Trace {
3131
Ready,
3232
Present { index: usize, present: bool },
3333
TemperatureReadTimeout { index: usize, pos: usize },
34+
DimmFailure { index: usize },
3435
}
3536

3637
ringbuf!(Trace, 32, Trace::None);
@@ -263,6 +264,15 @@ impl idol_runtime::NotificationHandler for ServerImpl {
263264
}};
264265
}
265266

267+
macro_rules! check_dimm_failure {
268+
($dev:ident, $index:expr) => {
269+
let $dev = self.dimms.dimm_pcamp.$dev();
270+
if !$dev {
271+
ringbuf_entry!(Trace::DimmFailure { index: $index });
272+
}
273+
};
274+
}
275+
266276
for (index, present) in self.present.iter().cloned().enumerate() {
267277
let bus = index / 6; // FPGA bus (0 or 1)
268278
let dev = index % 6; // device index (SDI, 0-6)
@@ -318,6 +328,46 @@ impl idol_runtime::NotificationHandler for ServerImpl {
318328

319329
// Send the value to the sensors task
320330
self.sensor.post_now(DIMM_SENSORS[index][pos], temp_c);
331+
332+
match index {
333+
0 => {
334+
check_dimm_failure!(pcamp_a, 0);
335+
}
336+
1 => {
337+
check_dimm_failure!(pcamp_b, 1);
338+
}
339+
2 => {
340+
check_dimm_failure!(pcamp_c, 2);
341+
}
342+
3 => {
343+
check_dimm_failure!(pcamp_d, 3);
344+
}
345+
4 => {
346+
check_dimm_failure!(pcamp_e, 4);
347+
}
348+
5 => {
349+
check_dimm_failure!(pcamp_f, 5);
350+
}
351+
6 => {
352+
check_dimm_failure!(pcamp_g, 6);
353+
}
354+
7 => {
355+
check_dimm_failure!(pcamp_h, 7);
356+
}
357+
8 => {
358+
check_dimm_failure!(pcamp_i, 8);
359+
}
360+
9 => {
361+
check_dimm_failure!(pcamp_j, 9);
362+
}
363+
10 => {
364+
check_dimm_failure!(pcamp_k, 10);
365+
}
366+
11 => {
367+
check_dimm_failure!(pcamp_l, 11);
368+
}
369+
_ => unreachable!(),
370+
}
321371
}
322372
}
323373
set_timer_relative(TIMER_INTERVAL, notifications::TIMER_MASK);

0 commit comments

Comments
 (0)