]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / rmobile / lowlevel_init_ca15.S
1 /*
2  * arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
3  *     This file is lager low level initialize.
4  *
5  * Copyright (C) 2013 Renesas Electronics Corporation
6  *
7  * SPDX-License-Identifier: GPL-2.0
8  */
9
10 #include <config.h>
11 #include <linux/linkage.h>
12
13 ENTRY(lowlevel_init)
14         mrc     p15, 0, r4, c0, c0, 5 /* mpidr */
15         orr     r4, r4, r4, lsr #6
16         and     r4, r4, #7 /* id 0-3 = ca15.0,1,2,3 */
17
18         b do_lowlevel_init
19
20         .pool
21
22 /*
23  * CPU ID #1-#3 come here
24  */
25         .align  4
26 do_cpu_waiting:
27         ldr     r1, =0xe6180000 /* sysc */
28 1:      ldr     r0, [r1, #0x20] /* sbar */
29         tst     r0, r0
30         beq     1b
31         bx      r0
32
33 /*
34  * Only CPU ID #0 comes here
35  */
36         .align  4
37 do_lowlevel_init:
38         /* surpress wfe if ca15 */
39         tst     r4, #4
40         mrceq p15, 0, r0, c1, c0, 1     /* actlr */
41         orreq r0, r0, #(1<<7)
42         mcreq p15, 0, r0, c1, c0, 1
43         /* and set l2 latency */
44         mrceq p15, 1, r0, c9, c0, 2     /* l2ctlr */
45         orreq r0, r0, #0x00000800
46         orreq r0, r0, #0x00000003
47         mcreq p15, 1, r0, c9, c0, 2
48
49         ldr     r3, =(CONFIG_SYS_INIT_SP_ADDR)
50         sub     sp, r3, #4
51         str     lr, [sp]
52
53         /* initialize system */
54         bl s_init
55
56         ldr     lr, [sp]
57         mov     pc, lr
58         nop
59 ENDPROC(lowlevel_init)
60         .ltorg