aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-4430sdp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c54
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 0c6be6b4a7e2..8ba8fb5b2514 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -28,6 +28,7 @@
28#include <plat/control.h> 28#include <plat/control.h>
29#include <plat/timer-gp.h> 29#include <plat/timer-gp.h>
30#include <asm/hardware/gic.h> 30#include <asm/hardware/gic.h>
31#include <asm/hardware/cache-l2x0.h>
31 32
32static struct platform_device sdp4430_lcd_device = { 33static struct platform_device sdp4430_lcd_device = {
33 .name = "sdp4430_lcd", 34 .name = "sdp4430_lcd",
@@ -50,6 +51,59 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
50 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 51 { OMAP_TAG_LCD, &sdp4430_lcd_config },
51}; 52};
52 53
54#ifdef CONFIG_CACHE_L2X0
55noinline void omap_smc1(u32 fn, u32 arg)
56{
57 register u32 r12 asm("r12") = fn;
58 register u32 r0 asm("r0") = arg;
59
60 /* This is common routine cache secure monitor API used to
61 * modify the PL310 secure registers.
62 * r0 contains the value to be modified and "r12" contains
63 * the monitor API number. It uses few CPU registers
64 * internally and hence they need be backed up including
65 * link register "lr".
66 * Explicitly save r11 and r12 the compiler generated code
67 * won't save it.
68 */
69 asm volatile(
70 "stmfd r13!, {r11,r12}\n"
71 "dsb\n"
72 "smc\n"
73 "ldmfd r13!, {r11,r12}\n"
74 : "+r" (r0), "+r" (r12)
75 :
76 : "r4", "r5", "r10", "lr", "cc");
77}
78EXPORT_SYMBOL(omap_smc1);
79
80static int __init omap_l2_cache_init(void)
81{
82 void __iomem *l2cache_base;
83
84 /* To avoid code running on other OMAPs in
85 * multi-omap builds
86 */
87 if (!cpu_is_omap44xx())
88 return -ENODEV;
89
90 /* Static mapping, never released */
91 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
92 BUG_ON(!l2cache_base);
93
94 /* Enable PL310 L2 Cache controller */
95 omap_smc1(0x102, 0x1);
96
97 /* 32KB way size, 16-way associativity,
98 * parity disabled
99 */
100 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
101
102 return 0;
103}
104early_initcall(omap_l2_cache_init);
105#endif
106
53static void __init gic_init_irq(void) 107static void __init gic_init_irq(void)
54{ 108{
55 void __iomem *base; 109 void __iomem *base;