summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_emulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_emulation.c')
-rw-r--r--kernel/gsp_emulation.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/gsp_emulation.c b/kernel/gsp_emulation.c
index 5522bf3..bca8a52 100644
--- a/kernel/gsp_emulation.c
+++ b/kernel/gsp_emulation.c
@@ -234,13 +234,23 @@ static void gsp_emu_poll_boot(struct gsp_emu_context *ctx)
return;
}
- /* Any other STARTCPU kick (resume/unload/etc.): just complete it */
+ /* Any other STARTCPU kick (resume/unload/etc.): complete it.
+ * SEC2 kicks report their ucode result in SEC2_MAILBOX0 (0=success) -
+ * e.g. Booter Unload during GPU shutdown. Without clearing it the
+ * driver reads a stale/garbage error code (0xff) and the unload
+ * fails, killing the subsequent re-init. A SEC2 kick after a
+ * completed boot is a GSP shutdown/reload: drop the boot state
+ * (GSP no longer active, queue dead). */
if (gsp_cpuctl & GSP_EMU_CPUCTL_STARTCPU)
gsp_emu_shadow_write32(ctx, GSP_EMU_REG_GSP_CPUCTL,
GSP_EMU_CPUCTL_HALTED);
- if (sec2_cpuctl & GSP_EMU_CPUCTL_STARTCPU)
+ if (sec2_cpuctl & GSP_EMU_CPUCTL_STARTCPU) {
+ gsp_emu_shadow_write32(ctx, GSP_EMU_REG_SEC2_MAILBOX0, 0);
gsp_emu_shadow_write32(ctx, GSP_EMU_REG_SEC2_CPUCTL,
GSP_EMU_CPUCTL_HALTED);
+ if (ctx->boot_stage == GSP_BOOT_STAGE_BOOTER_DONE)
+ gsp_emu_clear_boot_state(ctx, "Booter unload/reload kick");
+ }
}
/* ============================================================