head_44x.S 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. /*
  2. * Kernel execution entry point code.
  3. *
  4. * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
  5. * Initial PowerPC version.
  6. * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
  7. * Rewritten for PReP
  8. * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
  9. * Low-level exception handers, MMU support, and rewrite.
  10. * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
  11. * PowerPC 8xx modifications.
  12. * Copyright (c) 1998-1999 TiVo, Inc.
  13. * PowerPC 403GCX modifications.
  14. * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
  15. * PowerPC 403GCX/405GP modifications.
  16. * Copyright 2000 MontaVista Software Inc.
  17. * PPC405 modifications
  18. * PowerPC 403GCX/405GP modifications.
  19. * Author: MontaVista Software, Inc.
  20. * frank_rowand@mvista.com or source@mvista.com
  21. * debbie_chu@mvista.com
  22. * Copyright 2002-2005 MontaVista Software, Inc.
  23. * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
  24. *
  25. * This program is free software; you can redistribute it and/or modify it
  26. * under the terms of the GNU General Public License as published by the
  27. * Free Software Foundation; either version 2 of the License, or (at your
  28. * option) any later version.
  29. */
  30. #include <linux/init.h>
  31. #include <asm/processor.h>
  32. #include <asm/page.h>
  33. #include <asm/mmu.h>
  34. #include <asm/pgtable.h>
  35. #include <asm/cputable.h>
  36. #include <asm/thread_info.h>
  37. #include <asm/ppc_asm.h>
  38. #include <asm/asm-offsets.h>
  39. #include <asm/ptrace.h>
  40. #include <asm/synch.h>
  41. #include "head_booke.h"
  42. /* As with the other PowerPC ports, it is expected that when code
  43. * execution begins here, the following registers contain valid, yet
  44. * optional, information:
  45. *
  46. * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
  47. * r4 - Starting address of the init RAM disk
  48. * r5 - Ending address of the init RAM disk
  49. * r6 - Start of kernel command line string (e.g. "mem=128")
  50. * r7 - End of kernel command line string
  51. *
  52. */
  53. __HEAD
  54. _ENTRY(_stext);
  55. _ENTRY(_start);
  56. /*
  57. * Reserve a word at a fixed location to store the address
  58. * of abatron_pteptrs
  59. */
  60. nop
  61. mr r31,r3 /* save device tree ptr */
  62. li r24,0 /* CPU number */
  63. bl init_cpu_state
  64. /*
  65. * This is where the main kernel code starts.
  66. */
  67. /* ptr to current */
  68. lis r2,init_task@h
  69. ori r2,r2,init_task@l
  70. /* ptr to current thread */
  71. addi r4,r2,THREAD /* init task's THREAD */
  72. mtspr SPRN_SPRG_THREAD,r4
  73. /* stack */
  74. lis r1,init_thread_union@h
  75. ori r1,r1,init_thread_union@l
  76. li r0,0
  77. stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
  78. bl early_init
  79. #ifdef CONFIG_RELOCATABLE
  80. /*
  81. * r25 will contain RPN/ERPN for the start address of memory
  82. *
  83. * Add the difference between KERNELBASE and PAGE_OFFSET to the
  84. * start of physical memory to get kernstart_addr.
  85. */
  86. lis r3,kernstart_addr@ha
  87. la r3,kernstart_addr@l(r3)
  88. lis r4,KERNELBASE@h
  89. ori r4,r4,KERNELBASE@l
  90. lis r5,PAGE_OFFSET@h
  91. ori r5,r5,PAGE_OFFSET@l
  92. subf r4,r5,r4
  93. rlwinm r6,r25,0,28,31 /* ERPN */
  94. rlwinm r7,r25,0,0,3 /* RPN - assuming 256 MB page size */
  95. add r7,r7,r4
  96. stw r6,0(r3)
  97. stw r7,4(r3)
  98. #endif
  99. /*
  100. * Decide what sort of machine this is and initialize the MMU.
  101. */
  102. li r3,0
  103. mr r4,r31
  104. bl machine_init
  105. bl MMU_init
  106. /* Setup PTE pointers for the Abatron bdiGDB */
  107. lis r6, swapper_pg_dir@h
  108. ori r6, r6, swapper_pg_dir@l
  109. lis r5, abatron_pteptrs@h
  110. ori r5, r5, abatron_pteptrs@l
  111. lis r4, KERNELBASE@h
  112. ori r4, r4, KERNELBASE@l
  113. stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
  114. stw r6, 0(r5)
  115. /* Clear the Machine Check Syndrome Register */
  116. li r0,0
  117. mtspr SPRN_MCSR,r0
  118. /* Let's move on */
  119. lis r4,start_kernel@h
  120. ori r4,r4,start_kernel@l
  121. lis r3,MSR_KERNEL@h
  122. ori r3,r3,MSR_KERNEL@l
  123. mtspr SPRN_SRR0,r4
  124. mtspr SPRN_SRR1,r3
  125. rfi /* change context and jump to start_kernel */
  126. /*
  127. * Interrupt vector entry code
  128. *
  129. * The Book E MMUs are always on so we don't need to handle
  130. * interrupts in real mode as with previous PPC processors. In
  131. * this case we handle interrupts in the kernel virtual address
  132. * space.
  133. *
  134. * Interrupt vectors are dynamically placed relative to the
  135. * interrupt prefix as determined by the address of interrupt_base.
  136. * The interrupt vectors offsets are programmed using the labels
  137. * for each interrupt vector entry.
  138. *
  139. * Interrupt vectors must be aligned on a 16 byte boundary.
  140. * We align on a 32 byte cache line boundary for good measure.
  141. */
  142. interrupt_base:
  143. /* Critical Input Interrupt */
  144. CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
  145. /* Machine Check Interrupt */
  146. CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
  147. MCHECK_EXCEPTION(0x0210, MachineCheckA, machine_check_exception)
  148. /* Data Storage Interrupt */
  149. DATA_STORAGE_EXCEPTION
  150. /* Instruction Storage Interrupt */
  151. INSTRUCTION_STORAGE_EXCEPTION
  152. /* External Input Interrupt */
  153. EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
  154. /* Alignment Interrupt */
  155. ALIGNMENT_EXCEPTION
  156. /* Program Interrupt */
  157. PROGRAM_EXCEPTION
  158. /* Floating Point Unavailable Interrupt */
  159. #ifdef CONFIG_PPC_FPU
  160. FP_UNAVAILABLE_EXCEPTION
  161. #else
  162. EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
  163. #endif
  164. /* System Call Interrupt */
  165. START_EXCEPTION(SystemCall)
  166. NORMAL_EXCEPTION_PROLOG
  167. EXC_XFER_EE_LITE(0x0c00, DoSyscall)
  168. /* Auxiliary Processor Unavailable Interrupt */
  169. EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
  170. /* Decrementer Interrupt */
  171. DECREMENTER_EXCEPTION
  172. /* Fixed Internal Timer Interrupt */
  173. /* TODO: Add FIT support */
  174. EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
  175. /* Watchdog Timer Interrupt */
  176. /* TODO: Add watchdog support */
  177. #ifdef CONFIG_BOOKE_WDT
  178. CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
  179. #else
  180. CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
  181. #endif
  182. /* Data TLB Error Interrupt */
  183. START_EXCEPTION(DataTLBError44x)
  184. mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
  185. mtspr SPRN_SPRG_WSCRATCH1, r11
  186. mtspr SPRN_SPRG_WSCRATCH2, r12
  187. mtspr SPRN_SPRG_WSCRATCH3, r13
  188. mfcr r11
  189. mtspr SPRN_SPRG_WSCRATCH4, r11
  190. mfspr r10, SPRN_DEAR /* Get faulting address */
  191. /* If we are faulting a kernel address, we have to use the
  192. * kernel page tables.
  193. */
  194. lis r11, PAGE_OFFSET@h
  195. cmplw r10, r11
  196. blt+ 3f
  197. lis r11, swapper_pg_dir@h
  198. ori r11, r11, swapper_pg_dir@l
  199. mfspr r12,SPRN_MMUCR
  200. rlwinm r12,r12,0,0,23 /* Clear TID */
  201. b 4f
  202. /* Get the PGD for the current thread */
  203. 3:
  204. mfspr r11,SPRN_SPRG_THREAD
  205. lwz r11,PGDIR(r11)
  206. /* Load PID into MMUCR TID */
  207. mfspr r12,SPRN_MMUCR
  208. mfspr r13,SPRN_PID /* Get PID */
  209. rlwimi r12,r13,0,24,31 /* Set TID */
  210. 4:
  211. mtspr SPRN_MMUCR,r12
  212. /* Mask of required permission bits. Note that while we
  213. * do copy ESR:ST to _PAGE_RW position as trying to write
  214. * to an RO page is pretty common, we don't do it with
  215. * _PAGE_DIRTY. We could do it, but it's a fairly rare
  216. * event so I'd rather take the overhead when it happens
  217. * rather than adding an instruction here. We should measure
  218. * whether the whole thing is worth it in the first place
  219. * as we could avoid loading SPRN_ESR completely in the first
  220. * place...
  221. *
  222. * TODO: Is it worth doing that mfspr & rlwimi in the first
  223. * place or can we save a couple of instructions here ?
  224. */
  225. mfspr r12,SPRN_ESR
  226. li r13,_PAGE_PRESENT|_PAGE_ACCESSED
  227. rlwimi r13,r12,10,30,30
  228. /* Load the PTE */
  229. /* Compute pgdir/pmd offset */
  230. rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29
  231. lwzx r11, r12, r11 /* Get pgd/pmd entry */
  232. rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
  233. beq 2f /* Bail if no table */
  234. /* Compute pte address */
  235. rlwimi r12, r10, PPC44x_PTE_ADD_SHIFT, PPC44x_PTE_ADD_MASK_BIT, 28
  236. lwz r11, 0(r12) /* Get high word of pte entry */
  237. lwz r12, 4(r12) /* Get low word of pte entry */
  238. lis r10,tlb_44x_index@ha
  239. andc. r13,r13,r12 /* Check permission */
  240. /* Load the next available TLB index */
  241. lwz r13,tlb_44x_index@l(r10)
  242. bne 2f /* Bail if permission mismach */
  243. /* Increment, rollover, and store TLB index */
  244. addi r13,r13,1
  245. /* Compare with watermark (instruction gets patched) */
  246. .globl tlb_44x_patch_hwater_D
  247. tlb_44x_patch_hwater_D:
  248. cmpwi 0,r13,1 /* reserve entries */
  249. ble 5f
  250. li r13,0
  251. 5:
  252. /* Store the next available TLB index */
  253. stw r13,tlb_44x_index@l(r10)
  254. /* Re-load the faulting address */
  255. mfspr r10,SPRN_DEAR
  256. /* Jump to common tlb load */
  257. b finish_tlb_load_44x
  258. 2:
  259. /* The bailout. Restore registers to pre-exception conditions
  260. * and call the heavyweights to help us out.
  261. */
  262. mfspr r11, SPRN_SPRG_RSCRATCH4
  263. mtcr r11
  264. mfspr r13, SPRN_SPRG_RSCRATCH3
  265. mfspr r12, SPRN_SPRG_RSCRATCH2
  266. mfspr r11, SPRN_SPRG_RSCRATCH1
  267. mfspr r10, SPRN_SPRG_RSCRATCH0
  268. b DataStorage
  269. /* Instruction TLB Error Interrupt */
  270. /*
  271. * Nearly the same as above, except we get our
  272. * information from different registers and bailout
  273. * to a different point.
  274. */
  275. START_EXCEPTION(InstructionTLBError44x)
  276. mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
  277. mtspr SPRN_SPRG_WSCRATCH1, r11
  278. mtspr SPRN_SPRG_WSCRATCH2, r12
  279. mtspr SPRN_SPRG_WSCRATCH3, r13
  280. mfcr r11
  281. mtspr SPRN_SPRG_WSCRATCH4, r11
  282. mfspr r10, SPRN_SRR0 /* Get faulting address */
  283. /* If we are faulting a kernel address, we have to use the
  284. * kernel page tables.
  285. */
  286. lis r11, PAGE_OFFSET@h
  287. cmplw r10, r11
  288. blt+ 3f
  289. lis r11, swapper_pg_dir@h
  290. ori r11, r11, swapper_pg_dir@l
  291. mfspr r12,SPRN_MMUCR
  292. rlwinm r12,r12,0,0,23 /* Clear TID */
  293. b 4f
  294. /* Get the PGD for the current thread */
  295. 3:
  296. mfspr r11,SPRN_SPRG_THREAD
  297. lwz r11,PGDIR(r11)
  298. /* Load PID into MMUCR TID */
  299. mfspr r12,SPRN_MMUCR
  300. mfspr r13,SPRN_PID /* Get PID */
  301. rlwimi r12,r13,0,24,31 /* Set TID */
  302. 4:
  303. mtspr SPRN_MMUCR,r12
  304. /* Make up the required permissions */
  305. li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
  306. /* Compute pgdir/pmd offset */
  307. rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29
  308. lwzx r11, r12, r11 /* Get pgd/pmd entry */
  309. rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
  310. beq 2f /* Bail if no table */
  311. /* Compute pte address */
  312. rlwimi r12, r10, PPC44x_PTE_ADD_SHIFT, PPC44x_PTE_ADD_MASK_BIT, 28
  313. lwz r11, 0(r12) /* Get high word of pte entry */
  314. lwz r12, 4(r12) /* Get low word of pte entry */
  315. lis r10,tlb_44x_index@ha
  316. andc. r13,r13,r12 /* Check permission */
  317. /* Load the next available TLB index */
  318. lwz r13,tlb_44x_index@l(r10)
  319. bne 2f /* Bail if permission mismach */
  320. /* Increment, rollover, and store TLB index */
  321. addi r13,r13,1
  322. /* Compare with watermark (instruction gets patched) */
  323. .globl tlb_44x_patch_hwater_I
  324. tlb_44x_patch_hwater_I:
  325. cmpwi 0,r13,1 /* reserve entries */
  326. ble 5f
  327. li r13,0
  328. 5:
  329. /* Store the next available TLB index */
  330. stw r13,tlb_44x_index@l(r10)
  331. /* Re-load the faulting address */
  332. mfspr r10,SPRN_SRR0
  333. /* Jump to common TLB load point */
  334. b finish_tlb_load_44x
  335. 2:
  336. /* The bailout. Restore registers to pre-exception conditions
  337. * and call the heavyweights to help us out.
  338. */
  339. mfspr r11, SPRN_SPRG_RSCRATCH4
  340. mtcr r11
  341. mfspr r13, SPRN_SPRG_RSCRATCH3
  342. mfspr r12, SPRN_SPRG_RSCRATCH2
  343. mfspr r11, SPRN_SPRG_RSCRATCH1
  344. mfspr r10, SPRN_SPRG_RSCRATCH0
  345. b InstructionStorage
  346. /*
  347. * Both the instruction and data TLB miss get to this
  348. * point to load the TLB.
  349. * r10 - EA of fault
  350. * r11 - PTE high word value
  351. * r12 - PTE low word value
  352. * r13 - TLB index
  353. * MMUCR - loaded with proper value when we get here
  354. * Upon exit, we reload everything and RFI.
  355. */
  356. finish_tlb_load_44x:
  357. /* Combine RPN & ERPN an write WS 0 */
  358. rlwimi r11,r12,0,0,31-PAGE_SHIFT
  359. tlbwe r11,r13,PPC44x_TLB_XLAT
  360. /*
  361. * Create WS1. This is the faulting address (EPN),
  362. * page size, and valid flag.
  363. */
  364. li r11,PPC44x_TLB_VALID | PPC44x_TLBE_SIZE
  365. /* Insert valid and page size */
  366. rlwimi r10,r11,0,PPC44x_PTE_ADD_MASK_BIT,31
  367. tlbwe r10,r13,PPC44x_TLB_PAGEID /* Write PAGEID */
  368. /* And WS 2 */
  369. li r10,0xf85 /* Mask to apply from PTE */
  370. rlwimi r10,r12,29,30,30 /* DIRTY -> SW position */
  371. and r11,r12,r10 /* Mask PTE bits to keep */
  372. andi. r10,r12,_PAGE_USER /* User page ? */
  373. beq 1f /* nope, leave U bits empty */
  374. rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
  375. 1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */
  376. /* Done...restore registers and get out of here.
  377. */
  378. mfspr r11, SPRN_SPRG_RSCRATCH4
  379. mtcr r11
  380. mfspr r13, SPRN_SPRG_RSCRATCH3
  381. mfspr r12, SPRN_SPRG_RSCRATCH2
  382. mfspr r11, SPRN_SPRG_RSCRATCH1
  383. mfspr r10, SPRN_SPRG_RSCRATCH0
  384. rfi /* Force context change */
  385. /* TLB error interrupts for 476
  386. */
  387. #ifdef CONFIG_PPC_47x
  388. START_EXCEPTION(DataTLBError47x)
  389. mtspr SPRN_SPRG_WSCRATCH0,r10 /* Save some working registers */
  390. mtspr SPRN_SPRG_WSCRATCH1,r11
  391. mtspr SPRN_SPRG_WSCRATCH2,r12
  392. mtspr SPRN_SPRG_WSCRATCH3,r13
  393. mfcr r11
  394. mtspr SPRN_SPRG_WSCRATCH4,r11
  395. mfspr r10,SPRN_DEAR /* Get faulting address */
  396. /* If we are faulting a kernel address, we have to use the
  397. * kernel page tables.
  398. */
  399. lis r11,PAGE_OFFSET@h
  400. cmplw cr0,r10,r11
  401. blt+ 3f
  402. lis r11,swapper_pg_dir@h
  403. ori r11,r11, swapper_pg_dir@l
  404. li r12,0 /* MMUCR = 0 */
  405. b 4f
  406. /* Get the PGD for the current thread and setup MMUCR */
  407. 3: mfspr r11,SPRN_SPRG3
  408. lwz r11,PGDIR(r11)
  409. mfspr r12,SPRN_PID /* Get PID */
  410. 4: mtspr SPRN_MMUCR,r12 /* Set MMUCR */
  411. /* Mask of required permission bits. Note that while we
  412. * do copy ESR:ST to _PAGE_RW position as trying to write
  413. * to an RO page is pretty common, we don't do it with
  414. * _PAGE_DIRTY. We could do it, but it's a fairly rare
  415. * event so I'd rather take the overhead when it happens
  416. * rather than adding an instruction here. We should measure
  417. * whether the whole thing is worth it in the first place
  418. * as we could avoid loading SPRN_ESR completely in the first
  419. * place...
  420. *
  421. * TODO: Is it worth doing that mfspr & rlwimi in the first
  422. * place or can we save a couple of instructions here ?
  423. */
  424. mfspr r12,SPRN_ESR
  425. li r13,_PAGE_PRESENT|_PAGE_ACCESSED
  426. rlwimi r13,r12,10,30,30
  427. /* Load the PTE */
  428. /* Compute pgdir/pmd offset */
  429. rlwinm r12,r10,PPC44x_PGD_OFF_SHIFT,PPC44x_PGD_OFF_MASK_BIT,29
  430. lwzx r11,r12,r11 /* Get pgd/pmd entry */
  431. /* Word 0 is EPN,V,TS,DSIZ */
  432. li r12,PPC47x_TLB0_VALID | PPC47x_TLBE_SIZE
  433. rlwimi r10,r12,0,32-PAGE_SHIFT,31 /* Insert valid and page size*/
  434. li r12,0
  435. tlbwe r10,r12,0
  436. /* XXX can we do better ? Need to make sure tlbwe has established
  437. * latch V bit in MMUCR0 before the PTE is loaded further down */
  438. #ifdef CONFIG_SMP
  439. isync
  440. #endif
  441. rlwinm. r12,r11,0,0,20 /* Extract pt base address */
  442. /* Compute pte address */
  443. rlwimi r12,r10,PPC44x_PTE_ADD_SHIFT,PPC44x_PTE_ADD_MASK_BIT,28
  444. beq 2f /* Bail if no table */
  445. lwz r11,0(r12) /* Get high word of pte entry */
  446. /* XXX can we do better ? maybe insert a known 0 bit from r11 into the
  447. * bottom of r12 to create a data dependency... We can also use r10
  448. * as destination nowadays
  449. */
  450. #ifdef CONFIG_SMP
  451. lwsync
  452. #endif
  453. lwz r12,4(r12) /* Get low word of pte entry */
  454. andc. r13,r13,r12 /* Check permission */
  455. /* Jump to common tlb load */
  456. beq finish_tlb_load_47x
  457. 2: /* The bailout. Restore registers to pre-exception conditions
  458. * and call the heavyweights to help us out.
  459. */
  460. mfspr r11,SPRN_SPRG_RSCRATCH4
  461. mtcr r11
  462. mfspr r13,SPRN_SPRG_RSCRATCH3
  463. mfspr r12,SPRN_SPRG_RSCRATCH2
  464. mfspr r11,SPRN_SPRG_RSCRATCH1
  465. mfspr r10,SPRN_SPRG_RSCRATCH0
  466. b DataStorage
  467. /* Instruction TLB Error Interrupt */
  468. /*
  469. * Nearly the same as above, except we get our
  470. * information from different registers and bailout
  471. * to a different point.
  472. */
  473. START_EXCEPTION(InstructionTLBError47x)
  474. mtspr SPRN_SPRG_WSCRATCH0,r10 /* Save some working registers */
  475. mtspr SPRN_SPRG_WSCRATCH1,r11
  476. mtspr SPRN_SPRG_WSCRATCH2,r12
  477. mtspr SPRN_SPRG_WSCRATCH3,r13
  478. mfcr r11
  479. mtspr SPRN_SPRG_WSCRATCH4,r11
  480. mfspr r10,SPRN_SRR0 /* Get faulting address */
  481. /* If we are faulting a kernel address, we have to use the
  482. * kernel page tables.
  483. */
  484. lis r11,PAGE_OFFSET@h
  485. cmplw cr0,r10,r11
  486. blt+ 3f
  487. lis r11,swapper_pg_dir@h
  488. ori r11,r11, swapper_pg_dir@l
  489. li r12,0 /* MMUCR = 0 */
  490. b 4f
  491. /* Get the PGD for the current thread and setup MMUCR */
  492. 3: mfspr r11,SPRN_SPRG_THREAD
  493. lwz r11,PGDIR(r11)
  494. mfspr r12,SPRN_PID /* Get PID */
  495. 4: mtspr SPRN_MMUCR,r12 /* Set MMUCR */
  496. /* Make up the required permissions */
  497. li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
  498. /* Load PTE */
  499. /* Compute pgdir/pmd offset */
  500. rlwinm r12,r10,PPC44x_PGD_OFF_SHIFT,PPC44x_PGD_OFF_MASK_BIT,29
  501. lwzx r11,r12,r11 /* Get pgd/pmd entry */
  502. /* Word 0 is EPN,V,TS,DSIZ */
  503. li r12,PPC47x_TLB0_VALID | PPC47x_TLBE_SIZE
  504. rlwimi r10,r12,0,32-PAGE_SHIFT,31 /* Insert valid and page size*/
  505. li r12,0
  506. tlbwe r10,r12,0
  507. /* XXX can we do better ? Need to make sure tlbwe has established
  508. * latch V bit in MMUCR0 before the PTE is loaded further down */
  509. #ifdef CONFIG_SMP
  510. isync
  511. #endif
  512. rlwinm. r12,r11,0,0,20 /* Extract pt base address */
  513. /* Compute pte address */
  514. rlwimi r12,r10,PPC44x_PTE_ADD_SHIFT,PPC44x_PTE_ADD_MASK_BIT,28
  515. beq 2f /* Bail if no table */
  516. lwz r11,0(r12) /* Get high word of pte entry */
  517. /* XXX can we do better ? maybe insert a known 0 bit from r11 into the
  518. * bottom of r12 to create a data dependency... We can also use r10
  519. * as destination nowadays
  520. */
  521. #ifdef CONFIG_SMP
  522. lwsync
  523. #endif
  524. lwz r12,4(r12) /* Get low word of pte entry */
  525. andc. r13,r13,r12 /* Check permission */
  526. /* Jump to common TLB load point */
  527. beq finish_tlb_load_47x
  528. 2: /* The bailout. Restore registers to pre-exception conditions
  529. * and call the heavyweights to help us out.
  530. */
  531. mfspr r11, SPRN_SPRG_RSCRATCH4
  532. mtcr r11
  533. mfspr r13, SPRN_SPRG_RSCRATCH3
  534. mfspr r12, SPRN_SPRG_RSCRATCH2
  535. mfspr r11, SPRN_SPRG_RSCRATCH1
  536. mfspr r10, SPRN_SPRG_RSCRATCH0
  537. b InstructionStorage
  538. /*
  539. * Both the instruction and data TLB miss get to this
  540. * point to load the TLB.
  541. * r10 - free to use
  542. * r11 - PTE high word value
  543. * r12 - PTE low word value
  544. * r13 - free to use
  545. * MMUCR - loaded with proper value when we get here
  546. * Upon exit, we reload everything and RFI.
  547. */
  548. finish_tlb_load_47x:
  549. /* Combine RPN & ERPN an write WS 1 */
  550. rlwimi r11,r12,0,0,31-PAGE_SHIFT
  551. tlbwe r11,r13,1
  552. /* And make up word 2 */
  553. li r10,0xf85 /* Mask to apply from PTE */
  554. rlwimi r10,r12,29,30,30 /* DIRTY -> SW position */
  555. and r11,r12,r10 /* Mask PTE bits to keep */
  556. andi. r10,r12,_PAGE_USER /* User page ? */
  557. beq 1f /* nope, leave U bits empty */
  558. rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
  559. 1: tlbwe r11,r13,2
  560. /* Done...restore registers and get out of here.
  561. */
  562. mfspr r11, SPRN_SPRG_RSCRATCH4
  563. mtcr r11
  564. mfspr r13, SPRN_SPRG_RSCRATCH3
  565. mfspr r12, SPRN_SPRG_RSCRATCH2
  566. mfspr r11, SPRN_SPRG_RSCRATCH1
  567. mfspr r10, SPRN_SPRG_RSCRATCH0
  568. rfi
  569. #endif /* CONFIG_PPC_47x */
  570. /* Debug Interrupt */
  571. /*
  572. * This statement needs to exist at the end of the IVPR
  573. * definition just in case you end up taking a debug
  574. * exception within another exception.
  575. */
  576. DEBUG_CRIT_EXCEPTION
  577. /*
  578. * Global functions
  579. */
  580. /*
  581. * Adjust the machine check IVOR on 440A cores
  582. */
  583. _GLOBAL(__fixup_440A_mcheck)
  584. li r3,MachineCheckA@l
  585. mtspr SPRN_IVOR1,r3
  586. sync
  587. blr
  588. /*
  589. * extern void giveup_altivec(struct task_struct *prev)
  590. *
  591. * The 44x core does not have an AltiVec unit.
  592. */
  593. _GLOBAL(giveup_altivec)
  594. blr
  595. /*
  596. * extern void giveup_fpu(struct task_struct *prev)
  597. *
  598. * The 44x core does not have an FPU.
  599. */
  600. #ifndef CONFIG_PPC_FPU
  601. _GLOBAL(giveup_fpu)
  602. blr
  603. #endif
  604. _GLOBAL(set_context)
  605. #ifdef CONFIG_BDI_SWITCH
  606. /* Context switch the PTE pointer for the Abatron BDI2000.
  607. * The PGDIR is the second parameter.
  608. */
  609. lis r5, abatron_pteptrs@h
  610. ori r5, r5, abatron_pteptrs@l
  611. stw r4, 0x4(r5)
  612. #endif
  613. mtspr SPRN_PID,r3
  614. isync /* Force context change */
  615. blr
  616. /*
  617. * Init CPU state. This is called at boot time or for secondary CPUs
  618. * to setup initial TLB entries, setup IVORs, etc...
  619. *
  620. */
  621. _GLOBAL(init_cpu_state)
  622. mflr r22
  623. #ifdef CONFIG_PPC_47x
  624. /* We use the PVR to differenciate 44x cores from 476 */
  625. mfspr r3,SPRN_PVR
  626. srwi r3,r3,16
  627. cmplwi cr0,r3,PVR_476@h
  628. beq head_start_47x
  629. cmplwi cr0,r3,PVR_476_ISS@h
  630. beq head_start_47x
  631. #endif /* CONFIG_PPC_47x */
  632. /*
  633. * In case the firmware didn't do it, we apply some workarounds
  634. * that are good for all 440 core variants here
  635. */
  636. mfspr r3,SPRN_CCR0
  637. rlwinm r3,r3,0,0,27 /* disable icache prefetch */
  638. isync
  639. mtspr SPRN_CCR0,r3
  640. isync
  641. sync
  642. /*
  643. * Set up the initial MMU state for 44x
  644. *
  645. * We are still executing code at the virtual address
  646. * mappings set by the firmware for the base of RAM.
  647. *
  648. * We first invalidate all TLB entries but the one
  649. * we are running from. We then load the KERNELBASE
  650. * mappings so we can begin to use kernel addresses
  651. * natively and so the interrupt vector locations are
  652. * permanently pinned (necessary since Book E
  653. * implementations always have translation enabled).
  654. *
  655. * TODO: Use the known TLB entry we are running from to
  656. * determine which physical region we are located
  657. * in. This can be used to determine where in RAM
  658. * (on a shared CPU system) or PCI memory space
  659. * (on a DRAMless system) we are located.
  660. * For now, we assume a perfect world which means
  661. * we are located at the base of DRAM (physical 0).
  662. */
  663. /*
  664. * Search TLB for entry that we are currently using.
  665. * Invalidate all entries but the one we are using.
  666. */
  667. /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
  668. mfspr r3,SPRN_PID /* Get PID */
  669. mfmsr r4 /* Get MSR */
  670. andi. r4,r4,MSR_IS@l /* TS=1? */
  671. beq wmmucr /* If not, leave STS=0 */
  672. oris r3,r3,PPC44x_MMUCR_STS@h /* Set STS=1 */
  673. wmmucr: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
  674. sync
  675. bl invstr /* Find our address */
  676. invstr: mflr r5 /* Make it accessible */
  677. tlbsx r23,0,r5 /* Find entry we are in */
  678. li r4,0 /* Start at TLB entry 0 */
  679. li r3,0 /* Set PAGEID inval value */
  680. 1: cmpw r23,r4 /* Is this our entry? */
  681. beq skpinv /* If so, skip the inval */
  682. tlbwe r3,r4,PPC44x_TLB_PAGEID /* If not, inval the entry */
  683. skpinv: addi r4,r4,1 /* Increment */
  684. cmpwi r4,64 /* Are we done? */
  685. bne 1b /* If not, repeat */
  686. isync /* If so, context change */
  687. /*
  688. * Configure and load pinned entry into TLB slot 63.
  689. */
  690. lis r3,PAGE_OFFSET@h
  691. ori r3,r3,PAGE_OFFSET@l
  692. /* Kernel is at the base of RAM */
  693. li r4, 0 /* Load the kernel physical address */
  694. /* Load the kernel PID = 0 */
  695. li r0,0
  696. mtspr SPRN_PID,r0
  697. sync
  698. /* Initialize MMUCR */
  699. li r5,0
  700. mtspr SPRN_MMUCR,r5
  701. sync
  702. /* pageid fields */
  703. clrrwi r3,r3,10 /* Mask off the effective page number */
  704. ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M
  705. /* xlat fields */
  706. clrrwi r4,r4,10 /* Mask off the real page number */
  707. /* ERPN is 0 for first 4GB page */
  708. /* attrib fields */
  709. /* Added guarded bit to protect against speculative loads/stores */
  710. li r5,0
  711. ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G)
  712. li r0,63 /* TLB slot 63 */
  713. tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
  714. tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
  715. tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
  716. /* Force context change */
  717. mfmsr r0
  718. mtspr SPRN_SRR1, r0
  719. lis r0,3f@h
  720. ori r0,r0,3f@l
  721. mtspr SPRN_SRR0,r0
  722. sync
  723. rfi
  724. /* If necessary, invalidate original entry we used */
  725. 3: cmpwi r23,63
  726. beq 4f
  727. li r6,0
  728. tlbwe r6,r23,PPC44x_TLB_PAGEID
  729. isync
  730. 4:
  731. #ifdef CONFIG_PPC_EARLY_DEBUG_44x
  732. /* Add UART mapping for early debug. */
  733. /* pageid fields */
  734. lis r3,PPC44x_EARLY_DEBUG_VIRTADDR@h
  735. ori r3,r3,PPC44x_TLB_VALID|PPC44x_TLB_TS|PPC44x_TLB_64K
  736. /* xlat fields */
  737. lis r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW@h
  738. ori r4,r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH
  739. /* attrib fields */
  740. li r5,(PPC44x_TLB_SW|PPC44x_TLB_SR|PPC44x_TLB_I|PPC44x_TLB_G)
  741. li r0,62 /* TLB slot 0 */
  742. tlbwe r3,r0,PPC44x_TLB_PAGEID
  743. tlbwe r4,r0,PPC44x_TLB_XLAT
  744. tlbwe r5,r0,PPC44x_TLB_ATTRIB
  745. /* Force context change */
  746. isync
  747. #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
  748. /* Establish the interrupt vector offsets */
  749. SET_IVOR(0, CriticalInput);
  750. SET_IVOR(1, MachineCheck);
  751. SET_IVOR(2, DataStorage);
  752. SET_IVOR(3, InstructionStorage);
  753. SET_IVOR(4, ExternalInput);
  754. SET_IVOR(5, Alignment);
  755. SET_IVOR(6, Program);
  756. SET_IVOR(7, FloatingPointUnavailable);
  757. SET_IVOR(8, SystemCall);
  758. SET_IVOR(9, AuxillaryProcessorUnavailable);
  759. SET_IVOR(10, Decrementer);
  760. SET_IVOR(11, FixedIntervalTimer);
  761. SET_IVOR(12, WatchdogTimer);
  762. SET_IVOR(13, DataTLBError44x);
  763. SET_IVOR(14, InstructionTLBError44x);
  764. SET_IVOR(15, DebugCrit);
  765. b head_start_common
  766. #ifdef CONFIG_PPC_47x
  767. #ifdef CONFIG_SMP
  768. /* Entry point for secondary 47x processors */
  769. _GLOBAL(start_secondary_47x)
  770. mr r24,r3 /* CPU number */
  771. bl init_cpu_state
  772. /* Now we need to bolt the rest of kernel memory which
  773. * is done in C code. We must be careful because our task
  774. * struct or our stack can (and will probably) be out
  775. * of reach of the initial 256M TLB entry, so we use a
  776. * small temporary stack in .bss for that. This works
  777. * because only one CPU at a time can be in this code
  778. */
  779. lis r1,temp_boot_stack@h
  780. ori r1,r1,temp_boot_stack@l
  781. addi r1,r1,1024-STACK_FRAME_OVERHEAD
  782. li r0,0
  783. stw r0,0(r1)
  784. bl mmu_init_secondary
  785. /* Now we can get our task struct and real stack pointer */
  786. /* Get current_thread_info and current */
  787. lis r1,secondary_ti@ha
  788. lwz r1,secondary_ti@l(r1)
  789. lwz r2,TI_TASK(r1)
  790. /* Current stack pointer */
  791. addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
  792. li r0,0
  793. stw r0,0(r1)
  794. /* Kernel stack for exception entry in SPRG3 */
  795. addi r4,r2,THREAD /* init task's THREAD */
  796. mtspr SPRN_SPRG3,r4
  797. b start_secondary
  798. #endif /* CONFIG_SMP */
  799. /*
  800. * Set up the initial MMU state for 44x
  801. *
  802. * We are still executing code at the virtual address
  803. * mappings set by the firmware for the base of RAM.
  804. */
  805. head_start_47x:
  806. /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
  807. mfspr r3,SPRN_PID /* Get PID */
  808. mfmsr r4 /* Get MSR */
  809. andi. r4,r4,MSR_IS@l /* TS=1? */
  810. beq 1f /* If not, leave STS=0 */
  811. oris r3,r3,PPC47x_MMUCR_STS@h /* Set STS=1 */
  812. 1: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
  813. sync
  814. /* Find the entry we are running from */
  815. bl 1f
  816. 1: mflr r23
  817. tlbsx r23,0,r23
  818. tlbre r24,r23,0
  819. tlbre r25,r23,1
  820. tlbre r26,r23,2
  821. /*
  822. * Cleanup time
  823. */
  824. /* Initialize MMUCR */
  825. li r5,0
  826. mtspr SPRN_MMUCR,r5
  827. sync
  828. clear_all_utlb_entries:
  829. #; Set initial values.
  830. addis r3,0,0x8000
  831. addi r4,0,0
  832. addi r5,0,0
  833. b clear_utlb_entry
  834. #; Align the loop to speed things up.
  835. .align 6
  836. clear_utlb_entry:
  837. tlbwe r4,r3,0
  838. tlbwe r5,r3,1
  839. tlbwe r5,r3,2
  840. addis r3,r3,0x2000
  841. cmpwi r3,0
  842. bne clear_utlb_entry
  843. addis r3,0,0x8000
  844. addis r4,r4,0x100
  845. cmpwi r4,0
  846. bne clear_utlb_entry
  847. #; Restore original entry.
  848. oris r23,r23,0x8000 /* specify the way */
  849. tlbwe r24,r23,0
  850. tlbwe r25,r23,1
  851. tlbwe r26,r23,2
  852. /*
  853. * Configure and load pinned entry into TLB for the kernel core
  854. */
  855. lis r3,PAGE_OFFSET@h
  856. ori r3,r3,PAGE_OFFSET@l
  857. /* Load the kernel PID = 0 */
  858. li r0,0
  859. mtspr SPRN_PID,r0
  860. sync
  861. /* Word 0 */
  862. clrrwi r3,r3,12 /* Mask off the effective page number */
  863. ori r3,r3,PPC47x_TLB0_VALID | PPC47x_TLB0_256M
  864. /* Word 1 - use r25. RPN is the same as the original entry */
  865. /* Word 2 */
  866. li r5,0
  867. ori r5,r5,PPC47x_TLB2_S_RWX
  868. #ifdef CONFIG_SMP
  869. ori r5,r5,PPC47x_TLB2_M
  870. #endif
  871. /* We write to way 0 and bolted 0 */
  872. lis r0,0x8800
  873. tlbwe r3,r0,0
  874. tlbwe r25,r0,1
  875. tlbwe r5,r0,2
  876. /*
  877. * Configure SSPCR, ISPCR and USPCR for now to search everything, we can fix
  878. * them up later
  879. */
  880. LOAD_REG_IMMEDIATE(r3, 0x9abcdef0)
  881. mtspr SPRN_SSPCR,r3
  882. mtspr SPRN_USPCR,r3
  883. LOAD_REG_IMMEDIATE(r3, 0x12345670)
  884. mtspr SPRN_ISPCR,r3
  885. /* Force context change */
  886. mfmsr r0
  887. mtspr SPRN_SRR1, r0
  888. lis r0,3f@h
  889. ori r0,r0,3f@l
  890. mtspr SPRN_SRR0,r0
  891. sync
  892. rfi
  893. /* Invalidate original entry we used */
  894. 3:
  895. rlwinm r24,r24,0,21,19 /* clear the "valid" bit */
  896. tlbwe r24,r23,0
  897. addi r24,0,0
  898. tlbwe r24,r23,1
  899. tlbwe r24,r23,2
  900. isync /* Clear out the shadow TLB entries */
  901. #ifdef CONFIG_PPC_EARLY_DEBUG_44x
  902. /* Add UART mapping for early debug. */
  903. /* Word 0 */
  904. lis r3,PPC44x_EARLY_DEBUG_VIRTADDR@h
  905. ori r3,r3,PPC47x_TLB0_VALID | PPC47x_TLB0_TS | PPC47x_TLB0_1M
  906. /* Word 1 */
  907. lis r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW@h
  908. ori r4,r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH
  909. /* Word 2 */
  910. li r5,(PPC47x_TLB2_S_RW | PPC47x_TLB2_IMG)
  911. /* Bolted in way 0, bolt slot 5, we -hope- we don't hit the same
  912. * congruence class as the kernel, we need to make sure of it at
  913. * some point
  914. */
  915. lis r0,0x8d00
  916. tlbwe r3,r0,0
  917. tlbwe r4,r0,1
  918. tlbwe r5,r0,2
  919. /* Force context change */
  920. isync
  921. #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
  922. /* Establish the interrupt vector offsets */
  923. SET_IVOR(0, CriticalInput);
  924. SET_IVOR(1, MachineCheckA);
  925. SET_IVOR(2, DataStorage);
  926. SET_IVOR(3, InstructionStorage);
  927. SET_IVOR(4, ExternalInput);
  928. SET_IVOR(5, Alignment);
  929. SET_IVOR(6, Program);
  930. SET_IVOR(7, FloatingPointUnavailable);
  931. SET_IVOR(8, SystemCall);
  932. SET_IVOR(9, AuxillaryProcessorUnavailable);
  933. SET_IVOR(10, Decrementer);
  934. SET_IVOR(11, FixedIntervalTimer);
  935. SET_IVOR(12, WatchdogTimer);
  936. SET_IVOR(13, DataTLBError47x);
  937. SET_IVOR(14, InstructionTLBError47x);
  938. SET_IVOR(15, DebugCrit);
  939. /* We configure icbi to invalidate 128 bytes at a time since the
  940. * current 32-bit kernel code isn't too happy with icache != dcache
  941. * block size
  942. */
  943. mfspr r3,SPRN_CCR0
  944. oris r3,r3,0x0020
  945. mtspr SPRN_CCR0,r3
  946. isync
  947. #endif /* CONFIG_PPC_47x */
  948. /*
  949. * Here we are back to code that is common between 44x and 47x
  950. *
  951. * We proceed to further kernel initialization and return to the
  952. * main kernel entry
  953. */
  954. head_start_common:
  955. /* Establish the interrupt vector base */
  956. lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
  957. mtspr SPRN_IVPR,r4
  958. /*
  959. * If the kernel was loaded at a non-zero 256 MB page, we need to
  960. * mask off the most significant 4 bits to get the relative address
  961. * from the start of physical memory
  962. */
  963. rlwinm r22,r22,0,4,31
  964. addis r22,r22,PAGE_OFFSET@h
  965. mtlr r22
  966. isync
  967. blr
  968. /*
  969. * We put a few things here that have to be page-aligned. This stuff
  970. * goes at the beginning of the data segment, which is page-aligned.
  971. */
  972. .data
  973. .align PAGE_SHIFT
  974. .globl sdata
  975. sdata:
  976. .globl empty_zero_page
  977. empty_zero_page:
  978. .space PAGE_SIZE
  979. /*
  980. * To support >32-bit physical addresses, we use an 8KB pgdir.
  981. */
  982. .globl swapper_pg_dir
  983. swapper_pg_dir:
  984. .space PGD_TABLE_SIZE
  985. /*
  986. * Room for two PTE pointers, usually the kernel and current user pointers
  987. * to their respective root page table.
  988. */
  989. abatron_pteptrs:
  990. .space 8
  991. #ifdef CONFIG_SMP
  992. .align 12
  993. temp_boot_stack:
  994. .space 1024
  995. #endif /* CONFIG_SMP */