blob: d0234296ae622b5f1745d9be7002d4705c3e4913 [file] [log] [blame]
Kuninori Morimotoe2f25942018-09-07 01:43:23 +00001/* SPDX-License-Identifier: GPL-2.0+
2 *
Magnus Dammec0d84a2013-02-13 22:47:07 +09003 * Shared SCU setup for mach-shmobile
4 *
5 * Copyright (C) 2012 Bastian Hecht
Magnus Dammec0d84a2013-02-13 22:47:07 +09006 */
7
8#include <linux/linkage.h>
9#include <linux/init.h>
10#include <asm/memory.h>
11
Magnus Dammec0d84a2013-02-13 22:47:07 +090012/*
Magnus Damm4f6da362013-06-10 18:20:25 +090013 * Boot code for secondary CPUs.
Magnus Dammec0d84a2013-02-13 22:47:07 +090014 *
15 * First we turn on L1 cache coherency for our CPU. Then we jump to
Russell King02b4e272015-05-19 17:06:44 +010016 * secondary_startup that invalidates the cache and hands over control
Magnus Dammec0d84a2013-02-13 22:47:07 +090017 * to the common ARM startup code.
Magnus Dammec0d84a2013-02-13 22:47:07 +090018 */
Magnus Dammbfabbcc2013-06-10 18:19:46 +090019ENTRY(shmobile_boot_scu)
20 @ r0 = SCU base address
Geert Uytterhoevene24f3172016-01-28 16:13:30 +010021 mrc p15, 0, r1, c0, c0, 5 @ read MPIDR
Magnus Dammbfabbcc2013-06-10 18:19:46 +090022 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 Kobayashibdea6c62013-07-10 10:56:35 +090026 lsl r3, r3, r1
27 bic r2, r2, r3 @ Clear bits of our CPU (Run Mode)
Magnus Dammbfabbcc2013-06-10 18:19:46 +090028 str r2, [r0, #8] @ write back
29
Russell King02b4e272015-05-19 17:06:44 +010030 b secondary_startup
Magnus Dammbfabbcc2013-06-10 18:19:46 +090031ENDPROC(shmobile_boot_scu)