Skip to content

Commit

Permalink
- Re-enable KunaiGC in reload stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Jul 4, 2024
1 parent 667842d commit 4812d51
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cube/patches/base/ipl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Extrems <extrems@extremscorner.org>
* Copyright (c) 2022-2024, Extrems <extrems@extremscorner.org>
*
* This file is part of Swiss.
*
Expand All @@ -24,12 +24,12 @@

static void exi_select(void)
{
EXI[EXI_CHANNEL_0][0] = (EXI[EXI_CHANNEL_0][0] & 0x405) | ((1 << EXI_DEVICE_1) << 7) | (EXI_SPEED_8MHZ << 4);
EXI[EXI_CHANNEL_0][0] = ((1 << EXI_DEVICE_1) << 7) | (EXI_SPEED_8MHZ << 4);
}

static void exi_deselect(void)
{
EXI[EXI_CHANNEL_0][0] &= 0x405;
EXI[EXI_CHANNEL_0][0] = 0;
}

static void exi_imm_write(uint32_t data, uint32_t len)
Expand Down
48 changes: 47 additions & 1 deletion cube/patches/stub/crt0.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2023, Extrems <extrems@extremscorner.org>
* Copyright (c) 2020-2024, Extrems <extrems@extremscorner.org>
*
* This file is part of Swiss.
*
Expand Down Expand Up @@ -83,13 +83,59 @@ startup:

reset:
lis r3, 0x0C00
#ifndef APPLOADER
li r4, 0x6800
li r0, ((1 << 1) << 7) | (3 << 4)
ecowx r0, r4, r3
li r5, 0x6800 + 4*4
lis r0, 0xC000
ecowx r0, r5, r3
li r6, 0x6800 + 3*4
li r0, ((4 - 1) << 4) | 0b01
ecowx r0, r6, r3
1: eciwx r0, r6, r3
andi. r0, r0, 0b01
bne 1b
lis r0, 0x0100
ecowx r0, r5, r3
li r0, ((4 - 1) << 4) | 0b01
ecowx r0, r6, r3
2: eciwx r0, r6, r3
andi. r0, r0, 0b01
bne 2b
ecowx r0, r4, r3
#endif
li r4, 0x3000 + 9*4
li r0, 0b000
ecowx r0, r4, r3
b .

.globl run
run:
#ifdef APPLOADER
lis r4, 0x0C00
li r5, 0x6800
li r0, ((1 << 1) << 7) | (3 << 4)
ecowx r0, r5, r4
li r6, 0x6800 + 4*4
lis r0, 0xC000
ecowx r0, r6, r4
li r7, 0x6800 + 3*4
li r0, ((4 - 1) << 4) | 0b01
ecowx r0, r7, r4
1: eciwx r0, r7, r4
andi. r0, r0, 0b01
bne 1b
lis r0, 0x0600
ecowx r0, r6, r4
li r0, ((4 - 1) << 4) | 0b01
ecowx r0, r7, r4
2: eciwx r0, r7, r4
andi. r0, r0, 0b01
bne 2b
ecowx r0, r5, r4
#endif

oris r3, r3, 0x8000
mtsrr0 r3
li r3, 0x30
Expand Down

0 comments on commit 4812d51

Please sign in to comment.