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 029c6c9b3a6d..180ac112e527 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
34static struct platform_device sdp4430_lcd_device = { 35static 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
53noinline 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}
76EXPORT_SYMBOL(omap_smc1);
77
78static 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}
102early_initcall(omap_l2_cache_init);
103#endif
104
51static void __init gic_init_irq(void) 105static void __init gic_init_irq(void)
52{ 106{
53 void __iomem *base; 107 void __iomem *base;