Kuninori Morimoto | e2f2594 | 2018-09-07 01:43:23 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ |
| 2 | * |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 3 | * Shared SCU setup for mach-shmobile |
| 4 | * |
| 5 | * Copyright (C) 2012 Bastian Hecht |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <linux/linkage.h> |
| 9 | #include <linux/init.h> |
| 10 | #include <asm/memory.h> |
| 11 | |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 12 | /* |
Magnus Damm | 4f6da36 | 2013-06-10 18:20:25 +0900 | [diff] [blame] | 13 | * Boot code for secondary CPUs. |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 14 | * |
| 15 | * First we turn on L1 cache coherency for our CPU. Then we jump to |
Russell King | 02b4e27 | 2015-05-19 17:06:44 +0100 | [diff] [blame] | 16 | * secondary_startup that invalidates the cache and hands over control |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 17 | * to the common ARM startup code. |
Magnus Damm | ec0d84a | 2013-02-13 22:47:07 +0900 | [diff] [blame] | 18 | */ |
Magnus Damm | bfabbcc | 2013-06-10 18:19:46 +0900 | [diff] [blame] | 19 | ENTRY(shmobile_boot_scu) |
| 20 | @ r0 = SCU base address |
Geert Uytterhoeven | e24f317 | 2016-01-28 16:13:30 +0100 | [diff] [blame] | 21 | mrc p15, 0, r1, c0, c0, 5 @ read MPIDR |
Magnus Damm | bfabbcc | 2013-06-10 18:19:46 +0900 | [diff] [blame] | 22 | and r1, r1, #3 @ mask out cpu ID |
| 23 | lsl r1, r1, #3 @ we will shift by cpu_id * 8 bits |
| 24 | ldr r2, [r0, #8] @ SCU Power Status Register |
| 25 | mov r3, #3 |
Tetsuyuki Kobayashi | bdea6c6 | 2013-07-10 10:56:35 +0900 | [diff] [blame] | 26 | lsl r3, r3, r1 |
| 27 | bic r2, r2, r3 @ Clear bits of our CPU (Run Mode) |
Magnus Damm | bfabbcc | 2013-06-10 18:19:46 +0900 | [diff] [blame] | 28 | str r2, [r0, #8] @ write back |
| 29 | |
Russell King | 02b4e27 | 2015-05-19 17:06:44 +0100 | [diff] [blame] | 30 | b secondary_startup |
Magnus Damm | bfabbcc | 2013-06-10 18:19:46 +0900 | [diff] [blame] | 31 | ENDPROC(shmobile_boot_scu) |