diff options
author | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
commit | d702d12167a2c05a346f49aac7a311d597762495 (patch) | |
tree | baae42c299cce34d6df24b5d01f8b1d0b481bd9a /arch/arm/mach-omap2/board-4430sdp.c | |
parent | 9418c65f9bd861d0f7e39aab9cfb3aa6f2275d11 (diff) | |
parent | ac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (diff) |
Merge with mainline to remove plat-omap/Kconfig conflict
Conflicts:
arch/arm/plat-omap/Kconfig
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 029c6c9b3a6..180ac112e52 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <plat/timer-gp.h> | 30 | #include <plat/timer-gp.h> |
31 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | #include <asm/hardware/gic.h> | 32 | #include <asm/hardware/gic.h> |
33 | #include <asm/hardware/cache-l2x0.h> | ||
33 | 34 | ||
34 | static struct platform_device sdp4430_lcd_device = { | 35 | static struct platform_device sdp4430_lcd_device = { |
35 | .name = "sdp4430_lcd", | 36 | .name = "sdp4430_lcd", |
@@ -48,6 +49,59 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
48 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, | 49 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, |
49 | }; | 50 | }; |
50 | 51 | ||
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) | ||
79 | { | ||
80 | void __iomem *l2cache_base; | ||
81 | |||
82 | /* To avoid code running on other OMAPs in | ||
83 | * multi-omap builds | ||
84 | */ | ||
85 | if (!cpu_is_omap44xx()) | ||
86 | return -ENODEV; | ||
87 | |||
88 | /* Static mapping, never released */ | ||
89 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); | ||
90 | BUG_ON(!l2cache_base); | ||
91 | |||
92 | /* Enable PL310 L2 Cache controller */ | ||
93 | omap_smc1(0x102, 0x1); | ||
94 | |||
95 | /* 32KB way size, 16-way associativity, | ||
96 | * parity disabled | ||
97 | */ | ||
98 | l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff); | ||
99 | |||
100 | return 0; | ||
101 | } | ||
102 | early_initcall(omap_l2_cache_init); | ||
103 | #endif | ||
104 | |||
51 | static void __init gic_init_irq(void) | 105 | static void __init gic_init_irq(void) |
52 | { | 106 | { |
53 | void __iomem *base; | 107 | void __iomem *base; |