diff --git a/gc_bba_test/source/tests.c b/gc_bba_test/source/tests.c index ac1ec5e..a3e5b76 100644 --- a/gc_bba_test/source/tests.c +++ b/gc_bba_test/source/tests.c @@ -139,6 +139,7 @@ static int t_speed_sweep(char *m, size_t n) { u32 saved = bba_speed, s; u32 best = 0; + int any = 0; char buf[40]; int off = 0; buf[0] = 0; @@ -149,11 +150,17 @@ static int t_speed_sweep(char *m, size_t n) if (bba_r8(REG_NWAYS) != NWAYS_LINKUP) bad++; off += snprintf(buf + off, sizeof(buf) - off, "%s%u", s ? "," : "", (unsigned)(bad ? 0 : 1)); - if (!bad) best = s; + if (!bad) { best = s; any = 1; } } bba_speed = saved; - snprintf(m, n, "idx0..5 ok=[%s]; highest good = %u", buf, (unsigned)best); - return best >= EXI_SPEED32MHZ ? 0 : 1; + /* `best` of 0 is ambiguous (index 0 works vs nothing works), so report + * the per-index map and say NONE explicitly. */ + if (!any) + snprintf(m, n, "ok=[%s] NONE work - not an oversampling issue", buf); + else + snprintf(m, n, "ok=[%s] highest good idx=%u (5=27MHz)", buf, + (unsigned)best); + return (any && best >= EXI_SPEED32MHZ) ? 0 : 1; } static int t_gap_sweep(char *m, size_t n)