diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/crt0.S | 20 |
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 | ||
90 | 1: | ||
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 |