From 7dcf5ec589a3cf9fcb434a2d3bb3d7b895504e7f Mon Sep 17 00:00:00 2001 From: Wolfvak Date: Thu, 24 Jun 2021 12:36:22 -0300 Subject: [PATCH 1/2] fix new3ds clocking when booting from fb3ds (untested) previously when changing the clock to itself it'd never retrigger the irq and the loader would get stuck in a loop now, it just returns when trying to set to the current mode --- arm11/source/smp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arm11/source/smp.c b/arm11/source/smp.c index f87ebe2..9108341 100644 --- a/arm11/source/smp.c +++ b/arm11/source/smp.c @@ -31,6 +31,9 @@ static void wait_cycles(unsigned short cycles) static void set_clock(short socmode) { + if (get_pdn_lgr_socmode() == socmode) + return; + set_pdn_lgr_socmode(socmode); // Loop until the ACK bit is set. From b6b46936779b786175523dc4cce8a5393d473e58 Mon Sep 17 00:00:00 2001 From: Wolfvak Date: Mon, 18 Oct 2021 09:45:06 -0300 Subject: [PATCH 2/2] actually fix the reclocking, also disable the final upclock to retain sane clockspeeds --- arm11/source/smp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arm11/source/smp.c b/arm11/source/smp.c index 9108341..f2d9ab2 100644 --- a/arm11/source/smp.c +++ b/arm11/source/smp.c @@ -31,7 +31,9 @@ static void wait_cycles(unsigned short cycles) static void set_clock(short socmode) { - if (get_pdn_lgr_socmode() == socmode) + set_pdn_lgr_socmode(get_pdn_lgr_socmode()); + + if ((get_pdn_lgr_socmode() & 7) == socmode) return; set_pdn_lgr_socmode(socmode); @@ -98,7 +100,7 @@ static void online_cores23(void) scu_set_cpu_stat(scu_get_cpu_stat() & 0x0F); downclock(); setup_overlays(); - upclock(); + // upclock(); gic_send_swi(2, 2); gic_send_swi(3, 3); }