^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Shared SCU setup for mach-shmobile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2012 Bastian Hecht
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/memory.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * Boot code for secondary CPUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * First we turn on L1 cache coherency for our CPU. Then we jump to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * secondary_startup that invalidates the cache and hands over control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * to the common ARM startup code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) ENTRY(shmobile_boot_scu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) @ r0 = SCU base address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) mrc p15, 0, r1, c0, c0, 5 @ read MPIDR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) and r1, r1, #3 @ mask out cpu ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) lsl r1, r1, #3 @ we will shift by cpu_id * 8 bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) ldr r2, [r0, #8] @ SCU Power Status Register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) mov r3, #3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) lsl r3, r3, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) bic r2, r2, r3 @ Clear bits of our CPU (Run Mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) str r2, [r0, #8] @ write back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) b secondary_startup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) ENDPROC(shmobile_boot_scu)