Remove the device-ID one-shot: it made Swiss see no adapter at all
id_phase was set at reset and cleared permanently by the GC's first NCRA reset, after which a command-space read of register 0 returned 0x00000000. Swiss calls EXI_GetID from bba_exists() AND again from bba_requires_init(), long after init, and matches the result against EXI_MX98730EC_ID -- so with the one-shot spent no case matched and Swiss reported NO ADAPTER, not a broken one. Running gc_bba_test was enough to spend it, so the adapter would "disappear" after any test session. The justification in the comment was wrong. It claimed the fast path would otherwise hijack address 0 so the GC could never read NCRA back -- but NCRA is REGISTER space (0x80/0xC0 header) while the fast path requires byte 0 == 0x00, i.e. COMMAND space. They were never ambiguous, and no driver reads command register 0 for anything else (libogc2 reads 0x01/0x03/0x0B/0x0F, Swiss 0x03). Real hardware answers EXI_GetID whenever asked; that is how EXI enumerates devices. id_arm is now tied high, and the id_phase output, the FFSynchronizer that crossed it into the pin domain, and the BBATop wiring are all gone. The port stays only so the PHASE_METER build can disarm the fast path, which would otherwise send ID bytes instead of its constant 0x80. bba_top T1b reads the device ID AFTER an NCRA reset, which T1 (before any reset) structurally cannot catch. Mutation-tested: disarming the fast path returns 00 00 00 00 for both, exactly what Swiss saw. gc_bba_test: the ID tests no longer skip. A wrong ID is a FAILURE again, with no iface_alive() discrimination and no ordering requirement between suites -- the ID is readable at any point in a run. g_ncra_reset_done and iface_alive() are removed outright rather than left as a dead flag. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+19
-1
@@ -190,7 +190,6 @@ class BBATop(Elaboratable):
|
||||
# EXI outputs
|
||||
self.exi_miso.eq(cap.spi_miso),
|
||||
self.exi_miso_next.eq(cap.miso_next),
|
||||
cap.id_phase.eq(reg.id_phase),
|
||||
# Ring-overflow protection: the assembler needs the GC's read
|
||||
# pointer to know what it must not overwrite, and reports a
|
||||
# dropped frame back as RBFI (IR[7]).
|
||||
@@ -626,6 +625,25 @@ if __name__ == "__main__":
|
||||
await ctx.delay(HP * (2000)) # let W5100 init run
|
||||
await exi_write(ctx, 0x00, [0x08]) # NCRA SR bit → enable RX
|
||||
await ctx.delay(HP * (HALF * 2))
|
||||
|
||||
# T1b: the device ID STILL ANSWERS after an NCRA reset.
|
||||
#
|
||||
# It used to be a one-shot: `id_phase` was cleared by the GC's first
|
||||
# NCRA reset, after which a command-space read of reg 0 returned
|
||||
# 0x00000000. Real hardware answers EXI_GetID whenever asked -- that
|
||||
# is how EXI enumerates devices -- and Swiss calls it from
|
||||
# bba_exists() AND again from bba_requires_init(), long after init.
|
||||
# With the one-shot spent, Swiss reported NO ADAPTER AT ALL.
|
||||
#
|
||||
# T1 above reads the ID before any reset, so it cannot catch this;
|
||||
# the reset two lines up is what makes this check meaningful.
|
||||
dev2 = await exi_devid(ctx)
|
||||
print(f"T1b device ID after NCRA reset: {[f'0x{b:02X}' for b in dev2]}")
|
||||
if dev2 != [0x04, 0x02, 0x02, 0x00]:
|
||||
errors.append(f"T1b device ID after NCRA reset: got {dev2} "
|
||||
f"- the one-shot is back, Swiss would see no adapter")
|
||||
await ctx.delay(HP * (HALF * 2))
|
||||
|
||||
ctx.set(dut.w5100_int_n, 0) # W5100: a packet was received
|
||||
await ctx.delay(HP * (4000)) # let the W5100 RX + SPRAM write run
|
||||
ctx.set(dut.w5100_int_n, 1)
|
||||
|
||||
Reference in New Issue
Block a user