diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2010-03-11 02:33:46 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-03-11 12:38:53 -0500 |
commit | d660f9a26ef81c3bbced92514ffbe82e1b882ee1 (patch) | |
tree | 17997ef37df0ff3a0274b705d5d079531bc601d0 /arch/arm/mach-omap2 | |
parent | 6f69a1815a93722b360a1439934856e766509002 (diff) |
omap4: Fix build break by moving omap_smc1 into a separate .S
This patch moves omap_smc1 function to a seperate omap44xx-smc.S file
and sets compile flags as -Wa,-march=armv7-a.
This fix was suggested by Tony Lindgren <tony@atomide.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[tony@atomide.com: otherwise multi-omap build with V6 and V7 breaks]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap44xx-smc.S | 32 |
3 files changed, 36 insertions, 25 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 2069fb33baaa..4b9fc57770db 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -22,6 +22,9 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | |||
22 | # SMP support ONLY available for OMAP4 | 22 | # SMP support ONLY available for OMAP4 |
23 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o | 23 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o |
24 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o | 24 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o |
25 | obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o | ||
26 | |||
27 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a | ||
25 | 28 | ||
26 | # Functions loaded to SRAM | 29 | # Functions loaded to SRAM |
27 | obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | 30 | obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 180ac112e527..b88f28c5814b 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -50,33 +50,9 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
50 | }; | 50 | }; |
51 | 51 | ||
52 | #ifdef CONFIG_CACHE_L2X0 | 52 | #ifdef CONFIG_CACHE_L2X0 |
53 | noinline void omap_smc1(u32 fn, u32 arg) | ||
54 | { | ||
55 | register u32 r12 asm("r12") = fn; | ||
56 | register u32 r0 asm("r0") = arg; | ||
57 | |||
58 | /* This is common routine cache secure monitor API used to | ||
59 | * modify the PL310 secure registers. | ||
60 | * r0 contains the value to be modified and "r12" contains | ||
61 | * the monitor API number. It uses few CPU registers | ||
62 | * internally and hence they need be backed up including | ||
63 | * link register "lr". | ||
64 | * Explicitly save r11 and r12 the compiler generated code | ||
65 | * won't save it. | ||
66 | */ | ||
67 | asm volatile( | ||
68 | "stmfd r13!, {r11,r12}\n" | ||
69 | "dsb\n" | ||
70 | "smc\n" | ||
71 | "ldmfd r13!, {r11,r12}\n" | ||
72 | : "+r" (r0), "+r" (r12) | ||
73 | : | ||
74 | : "r4", "r5", "r10", "lr", "cc"); | ||
75 | } | ||
76 | EXPORT_SYMBOL(omap_smc1); | ||
77 | |||
78 | static int __init omap_l2_cache_init(void) | 53 | static int __init omap_l2_cache_init(void) |
79 | { | 54 | { |
55 | extern void omap_smc1(u32 fn, u32 arg); | ||
80 | void __iomem *l2cache_base; | 56 | void __iomem *l2cache_base; |
81 | 57 | ||
82 | /* To avoid code running on other OMAPs in | 58 | /* To avoid code running on other OMAPs in |
diff --git a/arch/arm/mach-omap2/omap44xx-smc.S b/arch/arm/mach-omap2/omap44xx-smc.S new file mode 100644 index 000000000000..89bb2b141473 --- /dev/null +++ b/arch/arm/mach-omap2/omap44xx-smc.S | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * OMAP44xx secure APIs file. | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Written by Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
6 | * | ||
7 | * | ||
8 | * This program is free software,you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/linkage.h> | ||
14 | |||
15 | /* | ||
16 | * This is common routine to manage secure monitor API | ||
17 | * used to modify the PL310 secure registers. | ||
18 | * 'r0' contains the value to be modified and 'r12' contains | ||
19 | * the monitor API number. It uses few CPU registers | ||
20 | * internally and hence they need be backed up including | ||
21 | * link register "lr". | ||
22 | * Function signature : void omap_smc1(u32 fn, u32 arg) | ||
23 | */ | ||
24 | |||
25 | ENTRY(omap_smc1) | ||
26 | stmfd sp!, {r2-r12, lr} | ||
27 | mov r12, r0 | ||
28 | mov r0, r1 | ||
29 | dsb | ||
30 | smc | ||
31 | ldmfd sp!, {r2-r12, pc} | ||
32 | END(omap_smc1) | ||