2 * Copyright (c) 2008, Google Inc.
4 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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
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.
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
36 * - do we need to do *all* of this at boot?
42 #define DSB .byte 0x4f, 0xf0, 0x7f, 0xf5
43 #define ISB .byte 0x6f, 0xf0, 0x7f, 0xf5
46 ; LVT Ring Osc counter
47 ; used to determine sense amp settings
48 ; Clobbers registers r0, r4, r5, r6, r7, r9, r10, r11
50 .equ CLK_CTL_BASE, 0xA8600000
51 .equ A_GLBL_CLK_ENA, 0x0000
52 .equ A_PRPH_WEB_NS_REG,0x0080
53 .equ A_MSM_CLK_RINGOSC,0x00D0
54 .equ A_TCXO_CNT, 0x00D4
55 .equ A_TCXO_CNT_DONE, 0x00D8
56 .equ A_RINGOSC_CNT, 0x00DC
57 .equ A_MISC_CLK_CTL, 0x0108
58 .equ CLK_TEST, 0xA8600114
59 .equ SPSS_CSR_BASE, 0xAC100000
60 .equ A_SCRINGOSC, 0x0510
62 //;; Number of TCXO cycles to count ring oscillations
63 .equ TCXO_CNT_VAL, 0x100
66 .equ TCSR_CONF_FUSE_1, 0xAB600060 //; TCSR_CONF_FUSE_1 register
67 .equ TCSR_CONF_FUSE_4, 0xAB60006C //; TCSR_CONF_FUSE_4 register
69 //; SCORPION_L1_ACC (1:0) Fuses bit location
70 .equ L1_ACC_BIT_0, 12 //;12th bit of TCSR_CONF_FUSE_4
71 .equ L1_ACC_BIT_1, 13 //;13th bit of TCSR_CONF_FUSE_4
72 //; SCORPION_L2_ACC (2:0) Fuses bit location
73 .equ L2_ACC_BIT_0, 25 //;25th bit of TCSR_CONF_FUSE_1
74 .equ L2_ACC_BIT_1, 10 //;10th bit of TCSR_CONF_FUSE_4
75 .equ L2_ACC_BIT_2, 11 //;11th bit of TCSR_CONF_FUSE_4
77 //; CP15: PVR2F0 values according to SCORPION_L1_ACC (1:0)
78 .equ PVR2F0_00, 0x00000000
79 .equ PVR2F0_01, 0x04000000
80 .equ PVR2F0_10, 0x08000000
81 .equ PVR2F0_11, 0x0C000000
83 //; CP15: PVR2F1 values according to SCORPION_L1_ACC (1:0)
84 .equ PVR2F1_00, 0x00000008
85 .equ PVR2F1_01, 0x00000008
86 .equ PVR2F1_10, 0x00000208
87 .equ PVR2F1_11, 0x00000208
89 //; CP15: PVR0F2 values according to SCORPION_L1_ACC (1:0)
90 .equ PVR0F2_00, 0x00000000
91 .equ PVR0F2_01, 0x00000000
92 .equ PVR0F2_10, 0x00000200
93 .equ PVR0F2_11, 0x00000200
95 //; CP15: PVR0F0 values according to SCORPION_L1_ACC (1:0)
96 .equ PVR0F0_00, 0x7F000000
97 .equ PVR0F0_01, 0x7F000400
98 .equ PVR0F0_10, 0x7F000000
99 .equ PVR0F0_11, 0x7F000400
101 //; CP15: L2VR3F1 values according to SCORPION_L2_ACC (2:0)
102 .equ L2VR3F1_000, 0x00FFFF60
103 .equ L2VR3F1_001, 0x00FFFF40
104 .equ L2VR3F1_010, 0x00FFFC60
105 .equ L2VR3F1_011, 0x00FFFC40
106 .equ L2VR3F1_100, 0x00FCFF60
107 .equ L2VR3F1_101, 0x00FCFF40
108 .equ L2VR3F1_110, 0x00FCFC60
109 .equ L2VR3F1_111, 0x00FCFC40
114 //;--------------------------------------------------------------------
115 //; Fuse bits used to determine sense amp settings
116 //;--------------------------------------------------------------------
121 //; Read L1_ACC_BIT_0
122 LDR r1, =TCSR_CONF_FUSE_4
123 LDR r2, =L1_ACC_BIT_0
129 //; Read L1_ACC_BIT_1
130 LDR r1, =TCSR_CONF_FUSE_4
131 LDR r2, =L1_ACC_BIT_1
139 //; if L1_[1:0] == 00
147 B WRITE_L1_SA_SETTINGS
150 //; if L1_[1:0] == 01
158 B WRITE_L1_SA_SETTINGS
161 //; if L1_[2:0] == 10
169 B WRITE_L1_SA_SETTINGS
172 //; if L1_[2:0] == 11
179 B WRITE_L1_SA_SETTINGS
182 WRITE_L1_SA_SETTINGS:
185 MCR p15, 0x0, r0, c15, c15, 0x0 //; write R0 to PVR0F0
188 MCR p15, 0x0, r1, c15, c15, 0x2 //; write R1 to PVR0F2
191 MCR p15, 0x2, r2, c15, c15, 0x0 //; write R2 to PVR2F0
193 // Disable predecode repair cache on certain Scorpion revisions
194 // (Raptor V2 and earlier, or Halcyon V1)
195 MRC p15, 0, r1, c0, c0, 0 //; MIDR
196 BIC r2, r1, #0xf0 //; check for Halcyon V1
202 MRC p15, 0, r1, c15, c15, 2 //; PVR0F2
203 ORR r1, r1, #0x10 //; enable bit 4
204 MCR p15, 0, r1, c15, c15, 2 //; disable predecode repair cache
208 MCR p15, 0x2, r3, c15, c15, 0x1 //; write R3 to PVR2F1
213 //; Read L2_ACC_BIT_0
214 LDR r1, =TCSR_CONF_FUSE_1
215 LDR r2, =L2_ACC_BIT_0
221 //; Read L2_ACC_BIT_1
222 LDR r1, =TCSR_CONF_FUSE_4
223 LDR r2, =L2_ACC_BIT_1
230 //; Read L2_ACC_BIT_2
231 LDR r1, =TCSR_CONF_FUSE_4
232 LDR r2, =L2_ACC_BIT_2
240 //; if L2_[2:0] == 000
245 B WRITE_L2_SA_SETTINGS
248 //; if L2_[2:0] == 001
253 B WRITE_L2_SA_SETTINGS
256 //; if L2_[2:0] == 010
261 B WRITE_L2_SA_SETTINGS
264 //; if L2_[2:0] == 011
269 B WRITE_L2_SA_SETTINGS
272 //; if L2_[2:0] == 100
277 B WRITE_L2_SA_SETTINGS
280 //; if L2_[2:0] == 101
285 B WRITE_L2_SA_SETTINGS
288 //; if L2_[2:0] == 110
293 B WRITE_L2_SA_SETTINGS
296 //; if L2_[2:0] == 111
300 B WRITE_L2_SA_SETTINGS
302 WRITE_L2_SA_SETTINGS:
304 MCR p15, 0x3, r0, c15, c15, 0x1 //;write r0 to L2VR3F1
308 LDR r0, =0 //;make sure the registers we touched
309 LDR r1, =0 //;are cleared when we return
321 .globl __cpu_early_init
323 //; Zero out r0 for use throughout this code. All other GPRs
324 //; (r1-r3) are set throughout this code to help establish
325 //; a consistent startup state for any code that follows.
326 //; Users should add code at the end of this routine to establish
327 //; their own stack address (r13), add translation page tables, enable
332 //; Remove hardcoded cache settings. appsbl_handler.s calls Set_SA
333 //; API to dynamically configure cache for slow/nominal/fast parts
335 //; DCIALL to invalidate L2 cache bank (needs to be run 4 times, once per bank)
336 //; This must be done early in code (prior to enabling the caches)
338 MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank D ([15:14] == 2'b00)
339 ORR r1, r1, #0x00004000
340 MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank C ([15:14] == 2'b01)
341 ADD r1, r1, #0x00004000
342 MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank B ([15:14] == 2'b10)
343 ADD r1, r1, #0x00004000
344 MCR p15, 0, r1, c9, c0, 6 //; DCIALL bank A ([15:14] == 2'b11)
346 //; Initialize the BPCR - setup Global History Mask (GHRM) to all 1's
347 //; and have all address bits (AM) participate.
348 //; Different settings can be used to improve performance
350 .word 0xe30011ff // hardcoded MOVW instruction due to lack of compiler support
352 .word 0xe34011ff // hardcoded MOVT instruction due to lack of compiler support
353 MCR p15, 7, r1, c15, c0, 2 //; WCP15_BPCR
356 //; Initialize all I$ Victim Registers to 0 for startup
357 MCR p15, 0, r0, c9, c1, 0 //; WCP15_ICVIC0 r0
358 MCR p15, 0, r0, c9, c1, 1 //; WCP15_ICVIC1 r0
359 MCR p15, 0, r0, c9, c1, 2 //; WCP15_ICVIC2 r0
360 MCR p15, 0, r0, c9, c1, 3 //; WCP15_ICVIC3 r0
361 MCR p15, 0, r0, c9, c1, 4 //; WCP15_ICVIC4 r0
362 MCR p15, 0, r0, c9, c1, 5 //; WCP15_ICVIC5 r0
363 MCR p15, 0, r0, c9, c1, 6 //; WCP15_ICVIC5 r0
364 MCR p15, 0, r0, c9, c1, 7 //; WCP15_ICVIC7 r0
366 //; Initialize all I$ Locked Victim Registers (Unlocked Floors) to 0
367 MCR p15, 1, r0, c9, c1, 0 //; WCP15_ICFLOOR0 r0
368 MCR p15, 1, r0, c9, c1, 1 //; WCP15_ICFLOOR1 r0
369 MCR p15, 1, r0, c9, c1, 2 //; WCP15_ICFLOOR2 r0
370 MCR p15, 1, r0, c9, c1, 3 //; WCP15_ICFLOOR3 r0
371 MCR p15, 1, r0, c9, c1, 4 //; WCP15_ICFLOOR4 r0
372 MCR p15, 1, r0, c9, c1, 5 //; WCP15_ICFLOOR5 r0
373 MCR p15, 1, r0, c9, c1, 6 //; WCP15_ICFLOOR6 r0
374 MCR p15, 1, r0, c9, c1, 7 //; WCP15_ICFLOOR7 r0
376 //; Initialize all D$ Victim Registers to 0
377 MCR p15, 2, r0, c9, c1, 0 //; WP15_DCVIC0 r0
378 MCR p15, 2, r0, c9, c1, 1 //; WP15_DCVIC1 r0
379 MCR p15, 2, r0, c9, c1, 2 //; WP15_DCVIC2 r0
380 MCR p15, 2, r0, c9, c1, 3 //; WP15_DCVIC3 r0
381 MCR p15, 2, r0, c9, c1, 4 //; WP15_DCVIC4 r0
382 MCR p15, 2, r0, c9, c1, 5 //; WP15_DCVIC5 r0
383 MCR p15, 2, r0, c9, c1, 6 //; WP15_DCVIC6 r0
384 MCR p15, 2, r0, c9, c1, 7 //; WP15_DCVIC7 r0
386 //; Initialize all D$ Locked VDCtim Registers (Unlocked Floors) to 0
387 MCR p15, 3, r0, c9, c1, 0 //; WCP15_DCFLOOR0 r0
388 MCR p15, 3, r0, c9, c1, 1 //; WCP15_DCFLOOR1 r0
389 MCR p15, 3, r0, c9, c1, 2 //; WCP15_DCFLOOR2 r0
390 MCR p15, 3, r0, c9, c1, 3 //; WCP15_DCFLOOR3 r0
391 MCR p15, 3, r0, c9, c1, 4 //; WCP15_DCFLOOR4 r0
392 MCR p15, 3, r0, c9, c1, 5 //; WCP15_DCFLOOR5 r0
393 MCR p15, 3, r0, c9, c1, 6 //; WCP15_DCFLOOR6 r0
394 MCR p15, 3, r0, c9, c1, 7 //; WCP15_DCFLOOR7 r0
396 //; Initialize ASID to zero
397 MCR p15, 0, r0, c13, c0, 1 //; WCP15_CONTEXTIDR r0
399 //; ICIALL to invalidate entire I-Cache
400 MCR p15, 0, r0, c7, c5, 0 //; ICIALLU
402 //; DCIALL to invalidate entire D-Cache
403 MCR p15, 0, r0, c9, c0, 6 //; DCIALL r0
405 //; Initialize ADFSR to zero
406 MCR p15, 0, r0, c5, c1, 0 //; ADFSR r0
408 //; Initialize EFSR to zero
409 MCR p15, 7, r0, c15, c0, 1 //; EFSR r0
411 //; The VBAR (Vector Base Address Register) should be initialized
412 //; early in your code. We are setting it to zero
413 MCR p15, 0, r0, c12, c0, 0 //; WCP15_VBAR r0
415 //; Ensure the MCR's above have completed their operation before continuing
419 //;-------------------------------------------------------------------
420 //; There are a number of registers that must be set prior to enabling
421 //; the MMU. The DCAR is one of these registers. We are setting
422 //; it to zero (no access) to easily detect improper setup in subsequent
424 //;-------------------------------------------------------------------
425 //; Setup DACR (Domain Access Control Register) to zero
426 MCR p15, 0, r0, c3, c0, 0 //; WCP15_DACR r0
428 //; Setup DCLKCR to allow normal D-Cache line fills
429 MCR p15, 1, r0, c9, c0, 7 //; WCP15_DCLKCR r0
431 //; Setup the TLBLKCR
432 //; Victim = 6'b000000; Floor = 6'b000000;
433 //; IASIDCFG = 2'b00 (State-Machine); IALLCFG = 2'b01 (Flash); BNA = 1'b0;
435 MCR p15, 0, r1, c10, c1, 3 //; WCP15_TLBLKCR r1
437 //;Make sure TLBLKCR is complete before continuing
440 //; Invalidate the UTLB
441 MCR p15, 0, r0, c8, c7, 0 //; UTLBIALL
443 //; Make sure UTLB request has been presented to macro before continuing
447 //; setup L2CR1 to some default Instruction and data prefetching values
448 //; Users may want specific settings for various performance enhancements
449 //; In Halcyon we do not have broadcasting barriers. So we need to turn
450 // ; on bit 8 of L2CR1; which DBB:( Disable barrier broadcast )
452 MCR p15, 3, r2, c15, c0, 3 //; WCP15_L2CR1 r0
455 //; Enable Z bit to enable branch prediction (default is off)
456 MRC p15, 0, r2, c1, c0, 0 //; RCP15_SCTLR r2
457 ORR r2, r2, #0x00000800
458 MCR p15, 0, r2, c1, c0, 0 //; WCP15_SCTLR r2
460 //; Make sure Link stack is initialized with branch and links to sequential addresses
461 //; This aids in creating a predictable startup environment
472 //; REMOVE FOLLOWING THREE INSTRUCTIONS WHEN POWER COLLAPSE IS ENA
473 //;Make sure the DBGOSLSR[LOCK] bit is cleared to allow access to the debug registers
474 //; Writing anything but the "secret code" to the DBGOSLAR clears the DBGOSLSR[LOCK] bit
475 MCR p14, 0, r0, c1, c0, 4 //; WCP14_DBGOSLAR r0
478 //; Read the DBGPRSR to clear the DBGPRSR[STICKYPD]
479 //; Any read to DBGPRSR clear the STICKYPD bit
480 //; ISB guarantees the read completes before attempting to
481 //; execute a CP14 instruction.
482 MRC p14, 0, r3, c1, c5, 4 //; RCP14_DBGPRSR r3
485 //; Initialize the Watchpoint Control Registers to zero (optional)
486 //;;; MCR p14, 0, r0, c0, c0, 7 ; WCP14_DBGWCR0 r0
487 //;;; MCR p14, 0, r0, c0, c1, 7 ; WCP14_DBGWCR1 r0
490 //;----------------------------------------------------------------------
491 //; The saved Program Status Registers (SPSRs) should be setup
492 //; prior to any automatic mode switches. The following
493 //; code sets these registers up to a known state. Users will need to
494 //; customize these settings to meet their needs.
495 //;----------------------------------------------------------------------
497 MOV r1, #0xd7 //;ABT mode
498 msr cpsr_c, r1 //;ABT mode
499 msr spsr_cxfs, r2 //;clear the spsr
500 MOV r1, #0xdb //;UND mode
501 msr cpsr_c, r1 //;UND mode
502 msr spsr_cxfs, r2 //;clear the spsr
503 MOV r1, #0xd1 //;FIQ mode
504 msr cpsr_c, r1 //;FIQ mode
505 msr spsr_cxfs, r2 //;clear the spsr
506 MOV r1, #0xd2 //;IRQ mode
507 msr cpsr_c, r1 //;IRQ mode
508 msr spsr_cxfs, r2 //;clear the spsr
509 MOV r1, #0xd6 //;Monitor mode
510 msr cpsr_c, r1 //;Monitor mode
511 msr spsr_cxfs, r2 //;clear the spsr
512 MOV r1, #0xd3 //;SVC mode
513 msr cpsr_c, r1 //;SVC mode
514 msr spsr_cxfs, r2 //;clear the spsr
517 //;----------------------------------------------------------------------
518 //; Enabling Error reporting is something users may want to do at
519 //; some other point in time. We have chosen some default settings
520 //; that should be reviewed. Most of these registers come up in an
521 //; unpredictable state after reset.
522 //;----------------------------------------------------------------------
523 //;Start of error and control setting
525 //; setup L2CR0 with various L2/TCM control settings
526 //; enable out of order bus attributes and error reporting
527 //; this register comes up unpredictable after reset
529 .word 0xe3001f0f // hardcoded MOVW instruction due to lack of compiler support
531 .word 0xe34c1005 // hardcoded MOVW instruction due to lack of compiler support
532 MCR p15, 3, r1, c15, c0, 1 //; WCP15_L2CR0 r1
536 //; Enable I and D cache parity
537 //;L2CPUCR[7:5] = 3~Rh7 ~V enable parity error reporting for modified,
538 //;tag, and data parity errors
540 MCR p15, 3, r2, c15, c0, 2 //; WCP15_L2CPUCR r2
543 //; enable all error reporting (reset value is unpredicatble for most bits)
545 MCR p15, 0, r3, c9, c7, 0 //; WCP15_SPCR r3
547 //; setup DMACHCRs (reset value unpredictable)
548 //; control setting and enable all error reporting
551 //; DMACHCR0 = 0000000F
552 MOV r2, #0x00 //; channel 0
553 MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
554 MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
556 //; DMACHCR1 = 0000000F
557 MOV r2, #0x01 //; channel 1
558 MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
559 MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
561 //; DMACHCR2 = 0000000F
562 MOV r2, #0x02 //; channel 2
563 MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
564 MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
566 //; DMACHCR3 = 0000000F
567 MOV r2, #0x03 //; channel 3
568 MCR p15, 0, r2, c11, c0, 0 //; WCP15_DMASELR r2
569 MCR p15, 0, r1, c11, c0, 2 //; WCP15_DMACHCR r1
571 //; Set ACTLR (reset unpredictable)
572 //; Set AVIVT control, error reporting, etc.
574 //; Enable I and D cache parity
575 //;ACTLR[2:0] = 3'h7 - enable parity error reporting from L2/I$/D$)
576 //;ACTLR[5:4] = 2'h3 - enable parity
577 //;ACTLR[19:18] =2'h3 - always generate and check parity(when MMU disabled).
578 //;Value to be written #0xC0037
580 .word 0xe3003037 // hardcoded MOVW instruction due to lack of compiler support
582 .word 0xe340300c // hardcoded MOVW instruction due to lack of compiler support
583 MCR p15, 0, r3, c1, c0, 1 //; WCP15_ACTLR r3
585 //;End of error and control setting
587 //;----------------------------------------------------------------------
588 //; Unlock ETM and read StickyPD to halt the ETM clocks from running.
589 //; This is required for power saving whether the ETM is used or not.
590 //;----------------------------------------------------------------------
592 //;Clear ETMOSLSR[LOCK] bit
594 MCR p14, 1, r1, c1, c0, 4 //; WCP14_ETMOSLAR r1
596 //;Clear ETMPDSR[STICKYPD] bit
597 MRC p14, 1, r2, c1, c5, 4 //; RCP14_ETMPDSR r2
600 #ifdef APPSBL_ETM_ENABLE
601 ;----------------------------------------------------------------------
602 ; Optionally Enable the ETM (Embedded Trace Macro) which is used for debug
603 ;----------------------------------------------------------------------
605 ; enable ETM clock if disabled
606 MRC p15, 7, r1, c15, c0, 5 ; RCP15_CPMR r1
607 ORR r1, r1, #0x00000008
608 MCR p15, 7, r1, c15, c0, 5 ; WCP15_CPMR r1
611 ; set trigger event to counter1 being zero
613 MCR p14, 1, r3, c0, c2, 0 ; WCP14_ETMTRIGGER r3
617 MCR p14, 1, r2, c0, c4, 0 ; WCP14_ETMSR r2
619 ; clear trace enable single address comparator usage
620 MCR p14, 1, r2, c0, c7, 0 ; WCP14_ETMTECR2 r2
622 ; set trace enable to always
624 MCR p14, 1, r2, c0, c8, 0 ; WCP14_ETMTEEVR r2
626 ; clear trace enable address range comparator usage and exclude nothing
628 MCR p14, 1, r2, c0, c9, 0 ; WCP14_ETMTECR1 r2
630 ; set view data to always
632 MCR p14, 1, r2, c0, c12, 0 ; WCP14_ETMVDEVR r2
634 ; clear view data single address comparator usage
636 MCR p14, 1, r2, c0, c13, 0 ; WCP14_ETMVDCR1 r2
638 ; clear view data address range comparator usage and exclude nothing
640 MCR p14, 1, r2, c0, c15, 0 ; WCP14_ETMVDCR3 r2
642 ; set counter1 to 194
644 MCR p14, 1, r2, c0, c0, 5 ; WCP14_ETMCNTRLDVR1 r2
646 ; set counter1 to never reload
648 MCR p14, 1, r2, c0, c8, 5 ; WCP14_ETMCNTRLDEVR1 r2
650 ; set counter1 to decrement every cycle
652 MCR p14, 1, r2, c0, c4, 5 ; WCP14_ETMCNTENR1 r2
654 ; Set trace synchronization frequency 1024 bytes
656 MCR p14, 1, r2, c0, c8, 7 ; WCP14_ETMSYNCFR r2
658 ; Program etm control register
659 ; - Set the CPU to ETM clock ratio to 1:1
660 ; - Set the ETM to perform data address tracing
662 MCR p14, 1, r2, c0, c0, 0 ; WCP14_ETMCR r2
664 #endif *//* APPSBL_ETM_ENABLE */
667 #ifdef APPSBL_VFP_ENABLE
668 ;----------------------------------------------------------------------
669 ; Perform the following operations if you intend to make use of
670 ; the VFP/Neon unit. Note that the FMXR instruction requires a CPU ID
671 ; indicating the VFP unit is present (i.e.Cortex-A8). .
672 ; Some tools will require full double precision floating point support
673 ; which will become available in Scorpion pass 2
674 ;----------------------------------------------------------------------
675 ; allow full access to CP 10 and 11 space for VFP/NEON use
676 MRC p15, 0, r1, c1, c0, 2 ; Read CP Access Control Register
677 ORR r1, r1, #0x00F00000 ; enable full access for p10,11
678 MCR p15, 0, r1, c1, c0, 2 ; Write CPACR
680 ;make sure the CPACR is complete before continuing
683 ; Enable VFP itself (certain OSes may want to dynamically set/clear
684 ; the enable bit based on the application being executed
687 #endif *//* APPSBL_VFP_ENABLE */