arch-init-scorpion.S 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. /*
  2. * Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2008-2009, Google Inc.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * * Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in
  13. * the documentation and/or other materials provided with the
  14. * distribution.
  15. * * Neither the name of Google, Inc. nor the names of its contributors
  16. * may be used to endorse or promote products derived from this
  17. * software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  29. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. */
  32. /* TODO:
  33. * - style cleanup
  34. * - do we need to do *all* of this at boot?
  35. */
  36. .text
  37. .code 32
  38. #define DSB .byte 0x4f, 0xf0, 0x7f, 0xf5
  39. #define ISB .byte 0x6f, 0xf0, 0x7f, 0xf5
  40. .equ TCSR_SPARE2, 0xA8700060
  41. SET_SA:
  42. ldr r0, =TCSR_SPARE2
  43. ldr r12, [r0]
  44. /* pack bits 8,2,0 into 2,1,0 */
  45. and r0, r12, #0x001
  46. and r1, r12, #0x004
  47. and r2, r12, #0x100
  48. orr r0, r1, lsr #1
  49. orr r0, r2, lsr #6
  50. adr r1, table_l1_acc
  51. mov r0, r0, lsl #2
  52. ldr r3, [r1, r0]
  53. /* write 3800XXXX to PVR0F0 */
  54. orr r0, r3, #0x38000000
  55. mcr p15, 0, r0, c15, c15, 0
  56. /* write XXXX0000 to PVR2F0 */
  57. mov r1, r3, lsl #16
  58. mcr p15, 2, r1, c15, c15, 0
  59. adr r1, table_l2_acc
  60. and r0, r12, #0x008
  61. and r2, r12, #0x002
  62. orr r0, r0, r2, lsl #1
  63. ldr r2, [r1, r0]
  64. /* write to L2VR3F1 */
  65. mcr p15, 3, r2, c15, c15, 1
  66. bx lr
  67. table_l1_acc:
  68. .word 0xFC00
  69. .word 0xFC00
  70. .word 0x7C00
  71. .word 0xFC00
  72. .word 0x3C00
  73. .word 0x0400
  74. .word 0x0C00
  75. .word 0x1C00
  76. table_l2_acc:
  77. .word 0x010102
  78. .word 0x010102
  79. .word 0x010101
  80. .word 0x212102
  81. .globl __cpu_early_init
  82. __cpu_early_init:
  83. //; Zero out r0 for use throughout this code. All other GPRs
  84. //; (r1-r3) are set throughout this code to help establish
  85. //; a consistent startup state for any code that follows.
  86. //; Users should add code at the end of this routine to establish
  87. //; their own stack address (r13), add translation page tables, enable
  88. //; the caches, etc.
  89. MOV r0, #0x0
  90. //; Remove hardcoded cache settings. appsbl_handler.s calls Set_SA
  91. //; API to dynamically configure cache for slow/nominal/fast parts
  92. //; DCIALL to invalidate L2 cache bank (needs to be run 4 times, once per bank)
  93. //; This must be done early in code (prior to enabling the caches)
  94. MOV r1, #0x2
  95. MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank D ([15:14] == 2'b00)
  96. ORR r1, r1, #0x00004000
  97. MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank C ([15:14] == 2'b01)
  98. ADD r1, r1, #0x00004000
  99. MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank B ([15:14] == 2'b10)
  100. ADD r1, r1, #0x00004000
  101. MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank A ([15:14] == 2'b11)
  102. //; Initialize the BPCR - setup Global History Mask (GHRM) to all 1's
  103. //; and have all address bits (AM) participate.
  104. //; Different settings can be used to improve performance
  105. // MOVW r1, #0x01FF
  106. .word 0xe30011ff // hardcoded MOVW instruction due to lack of compiler support
  107. // MOVT r1, #0x01FF
  108. .word 0xe34011ff // hardcoded MOVT instruction due to lack of compiler support
  109. MCR p15, 7, r1, c15, c0, 2 //; WCP15_BPCR
  110. //; Initialize all I$ Victim Registers to 0 for startup
  111. MCR p15, 0, r0, c9, c1, 0 //; WCP15_ICVIC0 r0
  112. MCR p15, 0, r0, c9, c1, 1 //; WCP15_ICVIC1 r0
  113. MCR p15, 0, r0, c9, c1, 2 //; WCP15_ICVIC2 r0
  114. MCR p15, 0, r0, c9, c1, 3 //; WCP15_ICVIC3 r0
  115. MCR p15, 0, r0, c9, c1, 4 //; WCP15_ICVIC4 r0
  116. MCR p15, 0, r0, c9, c1, 5 //; WCP15_ICVIC5 r0
  117. MCR p15, 0, r0, c9, c1, 6 //; WCP15_ICVIC5 r0
  118. MCR p15, 0, r0, c9, c1, 7 //; WCP15_ICVIC7 r0
  119. //; Initialize all I$ Locked Victim Registers (Unlocked Floors) to 0
  120. MCR p15, 1, r0, c9, c1, 0 //; WCP15_ICFLOOR0 r0
  121. MCR p15, 1, r0, c9, c1, 1 //; WCP15_ICFLOOR1 r0
  122. MCR p15, 1, r0, c9, c1, 2 //; WCP15_ICFLOOR2 r0
  123. MCR p15, 1, r0, c9, c1, 3 //; WCP15_ICFLOOR3 r0
  124. MCR p15, 1, r0, c9, c1, 4 //; WCP15_ICFLOOR4 r0
  125. MCR p15, 1, r0, c9, c1, 5 //; WCP15_ICFLOOR5 r0
  126. MCR p15, 1, r0, c9, c1, 6 //; WCP15_ICFLOOR6 r0
  127. MCR p15, 1, r0, c9, c1, 7 //; WCP15_ICFLOOR7 r0
  128. //; Initialize all D$ Victim Registers to 0
  129. MCR p15, 2, r0, c9, c1, 0 //; WP15_DCVIC0 r0
  130. MCR p15, 2, r0, c9, c1, 1 //; WP15_DCVIC1 r0
  131. MCR p15, 2, r0, c9, c1, 2 //; WP15_DCVIC2 r0
  132. MCR p15, 2, r0, c9, c1, 3 //; WP15_DCVIC3 r0
  133. MCR p15, 2, r0, c9, c1, 4 //; WP15_DCVIC4 r0
  134. MCR p15, 2, r0, c9, c1, 5 //; WP15_DCVIC5 r0
  135. MCR p15, 2, r0, c9, c1, 6 //; WP15_DCVIC6 r0
  136. MCR p15, 2, r0, c9, c1, 7 //; WP15_DCVIC7 r0
  137. //; Initialize all D$ Locked VDCtim Registers (Unlocked Floors) to 0
  138. MCR p15, 3, r0, c9, c1, 0 //; WCP15_DCFLOOR0 r0
  139. MCR p15, 3, r0, c9, c1, 1 //; WCP15_DCFLOOR1 r0
  140. MCR p15, 3, r0, c9, c1, 2 //; WCP15_DCFLOOR2 r0
  141. MCR p15, 3, r0, c9, c1, 3 //; WCP15_DCFLOOR3 r0
  142. MCR p15, 3, r0, c9, c1, 4 //; WCP15_DCFLOOR4 r0
  143. MCR p15, 3, r0, c9, c1, 5 //; WCP15_DCFLOOR5 r0
  144. MCR p15, 3, r0, c9, c1, 6 //; WCP15_DCFLOOR6 r0
  145. MCR p15, 3, r0, c9, c1, 7 //; WCP15_DCFLOOR7 r0
  146. //; Initialize ASID to zero
  147. MCR p15, 0, r0, c13, c0, 1 //; WCP15_CONTEXTIDR r0
  148. //; ICIALL to invalidate entire I-Cache
  149. MCR p15, 0, r0, c7, c5, 0 //; ICIALLU
  150. //; DCIALL to invalidate entire D-Cache
  151. MCR p15, 0, r0, c9, c0, 6 //; DCIALL r0
  152. //; The VBAR (Vector Base Address Register) should be initialized
  153. //; early in your code. We are setting it to zero
  154. MCR p15, 0, r0, c12, c0, 0 //; WCP15_VBAR r0
  155. //; Ensure the MCR's above have completed their operation before continuing
  156. DSB
  157. ISB
  158. //;-------------------------------------------------------------------
  159. //; There are a number of registers that must be set prior to enabling
  160. //; the MMU. The DCAR is one of these registers. We are setting
  161. //; it to zero (no access) to easily detect improper setup in subsequent
  162. //; code sequences
  163. //;-------------------------------------------------------------------
  164. //; Setup DACR (Domain Access Control Register) to zero
  165. MCR p15, 0, r0, c3, c0, 0 //; WCP15_DACR r0
  166. //; Setup DCLKCR to allow normal D-Cache line fills
  167. MCR p15, 1, r0, c9, c0, 7 //; WCP15_DCLKCR r0
  168. //; Initialize the ADFSR and EFSR registers.
  169. MCR p15, 0, r0, c5, c1, 0 //; ADFSR
  170. MCR p15, 7, r0, c15, c0, 1 //; EFSR
  171. //; Setup the TLBLKCR
  172. //; Victim = 6'b000000; Floor = 6'b000000;
  173. //; IASIDCFG = 2'b00 (State-Machine); IALLCFG = 2'b01 (Flash); BNA = 1'b0;
  174. MOV r1, #0x02
  175. MCR p15, 0, r1, c10, c1, 3 //; WCP15_TLBLKCR r1
  176. //;Make sure TLBLKCR is complete before continuing
  177. ISB
  178. //; Invalidate the UTLB
  179. MCR p15, 0, r0, c8, c7, 0 //; UTLBIALL
  180. //; Make sure UTLB request has been presented to macro before continuing
  181. ISB
  182. //; setup L2CR1 to some default Instruction and data prefetching values
  183. //; Users may want specific settings for various performance enhancements
  184. //; In Halcyon we do not have broadcasting barriers. So we need to turn
  185. // ; on bit 8 of L2CR1; which DBB:( Disable barrier broadcast )
  186. MOV r2, #0x100
  187. MCR p15, 3, r2, c15, c0, 3 //; WCP15_L2CR1 r0
  188. //; Enable Z bit to enable branch prediction (default is off)
  189. MRC p15, 0, r2, c1, c0, 0 //; RCP15_SCTLR r2
  190. ORR r2, r2, #0x00000800
  191. MCR p15, 0, r2, c1, c0, 0 //; WCP15_SCTLR r2
  192. #ifdef CONFIG_ARCH_QSD8X50
  193. /* disable predecode repair cache for thumb2 (DPRC, set bit 4 in PVR0F2) */
  194. mrc p15, 0, r2, c15, c15, 2
  195. orr r2, r2, #0x10
  196. mcr p15, 0, r2, c15, c15, 2
  197. #endif
  198. mov r1, lr
  199. //; Make sure Link stack is initialized with branch and links to sequential addresses
  200. //; This aids in creating a predictable startup environment
  201. BL SEQ1
  202. SEQ1: BL SEQ2
  203. SEQ2: BL SEQ3
  204. SEQ3: BL SEQ4
  205. SEQ4: BL SEQ5
  206. SEQ5: BL SEQ6
  207. SEQ6: BL SEQ7
  208. SEQ7: BL SEQ8
  209. SEQ8:
  210. mov lr, r1
  211. //; REMOVE FOLLOWING THREE INSTRUCTIONS WHEN POWER COLLAPSE IS ENA
  212. //;Make sure the DBGOSLSR[LOCK] bit is cleared to allow access to the debug registers
  213. //; Writing anything but the "secret code" to the DBGOSLAR clears the DBGOSLSR[LOCK] bit
  214. MCR p14, 0, r0, c1, c0, 4 //; WCP14_DBGOSLAR r0
  215. //; Read the DBGPRSR to clear the DBGPRSR[STICKYPD]
  216. //; Any read to DBGPRSR clear the STICKYPD bit
  217. //; ISB guarantees the read completes before attempting to
  218. //; execute a CP14 instruction.
  219. MRC p14, 0, r3, c1, c5, 4 //; RCP14_DBGPRSR r3
  220. ISB
  221. //; Initialize the Watchpoint Control Registers to zero (optional)
  222. //;;; MCR p14, 0, r0, c0, c0, 7 ; WCP14_DBGWCR0 r0
  223. //;;; MCR p14, 0, r0, c0, c1, 7 ; WCP14_DBGWCR1 r0
  224. //;----------------------------------------------------------------------
  225. //; The saved Program Status Registers (SPSRs) should be setup
  226. //; prior to any automatic mode switches. The following
  227. //; code sets these registers up to a known state. Users will need to
  228. //; customize these settings to meet their needs.
  229. //;----------------------------------------------------------------------
  230. MOV r2, #0x1f
  231. MOV r1, #0x17 //;ABT mode
  232. msr cpsr_c, r1 //;ABT mode
  233. msr spsr_cxfs, r2 //;clear the spsr
  234. MOV r1, #0x1b //;UND mode
  235. msr cpsr_c, r1 //;UND mode
  236. msr spsr_cxfs, r2 //;clear the spsr
  237. MOV r1, #0x11 //;FIQ mode
  238. msr cpsr_c, r1 //;FIQ mode
  239. msr spsr_cxfs, r2 //;clear the spsr
  240. MOV r1, #0x12 //;IRQ mode
  241. msr cpsr_c, r1 //;IRQ mode
  242. msr spsr_cxfs, r2 //;clear the spsr
  243. MOV r1, #0x16 //;Monitor mode
  244. msr cpsr_c, r1 //;Monitor mode
  245. msr spsr_cxfs, r2 //;clear the spsr
  246. MOV r1, #0x13 //;SVC mode
  247. msr cpsr_c, r1 //;SVC mode
  248. msr spsr_cxfs, r2 //;clear the spsr
  249. //;----------------------------------------------------------------------
  250. //; Enabling Error reporting is something users may want to do at
  251. //; some other point in time. We have chosen some default settings
  252. //; that should be reviewed. Most of these registers come up in an
  253. //; unpredictable state after reset.
  254. //;----------------------------------------------------------------------
  255. //;Start of error and control setting
  256. //; setup L2CR0 with various L2/TCM control settings
  257. //; enable out of order bus attributes and error reporting
  258. //; this register comes up unpredictable after reset
  259. // MOVW r1, #0x0F0F
  260. .word 0xe3001f0f // hardcoded MOVW instruction due to lack of compiler support
  261. // MOVT r1, #0xC005
  262. .word 0xe34c1005 // hardcoded MOVW instruction due to lack of compiler support
  263. MCR p15, 3, r1, c15, c0, 1 //; WCP15_L2CR0 r1
  264. //; setup L2CPUCR
  265. //; MOV r2, #0xFF
  266. //; Enable I and D cache parity
  267. //;L2CPUCR[7:5] = 3~Rh7 ~V enable parity error reporting for modified,
  268. //;tag, and data parity errors
  269. MOV r2, #0xe0
  270. MCR p15, 3, r2, c15, c0, 2 //; WCP15_L2CPUCR r2
  271. //; setup SPCR
  272. //; enable all error reporting (reset value is unpredicatble for most bits)
  273. MOV r3, #0x0F
  274. MCR p15, 0, r3, c9, c7, 0 //; WCP15_SPCR r3
  275. //; setup DMACHCRs (reset value unpredictable)
  276. //; control setting and enable all error reporting
  277. MOV r1, #0x0F
  278. //; DMACHCR0 = 0000000F
  279. MOV r2, #0x00 //; channel 0
  280. MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
  281. MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
  282. //; DMACHCR1 = 0000000F
  283. MOV r2, #0x01 //; channel 1
  284. MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
  285. MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
  286. //; DMACHCR2 = 0000000F
  287. MOV r2, #0x02 //; channel 2
  288. MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
  289. MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
  290. //; DMACHCR3 = 0000000F
  291. MOV r2, #0x03 //; channel 3
  292. MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
  293. MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
  294. //; Set ACTLR (reset unpredictable)
  295. //; Set AVIVT control, error reporting, etc.
  296. //; MOV r3, #0x07
  297. //; Enable I and D cache parity
  298. //;ACTLR[2:0] = 3'h7 - enable parity error reporting from L2/I$/D$)
  299. //;ACTLR[5:4] = 2'h3 - enable parity
  300. //;ACTLR[19:18] =2'h3 - always generate and check parity(when MMU disabled).
  301. //;Value to be written #0xC0037
  302. // MOVW r3, #0x0037
  303. .word 0xe3003037 // hardcoded MOVW instruction due to lack of compiler support
  304. // MOVT r3, #0x000C
  305. .word 0xe340300c // hardcoded MOVW instruction due to lack of compiler support
  306. //; read the version_id to determine if d-cache should be disabled
  307. LDR r2, = 0xa8e00270 //;Read HW_REVISION_NUMBER, HWIO_HW_REVISION_NUMBER_ADDR
  308. LDR r2,[r2]
  309. AND r2,r2,#0xf0000000 //;hw_revision mask off bits 28-31
  310. //;if HW_revision is 1.0 or older, (revision==0)
  311. CMP r2,#0
  312. //; Disable d-cache on older QSD8650 (Rev 1.0) silicon
  313. orreq r3, r3, #0x4000 //;disable dcache
  314. MCR p15, 0, r3, c1, c0, 1 //; WCP15_ACTLR r3
  315. //;End of error and control setting
  316. //;----------------------------------------------------------------------
  317. //; Unlock ETM and read StickyPD to halt the ETM clocks from running.
  318. //; This is required for power saving whether the ETM is used or not.
  319. //;----------------------------------------------------------------------
  320. //;Clear ETMOSLSR[LOCK] bit
  321. MOV r1, #0x00000000
  322. MCR p14, 1, r1, c1, c0, 4 //; WCP14_ETMOSLAR r1
  323. //;Clear ETMPDSR[STICKYPD] bit
  324. MRC p14, 1, r2, c1, c5, 4 //; RCP14_ETMPDSR r2
  325. /*
  326. #ifdef APPSBL_ETM_ENABLE
  327. ;----------------------------------------------------------------------
  328. ; Optionally Enable the ETM (Embedded Trace Macro) which is used for debug
  329. ;----------------------------------------------------------------------
  330. ; enable ETM clock if disabled
  331. MRC p15, 7, r1, c15, c0, 5 ; RCP15_CPMR r1
  332. ORR r1, r1, #0x00000008
  333. MCR p15, 7, r1, c15, c0, 5 ; WCP15_CPMR r1
  334. ISB
  335. ; set trigger event to counter1 being zero
  336. MOV r3, #0x00000040
  337. MCR p14, 1, r3, c0, c2, 0 ; WCP14_ETMTRIGGER r3
  338. ; clear ETMSR
  339. MOV r2, #0x00000000
  340. MCR p14, 1, r2, c0, c4, 0 ; WCP14_ETMSR r2
  341. ; clear trace enable single address comparator usage
  342. MCR p14, 1, r2, c0, c7, 0 ; WCP14_ETMTECR2 r2
  343. ; set trace enable to always
  344. MOV r2, #0x0000006F
  345. MCR p14, 1, r2, c0, c8, 0 ; WCP14_ETMTEEVR r2
  346. ; clear trace enable address range comparator usage and exclude nothing
  347. MOV r2, #0x01000000
  348. MCR p14, 1, r2, c0, c9, 0 ; WCP14_ETMTECR1 r2
  349. ; set view data to always
  350. MOV r2, #0x0000006F
  351. MCR p14, 1, r2, c0, c12, 0 ; WCP14_ETMVDEVR r2
  352. ; clear view data single address comparator usage
  353. MOV r2, #0x00000000
  354. MCR p14, 1, r2, c0, c13, 0 ; WCP14_ETMVDCR1 r2
  355. ; clear view data address range comparator usage and exclude nothing
  356. MOV r2, #0x00010000
  357. MCR p14, 1, r2, c0, c15, 0 ; WCP14_ETMVDCR3 r2
  358. ; set counter1 to 194
  359. MOV r2, #0x000000C2
  360. MCR p14, 1, r2, c0, c0, 5 ; WCP14_ETMCNTRLDVR1 r2
  361. ; set counter1 to never reload
  362. MOV r2, #0x0000406F
  363. MCR p14, 1, r2, c0, c8, 5 ; WCP14_ETMCNTRLDEVR1 r2
  364. ; set counter1 to decrement every cycle
  365. MOV r2, #0x0000006F
  366. MCR p14, 1, r2, c0, c4, 5 ; WCP14_ETMCNTENR1 r2
  367. ; Set trace synchronization frequency 1024 bytes
  368. MOV r2, #0x00000400
  369. MCR p14, 1, r2, c0, c8, 7 ; WCP14_ETMSYNCFR r2
  370. ; Program etm control register
  371. ; - Set the CPU to ETM clock ratio to 1:1
  372. ; - Set the ETM to perform data address tracing
  373. MOV r2, #0x00002008
  374. MCR p14, 1, r2, c0, c0, 0 ; WCP14_ETMCR r2
  375. ISB
  376. #endif *//* APPSBL_ETM_ENABLE */
  377. /*
  378. #ifdef APPSBL_VFP_ENABLE
  379. ;----------------------------------------------------------------------
  380. ; Perform the following operations if you intend to make use of
  381. ; the VFP/Neon unit. Note that the FMXR instruction requires a CPU ID
  382. ; indicating the VFP unit is present (i.e.Cortex-A8). .
  383. ; Some tools will require full double precision floating point support
  384. ; which will become available in Scorpion pass 2
  385. ;----------------------------------------------------------------------
  386. ; allow full access to CP 10 and 11 space for VFP/NEON use
  387. MRC p15, 0, r1, c1, c0, 2 ; Read CP Access Control Register
  388. ORR r1, r1, #0x00F00000 ; enable full access for p10,11
  389. MCR p15, 0, r1, c1, c0, 2 ; Write CPACR
  390. ;make sure the CPACR is complete before continuing
  391. ISB
  392. ; Enable VFP itself (certain OSes may want to dynamically set/clear
  393. ; the enable bit based on the application being executed
  394. MOV r1, #0x40000000
  395. FMXR FPEXC, r1
  396. #endif *//* APPSBL_VFP_ENABLE */
  397. /* we have no stack, so just tail-call into the SET_SA routine... */
  398. b SET_SA
  399. .ltorg