mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Model the CPU complex's reset view and per-core clock stop
RST_CPU_CMPLX_SET/CLR (0x340/0x344) and CLK_CPUG_CMPLX_SET/CLR (0x460/0x464) read back the last value written, like plain registers. - RST_CPU_CMPLX_SET has RST_CPUG_CMPLX's fields and reset value (TRM 5.2.113): it is the active cluster's view, and the Switch runs the G cluster. It and its CLR partner now act on the same reset state as the CPUG pair, releasing and stopping CPU0 alike, and read it back. - CLK_CPUG_CMPLX (0x378, TRM 5.2.122) and its SET/CLR strobes track CPUGn_CLK_STP, and all three read the register. A stopped CPU0 keeps its state and executes nothing while emulated time passes; clearing the stop resumes it where it was. The CCPLEX test now releases CPU0 with its clock stopped, checks it does not run and that the registers read back, then clears the stop. Against the previous binary those three checks fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYewwDPujjo5B2xRyC5Grb
This commit is contained in:
4 files changed
+63
-2
No files matched your search
@@ -13,6 +13,8 @@
|
||||
* of reset, PLLX, RAM repair, SB_AA64_RESET_LOW - then release it. An
|
||||
* AArch64 blob copied to DRAM records CurrentEL and a TIMERUS delta in
|
||||
* a mailbox, writes a magic word last, and parks in WFE.
|
||||
* Released first with its clock stopped (CLK_CPUG_CMPLX), it must
|
||||
* stay still until the stop is cleared.
|
||||
* 3. Put CPU0 back into reset and power the console off.
|
||||
*
|
||||
* Built by `make test` with arm-none-eabi-gcc; no other toolchain needed, as
|
||||
@@ -139,7 +141,23 @@ void _start(void) {
|
||||
while (!(REG(FLOW + 0x40) & 2))
|
||||
;
|
||||
REG(CAR + 0x434) = 1u << 3; /* RST_DEV_V_CLR: MSELECT */
|
||||
|
||||
/* Released with its clock stopped, CPU0 must not run until the stop is
|
||||
* cleared; the strobes and the active-cluster reset view read back. */
|
||||
REG(CAR + 0x460) = 1u << 8; /* CLK_CPUG_CMPLX_SET: CPU0 */
|
||||
release_cpu0();
|
||||
udelay(5000);
|
||||
puts_(mb[0] == PCIE_MAGIC ? "clock stopped: CPU0 RAN (wrong)\n"
|
||||
: "clock stopped: CPU0 held still\n");
|
||||
puts_("clock stop reads ");
|
||||
puthex(REG(CAR + 0x378)); /* CLK_CPUG_CMPLX */
|
||||
putc_(' ');
|
||||
puthex(REG(CAR + 0x464)); /* CLK_CPUG_CMPLX_CLR */
|
||||
putc_('\n');
|
||||
puts_(REG(CAR + 0x340) == REG(CAR + 0x450) /* RST_CPU(G)_CMPLX_SET */
|
||||
? "reset view: RST_CPU_CMPLX matches RST_CPUG_CMPLX\n"
|
||||
: "reset view: RST_CPU_CMPLX differs\n");
|
||||
REG(CAR + 0x464) = 1u << 8; /* CLK_CPUG_CMPLX_CLR */
|
||||
|
||||
u32 start = REG(TIMERUS);
|
||||
while (mb[0] != PCIE_MAGIC && REG(TIMERUS) - start < 100000)
|
||||
|
||||
Reference in new issue
Block a user