ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+
[linux-2.6-block.git] / arch / arm / mach-shmobile / headsmp.S
CommitLineData
1c51ed4f
MD
1/*
2 * SMP support for R-Mobile / SH-Mobile
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2010 Takashi Yoshii
6 *
7 * Based on vexpress, Copyright (c) 2003 ARM Limited, All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/linkage.h>
14#include <linux/init.h>
6ebbf2ce 15#include <asm/assembler.h>
6155f77d 16#include <asm/memory.h>
1c51ed4f 17
e994d5eb
MD
18ENTRY(shmobile_invalidate_start)
19 bl v7_invalidate_l1
20 b secondary_startup
21ENDPROC(shmobile_invalidate_start)
22
1c51ed4f
MD
23/*
24 * Reset vector for secondary CPUs.
25 * This will be mapped at address 0 by SBAR register.
26 * We need _long_ jump to the physical address.
27 */
c1d7e2e8 28 .arm
1c51ed4f 29 .align 12
ebe72ab9
MD
30ENTRY(shmobile_boot_vector)
31 ldr r0, 2f
c1d7e2e8
TK
32 ldr r1, 1f
33 bx r1
34
ebe72ab9
MD
35ENDPROC(shmobile_boot_vector)
36
0b933cb3 37 .align 2
ebe72ab9
MD
38 .globl shmobile_boot_fn
39shmobile_boot_fn:
401: .space 4
41 .globl shmobile_boot_arg
42shmobile_boot_arg:
432: .space 4
a84a5ab7
MD
44 .globl shmobile_boot_size
45shmobile_boot_size:
46 .long . - shmobile_boot_vector
cc61591e
MD
47
48/*
49 * Per-CPU SMP boot function/argument selection code based on MPIDR
50 */
51
52ENTRY(shmobile_smp_boot)
53 @ r0 = MPIDR_HWID_BITMASK
54 mrc p15, 0, r1, c0, c0, 5 @ r1 = MPIDR
55 and r0, r1, r0 @ r0 = cpu_logical_map() value
56 mov r1, #0 @ r1 = CPU index
57 adr r5, 1f @ array of per-cpu mpidr values
58 adr r6, 2f @ array of per-cpu functions
59 adr r7, 3f @ array of per-cpu arguments
60
61shmobile_smp_boot_find_mpidr:
62 ldr r8, [r5, r1, lsl #2]
63 cmp r8, r0
64 bne shmobile_smp_boot_next
65
66 ldr r9, [r6, r1, lsl #2]
67 cmp r9, #0
68 bne shmobile_smp_boot_found
69
70shmobile_smp_boot_next:
71 add r1, r1, #1
72 cmp r1, #CONFIG_NR_CPUS
73 blo shmobile_smp_boot_find_mpidr
74
75 b shmobile_smp_sleep
76
77shmobile_smp_boot_found:
78 ldr r0, [r7, r1, lsl #2]
6ebbf2ce 79 ret r9
cc61591e
MD
80ENDPROC(shmobile_smp_boot)
81
82ENTRY(shmobile_smp_sleep)
83 wfi
84 b shmobile_smp_boot
85ENDPROC(shmobile_smp_sleep)
86
87 .globl shmobile_smp_mpidr
88shmobile_smp_mpidr:
891: .space CONFIG_NR_CPUS * 4
90 .globl shmobile_smp_fn
91shmobile_smp_fn:
922: .space CONFIG_NR_CPUS * 4
93 .globl shmobile_smp_arg
94shmobile_smp_arg:
953: .space CONFIG_NR_CPUS * 4