gc_bba_test: disambiguate the speed sweep result
'highest good = 0' meant both 'only index 0 works' and 'nothing works', which are opposite diagnoses -- the first says oversampling, the second rules it out. Now reports the per-index map and says NONE explicitly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,7 @@ static int t_speed_sweep(char *m, size_t n)
|
|||||||
{
|
{
|
||||||
u32 saved = bba_speed, s;
|
u32 saved = bba_speed, s;
|
||||||
u32 best = 0;
|
u32 best = 0;
|
||||||
|
int any = 0;
|
||||||
char buf[40];
|
char buf[40];
|
||||||
int off = 0;
|
int off = 0;
|
||||||
buf[0] = 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++;
|
if (bba_r8(REG_NWAYS) != NWAYS_LINKUP) bad++;
|
||||||
off += snprintf(buf + off, sizeof(buf) - off, "%s%u", s ? "," : "",
|
off += snprintf(buf + off, sizeof(buf) - off, "%s%u", s ? "," : "",
|
||||||
(unsigned)(bad ? 0 : 1));
|
(unsigned)(bad ? 0 : 1));
|
||||||
if (!bad) best = s;
|
if (!bad) { best = s; any = 1; }
|
||||||
}
|
}
|
||||||
bba_speed = saved;
|
bba_speed = saved;
|
||||||
snprintf(m, n, "idx0..5 ok=[%s]; highest good = %u", buf, (unsigned)best);
|
/* `best` of 0 is ambiguous (index 0 works vs nothing works), so report
|
||||||
return best >= EXI_SPEED32MHZ ? 0 : 1;
|
* 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)
|
static int t_gap_sweep(char *m, size_t n)
|
||||||
|
|||||||
Reference in New Issue
Block a user