diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2010-02-04 13:37:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-15 16:39:55 -0500 |
commit | d309427e792ea750cdd312e7a92cf6047ae44962 (patch) | |
tree | fa179001f1c54db7800ba8b0faf0b3a6fff54f2b /arch | |
parent | 424d6b145f863d012c540082d0c1afb5bb4dea48 (diff) |
ARM: 5917/1: OMAP4: Add L2 Cache support
This patch adds L2 Cache support for OMAP4. External L2 cache
is used in OMAP4
CC: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 54 | ||||
-rw-r--r-- | arch/arm/mm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap44xx.h | 1 |
3 files changed, 56 insertions, 1 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 | ||
32 | static struct platform_device sdp4430_lcd_device = { | 33 | static 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 | ||
55 | noinline 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 | } | ||
78 | EXPORT_SYMBOL(omap_smc1); | ||
79 | |||
80 | static 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 | } | ||
104 | early_initcall(omap_l2_cache_init); | ||
105 | #endif | ||
106 | |||
53 | static void __init gic_init_irq(void) | 107 | static void __init gic_init_irq(void) |
54 | { | 108 | { |
55 | void __iomem *base; | 109 | void __iomem *base; |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 4c2e90dc549c..e859743024a0 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -754,7 +754,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
754 | config CACHE_L2X0 | 754 | config CACHE_L2X0 |
755 | bool "Enable the L2x0 outer cache controller" | 755 | bool "Enable the L2x0 outer cache controller" |
756 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | 756 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
757 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK | 757 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4 |
758 | default y | 758 | default y |
759 | select OUTER_CACHE | 759 | select OUTER_CACHE |
760 | help | 760 | help |
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h index ef870de43c29..c7d628ecb467 100644 --- a/arch/arm/plat-omap/include/plat/omap44xx.h +++ b/arch/arm/plat-omap/include/plat/omap44xx.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 | 40 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 |
41 | #define OMAP44XX_SCU_BASE 0x48240000 | 41 | #define OMAP44XX_SCU_BASE 0x48240000 |
42 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 | 42 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 |
43 | #define OMAP44XX_L2CACHE_BASE 0x48242000 | ||
43 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 | 44 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 |
44 | 45 | ||
45 | #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) | 46 | #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) |