summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-16 19:25:51 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-16 23:21:29 +0000
commit67f7d399e5dd3280a2e5126d1b2d673447dc3aba (patch)
tree4a80c4326272ec87bec2593010193c70b783c883
parentc676736792f0df5462d2ff7c1af3ebee8bbbf577 (diff)
downloadrockbox-67f7d399e5dd3280a2e5126d1b2d673447dc3aba.tar.gz
rockbox-67f7d399e5dd3280a2e5126d1b2d673447dc3aba.zip
x1000: restore crt0.S cache flush
I-cache must be flushed after copying code to IRAM... duh. Change-Id: I6eacc4b7c4385175724c947f6c53f7bbddcb6295
-rw-r--r--firmware/target/mips/ingenic_x1000/crt0.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/crt0.S b/firmware/target/mips/ingenic_x1000/crt0.S
index 5610587094..fbac12861d 100644
--- a/firmware/target/mips/ingenic_x1000/crt0.S
+++ b/firmware/target/mips/ingenic_x1000/crt0.S
@@ -7,7 +7,7 @@
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2021 Aidan MacDonald 10 * Copyright (C) 2021-2022 Aidan MacDonald
11 * 11 *
12 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
@@ -82,6 +82,24 @@ _realstart:
82 bal _clear 82 bal _clear
83 move a1, k0 83 move a1, k0
84 84
85 /* Write back D-cache and invalidate I-cache */
86 li v0, 0x80000000
87 ori v1, v0, (0x4000 - 32)
88 mtc0 zero, C0_TAGLO
89 mtc0 zero, C0_TAGHI
901:
91 cache DCIndexWBInv, 0(v0)
92 cache ICIndexStTag, 0(v0)
93 bne v0, v1, 1b
94 addiu v0, v0, 32
95
96 /* Invalidate BTB */
97 mfc0 v0, C0_Config, 7
98 nop
99 ori v0, v0, 2
100 mtc0 v0, C0_Config, 7
101 nop
102
85 /* Jump to C code */ 103 /* Jump to C code */
86 jal system_early_init 104 jal system_early_init
87 nop 105 nop