2 * Copyright (c) 2016, Wind River Systems.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
29 * Entry points for the A9 inits, A9 revision specific or not.
30 * It is assume no stack is available when these routines are called.
31 * It is assume each routine is called with return address in LR
32 * and with ARM registers R0, R1, R2, R3 being scratchable.
36 #include <arm32_macros.S>
38 #include <kernel/unwind.h>
39 #include <platform_config.h>
46 * platform early configuration
48 * Use scratables registers R0-R3.
50 * LR store return address.
51 * Trap CPU in case of error.
53 FUNC plat_cpu_reset_early , :
57 * Disallow NSec to mask FIQ [bit4: FW=0]
58 * Allow NSec to manage Imprecise Abort [bit5: AW=1]
59 * Imprecise Abort trapped to Abort Mode [bit3: EA=0]
60 * In Sec world, FIQ trapped to FIQ Mode [bit2: FIQ=0]
61 * IRQ always trapped to IRQ Mode [bit1: IRQ=0]
62 * Secure World [bit0: NS=0]
65 write_scr r0 /* write Secure Configuration Register */
68 * Mandated HW config loaded
73 * - core NOT booted in full SMP (FW bit0=0)
76 * - NSec cannot change ACTRL.SMP (NS_SMP bit18=0)
77 * - NSec can use SIMD/VFP (CP10/CP11) (bit15:14=2b00, bit11:10=2b11)
79 mov_imm r0, 0x00000000
82 mov_imm r0, 0x00000040
85 mov_imm r0, 0x00000C00
90 END_FUNC plat_cpu_reset_early