Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/xtensa/kernel/head.S |
| 3 | * |
| 4 | * Xtensa Processor startup code. |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | * |
Marc Gauthier | 2d1c645 | 2013-01-05 04:57:17 +0400 | [diff] [blame] | 10 | * Copyright (C) 2001 - 2008 Tensilica Inc. |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 11 | * |
| 12 | * Chris Zankel <chris@zankel.net> |
| 13 | * Marc Gauthier <marc@tensilica.com, marc@alumni.uwaterloo.ca> |
| 14 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> |
| 15 | * Kevin Chea |
| 16 | */ |
| 17 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 18 | #include <asm/processor.h> |
| 19 | #include <asm/page.h> |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 20 | #include <asm/cacheasm.h> |
Max Filippov | c622b29 | 2012-11-19 07:00:41 +0400 | [diff] [blame] | 21 | #include <asm/initialize_mmu.h> |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 22 | #include <asm/mxregs.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 23 | |
Tim Abbott | 0ebdcb4 | 2009-04-25 22:10:57 -0400 | [diff] [blame] | 24 | #include <linux/init.h> |
Chris Zankel | adba09f | 2007-05-31 17:48:07 -0700 | [diff] [blame] | 25 | #include <linux/linkage.h> |
| 26 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 27 | /* |
| 28 | * This module contains the entry code for kernel images. It performs the |
| 29 | * minimal setup needed to call the generic C routines. |
| 30 | * |
| 31 | * Prerequisites: |
| 32 | * |
| 33 | * - The kernel image has been loaded to the actual address where it was |
| 34 | * compiled to. |
| 35 | * - a2 contains either 0 or a pointer to a list of boot parameters. |
| 36 | * (see setup.c for more details) |
| 37 | * |
| 38 | */ |
| 39 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 40 | /* |
| 41 | * _start |
| 42 | * |
| 43 | * The bootloader passes a pointer to a list of boot parameters in a2. |
| 44 | */ |
| 45 | |
| 46 | /* The first bytes of the kernel image must be an instruction, so we |
| 47 | * manually allocate and define the literal constant we need for a jx |
| 48 | * instruction. |
| 49 | */ |
| 50 | |
Tim Abbott | 0ebdcb4 | 2009-04-25 22:10:57 -0400 | [diff] [blame] | 51 | __HEAD |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 52 | .begin no-absolute-literals |
| 53 | |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 54 | ENTRY(_start) |
| 55 | |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 56 | /* Preserve the pointer to the boot parameter list in EXCSAVE_1 */ |
| 57 | wsr a2, excsave1 |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 58 | _j _SetupOCD |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 59 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 60 | .align 4 |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 61 | .literal_position |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 62 | _SetupOCD: |
| 63 | /* |
| 64 | * Initialize WB, WS, and clear PS.EXCM (to allow loop instructions). |
| 65 | * Set Interrupt Level just below XCHAL_DEBUGLEVEL to allow |
| 66 | * xt-gdb to single step via DEBUG exceptions received directly |
| 67 | * by ocd. |
| 68 | */ |
| 69 | movi a1, 1 |
| 70 | movi a0, 0 |
| 71 | wsr a1, windowstart |
| 72 | wsr a0, windowbase |
| 73 | rsync |
| 74 | |
| 75 | movi a1, LOCKLEVEL |
| 76 | wsr a1, ps |
| 77 | rsync |
| 78 | |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 79 | .global _SetupMMU |
| 80 | _SetupMMU: |
| 81 | Offset = _SetupMMU - _start |
| 82 | |
| 83 | #ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX |
| 84 | initialize_mmu |
Max Filippov | c5a771d | 2013-06-09 04:52:11 +0400 | [diff] [blame] | 85 | #if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY |
| 86 | rsr a2, excsave1 |
Max Filippov | 40dc948 | 2018-11-13 23:46:42 -0800 | [diff] [blame] | 87 | movi a3, XCHAL_KSEG_PADDR |
| 88 | bltu a2, a3, 1f |
| 89 | sub a2, a2, a3 |
| 90 | movi a3, XCHAL_KSEG_SIZE |
Max Filippov | c5a771d | 2013-06-09 04:52:11 +0400 | [diff] [blame] | 91 | bgeu a2, a3, 1f |
Max Filippov | 40dc948 | 2018-11-13 23:46:42 -0800 | [diff] [blame] | 92 | movi a3, XCHAL_KSEG_CACHED_VADDR |
Max Filippov | c5a771d | 2013-06-09 04:52:11 +0400 | [diff] [blame] | 93 | add a2, a2, a3 |
| 94 | wsr a2, excsave1 |
| 95 | 1: |
| 96 | #endif |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 97 | #endif |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 98 | |
Max Filippov | 0376027 | 2018-12-05 12:48:19 -0800 | [diff] [blame] | 99 | movi a0, _startup |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 100 | jx a0 |
| 101 | |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 102 | ENDPROC(_start) |
Max Filippov | 0376027 | 2018-12-05 12:48:19 -0800 | [diff] [blame] | 103 | .end no-absolute-literals |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 104 | |
Max Filippov | 49b424f | 2013-10-17 02:42:28 +0400 | [diff] [blame] | 105 | __REF |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 106 | .literal_position |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 107 | |
| 108 | ENTRY(_startup) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 109 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 110 | /* Set a0 to 0 for the remaining initialization. */ |
| 111 | |
| 112 | movi a0, 0 |
| 113 | |
Max Filippov | 5349012 | 2014-10-04 05:12:27 +0400 | [diff] [blame] | 114 | #if XCHAL_HAVE_VECBASE |
Max Filippov | a9f2fc6 | 2016-04-13 05:20:02 +0300 | [diff] [blame] | 115 | movi a2, VECBASE_VADDR |
Max Filippov | 5349012 | 2014-10-04 05:12:27 +0400 | [diff] [blame] | 116 | wsr a2, vecbase |
| 117 | #endif |
| 118 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 119 | /* Clear debugging registers. */ |
| 120 | |
| 121 | #if XCHAL_HAVE_DEBUG |
Max Filippov | d83ff0b | 2013-03-04 03:40:42 +0400 | [diff] [blame] | 122 | #if XCHAL_NUM_IBREAK > 0 |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 123 | wsr a0, ibreakenable |
Max Filippov | d83ff0b | 2013-03-04 03:40:42 +0400 | [diff] [blame] | 124 | #endif |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 125 | wsr a0, icount |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 126 | movi a1, 15 |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 127 | wsr a0, icountlevel |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 128 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 129 | .set _index, 0 |
Max Filippov | 7de7ac7 | 2016-03-03 18:34:29 +0300 | [diff] [blame] | 130 | .rept XCHAL_NUM_DBREAK |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 131 | wsr a0, SREG_DBREAKC + _index |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 132 | .set _index, _index + 1 |
| 133 | .endr |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 134 | #endif |
| 135 | |
| 136 | /* Clear CCOUNT (not really necessary, but nice) */ |
| 137 | |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 138 | wsr a0, ccount # not really necessary, but nice |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 139 | |
| 140 | /* Disable zero-loops. */ |
| 141 | |
| 142 | #if XCHAL_HAVE_LOOPS |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 143 | wsr a0, lcount |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 144 | #endif |
| 145 | |
| 146 | /* Disable all timers. */ |
| 147 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 148 | .set _index, 0 |
Max Filippov | 79fcf52 | 2012-12-11 01:26:22 +0400 | [diff] [blame] | 149 | .rept XCHAL_NUM_TIMERS |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 150 | wsr a0, SREG_CCOMPARE + _index |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 151 | .set _index, _index + 1 |
| 152 | .endr |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 153 | |
| 154 | /* Interrupt initialization. */ |
| 155 | |
| 156 | movi a2, XCHAL_INTTYPE_MASK_SOFTWARE | XCHAL_INTTYPE_MASK_EXTERN_EDGE |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 157 | wsr a0, intenable |
| 158 | wsr a2, intclear |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 159 | |
| 160 | /* Disable coprocessors. */ |
| 161 | |
Max Filippov | eab5e7a | 2012-12-11 01:26:23 +0400 | [diff] [blame] | 162 | #if XCHAL_HAVE_CP |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 163 | wsr a0, cpenable |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 164 | #endif |
| 165 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 166 | /* Initialize the caches. |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 167 | * a2, a3 are just working registers (clobbered). |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 168 | */ |
| 169 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 170 | #if XCHAL_DCACHE_LINE_LOCKABLE |
| 171 | ___unlock_dcache_all a2 a3 |
| 172 | #endif |
| 173 | |
| 174 | #if XCHAL_ICACHE_LINE_LOCKABLE |
| 175 | ___unlock_icache_all a2 a3 |
| 176 | #endif |
| 177 | |
| 178 | ___invalidate_dcache_all a2 a3 |
| 179 | ___invalidate_icache_all a2 a3 |
| 180 | |
| 181 | isync |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 182 | |
Max Filippov | 7bb516ca | 2018-08-12 06:01:40 -0700 | [diff] [blame] | 183 | initialize_cacheattr |
| 184 | |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 185 | #ifdef CONFIG_HAVE_SMP |
| 186 | movi a2, CCON # MX External Register to Configure Cache |
| 187 | movi a3, 1 |
| 188 | wer a3, a2 |
| 189 | #endif |
| 190 | |
| 191 | /* Setup stack and enable window exceptions (keep irqs disabled) */ |
| 192 | |
| 193 | movi a1, start_info |
| 194 | l32i a1, a1, 0 |
| 195 | |
Max Filippov | 9e1e41c | 2019-08-30 11:16:06 -0700 | [diff] [blame] | 196 | movi a2, PS_WOE_MASK | LOCKLEVEL |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 197 | # WOE=1, INTLEVEL=LOCKLEVEL, UM=0 |
| 198 | wsr a2, ps # (enable reg-windows; progmode stack) |
| 199 | rsync |
| 200 | |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 201 | #ifdef CONFIG_SMP |
| 202 | /* |
| 203 | * Notice that we assume with SMP that cores have PRID |
| 204 | * supported by the cores. |
| 205 | */ |
| 206 | rsr a2, prid |
| 207 | bnez a2, .Lboot_secondary |
| 208 | |
| 209 | #endif /* CONFIG_SMP */ |
| 210 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 211 | /* Unpack data sections |
| 212 | * |
| 213 | * The linker script used to build the Linux kernel image |
| 214 | * creates a table located at __boot_reloc_table_start |
Bhaskar Chowdhury | e153277 | 2021-03-25 09:38:32 +0530 | [diff] [blame] | 215 | * that contains the information what data needs to be unpacked. |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 216 | * |
| 217 | * Uses a2-a7. |
| 218 | */ |
| 219 | |
| 220 | movi a2, __boot_reloc_table_start |
| 221 | movi a3, __boot_reloc_table_end |
| 222 | |
| 223 | 1: beq a2, a3, 3f # no more entries? |
| 224 | l32i a4, a2, 0 # start destination (in RAM) |
Bhaskar Chowdhury | e153277 | 2021-03-25 09:38:32 +0530 | [diff] [blame] | 225 | l32i a5, a2, 4 # end destination (in RAM) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 226 | l32i a6, a2, 8 # start source (in ROM) |
| 227 | addi a2, a2, 12 # next entry |
| 228 | beq a4, a5, 1b # skip, empty entry |
| 229 | beq a4, a6, 1b # skip, source and dest. are the same |
| 230 | |
| 231 | 2: l32i a7, a6, 0 # load word |
| 232 | addi a6, a6, 4 |
| 233 | s32i a7, a4, 0 # store word |
| 234 | addi a4, a4, 4 |
| 235 | bltu a4, a5, 2b |
| 236 | j 1b |
| 237 | |
| 238 | 3: |
| 239 | /* All code and initialized data segments have been copied. |
| 240 | * Now clear the BSS segment. |
| 241 | */ |
| 242 | |
Chris Zankel | 8b307f9 | 2010-05-01 23:05:29 -0700 | [diff] [blame] | 243 | movi a2, __bss_start # start of BSS |
| 244 | movi a3, __bss_stop # end of BSS |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 245 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 246 | __loopt a2, a3, a4, 2 |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 247 | s32i a0, a2, 0 |
Max Filippov | 5029615 | 2015-09-24 23:11:53 +0300 | [diff] [blame] | 248 | __endla a2, a3, 4 |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 249 | |
| 250 | #if XCHAL_DCACHE_IS_WRITEBACK |
| 251 | |
| 252 | /* After unpacking, flush the writeback cache to memory so the |
| 253 | * instructions/data are available. |
| 254 | */ |
| 255 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 256 | ___flush_dcache_all a2 a3 |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 257 | #endif |
Max Filippov | e85e335 | 2012-12-03 15:01:43 +0400 | [diff] [blame] | 258 | memw |
| 259 | isync |
| 260 | ___invalidate_icache_all a2 a3 |
| 261 | isync |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 262 | |
Max Filippov | 7af710d | 2017-01-03 17:57:51 -0800 | [diff] [blame] | 263 | #ifdef CONFIG_XIP_KERNEL |
| 264 | /* Setup bootstrap CPU stack in XIP kernel */ |
| 265 | |
| 266 | movi a1, start_info |
| 267 | l32i a1, a1, 0 |
| 268 | #endif |
| 269 | |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 270 | movi a6, 0 |
Max Filippov | bc5378f | 2012-10-15 03:55:38 +0400 | [diff] [blame] | 271 | xsr a6, excsave1 |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 272 | |
| 273 | /* init_arch kick-starts the linux kernel */ |
| 274 | |
Max Filippov | 2da03d4 | 2017-12-09 18:44:11 -0800 | [diff] [blame] | 275 | call4 init_arch |
| 276 | call4 start_kernel |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 277 | |
| 278 | should_never_return: |
| 279 | j should_never_return |
| 280 | |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 281 | #ifdef CONFIG_SMP |
| 282 | .Lboot_secondary: |
| 283 | |
| 284 | movi a2, cpu_start_ccount |
| 285 | 1: |
Max Filippov | 32a7726c | 2018-12-21 08:26:20 -0800 | [diff] [blame] | 286 | memw |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 287 | l32i a3, a2, 0 |
| 288 | beqi a3, 0, 1b |
| 289 | movi a3, 0 |
| 290 | s32i a3, a2, 0 |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 291 | 1: |
Max Filippov | 32a7726c | 2018-12-21 08:26:20 -0800 | [diff] [blame] | 292 | memw |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 293 | l32i a3, a2, 0 |
| 294 | beqi a3, 0, 1b |
| 295 | wsr a3, ccount |
| 296 | movi a3, 0 |
| 297 | s32i a3, a2, 0 |
| 298 | memw |
| 299 | |
| 300 | movi a6, 0 |
| 301 | wsr a6, excsave1 |
| 302 | |
Max Filippov | 2da03d4 | 2017-12-09 18:44:11 -0800 | [diff] [blame] | 303 | call4 secondary_start_kernel |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 304 | j should_never_return |
| 305 | |
| 306 | #endif /* CONFIG_SMP */ |
| 307 | |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 308 | ENDPROC(_startup) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 309 | |
Max Filippov | 49b424f | 2013-10-17 02:42:28 +0400 | [diff] [blame] | 310 | #ifdef CONFIG_HOTPLUG_CPU |
| 311 | |
| 312 | ENTRY(cpu_restart) |
| 313 | |
| 314 | #if XCHAL_DCACHE_IS_WRITEBACK |
| 315 | ___flush_invalidate_dcache_all a2 a3 |
| 316 | #else |
| 317 | ___invalidate_dcache_all a2 a3 |
| 318 | #endif |
| 319 | memw |
| 320 | movi a2, CCON # MX External Register to Configure Cache |
| 321 | movi a3, 0 |
| 322 | wer a3, a2 |
| 323 | extw |
| 324 | |
| 325 | rsr a0, prid |
| 326 | neg a2, a0 |
| 327 | movi a3, cpu_start_id |
Max Filippov | 32a7726c | 2018-12-21 08:26:20 -0800 | [diff] [blame] | 328 | memw |
Max Filippov | 49b424f | 2013-10-17 02:42:28 +0400 | [diff] [blame] | 329 | s32i a2, a3, 0 |
| 330 | #if XCHAL_DCACHE_IS_WRITEBACK |
| 331 | dhwbi a3, 0 |
| 332 | #endif |
| 333 | 1: |
Max Filippov | 32a7726c | 2018-12-21 08:26:20 -0800 | [diff] [blame] | 334 | memw |
Max Filippov | 49b424f | 2013-10-17 02:42:28 +0400 | [diff] [blame] | 335 | l32i a2, a3, 0 |
| 336 | dhi a3, 0 |
| 337 | bne a2, a0, 1b |
| 338 | |
| 339 | /* |
| 340 | * Initialize WB, WS, and clear PS.EXCM (to allow loop instructions). |
| 341 | * Set Interrupt Level just below XCHAL_DEBUGLEVEL to allow |
| 342 | * xt-gdb to single step via DEBUG exceptions received directly |
| 343 | * by ocd. |
| 344 | */ |
| 345 | movi a1, 1 |
| 346 | movi a0, 0 |
| 347 | wsr a1, windowstart |
| 348 | wsr a0, windowbase |
| 349 | rsync |
| 350 | |
| 351 | movi a1, LOCKLEVEL |
| 352 | wsr a1, ps |
| 353 | rsync |
| 354 | |
| 355 | j _startup |
| 356 | |
| 357 | ENDPROC(cpu_restart) |
| 358 | |
| 359 | #endif /* CONFIG_HOTPLUG_CPU */ |
| 360 | |
Chris Zankel | adba09f | 2007-05-31 17:48:07 -0700 | [diff] [blame] | 361 | /* |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 362 | * DATA section |
| 363 | */ |
| 364 | |
Max Filippov | 9fab17c | 2019-09-27 17:21:25 -0700 | [diff] [blame] | 365 | __REFDATA |
| 366 | .align 4 |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 367 | ENTRY(start_info) |
Max Filippov | 9fab17c | 2019-09-27 17:21:25 -0700 | [diff] [blame] | 368 | .long init_thread_union + KERNEL_STACK_SIZE |
Max Filippov | f615136 | 2013-10-17 02:42:26 +0400 | [diff] [blame] | 369 | |
| 370 | /* |
Chris Zankel | adba09f | 2007-05-31 17:48:07 -0700 | [diff] [blame] | 371 | * BSS section |
| 372 | */ |
| 373 | |
Tim Abbott | 02b7da3 | 2009-09-20 18:14:14 -0400 | [diff] [blame] | 374 | __PAGE_ALIGNED_BSS |
Johannes Weiner | e5083a6 | 2009-03-04 16:21:31 +0100 | [diff] [blame] | 375 | #ifdef CONFIG_MMU |
Chris Zankel | adba09f | 2007-05-31 17:48:07 -0700 | [diff] [blame] | 376 | ENTRY(swapper_pg_dir) |
| 377 | .fill PAGE_SIZE, 1, 0 |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 378 | END(swapper_pg_dir) |
Johannes Weiner | e5083a6 | 2009-03-04 16:21:31 +0100 | [diff] [blame] | 379 | #endif |
Chris Zankel | adba09f | 2007-05-31 17:48:07 -0700 | [diff] [blame] | 380 | ENTRY(empty_zero_page) |
| 381 | .fill PAGE_SIZE, 1, 0 |
Chris Zankel | d1538c4 | 2012-11-16 16:16:20 -0800 | [diff] [blame] | 382 | END(empty_zero_page) |