aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2010-05-14 15:05:26 -0400
committerTony Lindgren <tony@atomide.com>2010-05-20 14:17:51 -0400
commitfbc9be106e9f27450ea999da74bc24fad04cf41d (patch)
tree6d3d7dae1c657a9b5343ecf177ea968c939622b6 /arch
parent2e5f51a539194406566968d1b68f0bcd1112720d (diff)
omap4: Move SOC specific code from board file
This patch moves OMAP4 soc specific code from 4430sdp board file. The change is necessary so that newer board support can be added with minimal changes. This will be also problematic for multi-board, multi-omap builds. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/Makefile2
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c47
-rw-r--r--arch/arm/mach-omap2/include/mach/omap4-common.h26
-rw-r--r--arch/arm/mach-omap2/omap-smp.c2
-rw-r--r--arch/arm/mach-omap2/omap4-common.c72
-rw-r--r--arch/arm/plat-omap/common.c3
-rw-r--r--arch/arm/plat-omap/include/plat/common.h3
7 files changed, 101 insertions, 54 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 7d2cf0f714c0..203a414c3341 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
22# SMP support ONLY available for OMAP4 22# SMP support ONLY available for OMAP4
23obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o 23obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
24obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o 24obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
25obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o 25obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o
26 26
27AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a 27AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a
28 28
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index be7a7868d210..6cce6f229799 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -21,6 +21,7 @@
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/omap4-common.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
@@ -30,8 +31,6 @@
30#include <plat/control.h> 31#include <plat/control.h>
31#include <plat/timer-gp.h> 32#include <plat/timer-gp.h>
32#include <plat/usb.h> 33#include <plat/usb.h>
33#include <asm/hardware/gic.h>
34#include <asm/hardware/cache-l2x0.h>
35 34
36#define ETH_KS8851_IRQ 34 35#define ETH_KS8851_IRQ 34
37#define ETH_KS8851_POWER_ON 48 36#define ETH_KS8851_POWER_ON 48
@@ -119,50 +118,6 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
119 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 118 { OMAP_TAG_LCD, &sdp4430_lcd_config },
120}; 119};
121 120
122#ifdef CONFIG_CACHE_L2X0
123static int __init omap_l2_cache_init(void)
124{
125 extern void omap_smc1(u32 fn, u32 arg);
126 void __iomem *l2cache_base;
127
128 /* To avoid code running on other OMAPs in
129 * multi-omap builds
130 */
131 if (!cpu_is_omap44xx())
132 return -ENODEV;
133
134 /* Static mapping, never released */
135 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
136 BUG_ON(!l2cache_base);
137
138 /* Enable PL310 L2 Cache controller */
139 omap_smc1(0x102, 0x1);
140
141 /* 32KB way size, 16-way associativity,
142 * parity disabled
143 */
144 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
145
146 return 0;
147}
148early_initcall(omap_l2_cache_init);
149#endif
150
151static void __init gic_init_irq(void)
152{
153 void __iomem *base;
154
155 /* Static mapping, never released */
156 base = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
157 BUG_ON(!base);
158 gic_dist_init(0, base, 29);
159
160 /* Static mapping, never released */
161 gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
162 BUG_ON(!gic_cpu_base_addr);
163 gic_cpu_init(0, gic_cpu_base_addr);
164}
165
166static void __init omap_4430sdp_init_irq(void) 121static void __init omap_4430sdp_init_irq(void)
167{ 122{
168 omap_board_config = sdp4430_config; 123 omap_board_config = sdp4430_config;
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h
new file mode 100644
index 000000000000..423af3a6dd31
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -0,0 +1,26 @@
1/*
2 * omap4-common.h: OMAP4 specific common header file
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 *
6 * Author:
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef OMAP_ARCH_OMAP4_COMMON_H
14#define OMAP_ARCH_OMAP4_COMMON_H
15
16#ifdef CONFIG_CACHE_L2X0
17extern void __iomem *l2cache_base;
18#endif
19
20extern void __iomem *gic_cpu_base_addr;
21extern void __iomem *gic_dist_base_addr;
22
23extern void __init gic_init_irq(void);
24extern void omap_smc1(u32 fn, u32 arg);
25
26#endif
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 38153e5fbca0..1cf52313759e 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -24,7 +24,7 @@
24#include <asm/localtimer.h> 24#include <asm/localtimer.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <plat/common.h> 27#include <mach/omap4-common.h>
28 28
29/* SCU base address */ 29/* SCU base address */
30static void __iomem *scu_base; 30static void __iomem *scu_base;
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
new file mode 100644
index 000000000000..13dc9794dcc2
--- /dev/null
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -0,0 +1,72 @@
1/*
2 * OMAP4 specific common source file.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Author:
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 *
8 *
9 * This program is free software,you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <linux/platform_device.h>
18
19#include <asm/hardware/gic.h>
20#include <asm/hardware/cache-l2x0.h>
21
22#include <mach/hardware.h>
23#include <mach/omap4-common.h>
24
25#ifdef CONFIG_CACHE_L2X0
26void __iomem *l2cache_base;
27#endif
28
29void __iomem *gic_cpu_base_addr;
30void __iomem *gic_dist_base_addr;
31
32
33void __init gic_init_irq(void)
34{
35 /* Static mapping, never released */
36 gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
37 BUG_ON(!gic_dist_base_addr);
38 gic_dist_init(0, gic_dist_base_addr, 29);
39
40 /* Static mapping, never released */
41 gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
42 BUG_ON(!gic_cpu_base_addr);
43 gic_cpu_init(0, gic_cpu_base_addr);
44}
45
46#ifdef CONFIG_CACHE_L2X0
47static int __init omap_l2_cache_init(void)
48{
49 /*
50 * To avoid code running on other OMAPs in
51 * multi-omap builds
52 */
53 if (!cpu_is_omap44xx())
54 return -ENODEV;
55
56 /* Static mapping, never released */
57 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
58 BUG_ON(!l2cache_base);
59
60 /* Enable PL310 L2 Cache controller */
61 omap_smc1(0x102, 0x1);
62
63 /*
64 * 32KB way size, 16-way associativity,
65 * parity disabled
66 */
67 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
68
69 return 0;
70}
71early_initcall(omap_l2_cache_init);
72#endif
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index f12f0e39ddf2..219c01e82bc5 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -47,9 +47,6 @@
47struct omap_board_config_kernel *omap_board_config; 47struct omap_board_config_kernel *omap_board_config;
48int omap_board_config_size; 48int omap_board_config_size;
49 49
50/* used by omap-smp.c and board-4430sdp.c */
51void __iomem *gic_cpu_base_addr;
52
53static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) 50static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
54{ 51{
55 struct omap_board_config_kernel *kinfo = NULL; 52 struct omap_board_config_kernel *kinfo = NULL;
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 7556e271942e..d265018f5e6b 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -31,9 +31,6 @@
31 31
32struct sys_timer; 32struct sys_timer;
33 33
34/* used by omap-smp.c and board-4430sdp.c */
35extern void __iomem *gic_cpu_base_addr;
36
37extern void omap_map_common_io(void); 34extern void omap_map_common_io(void);
38extern struct sys_timer omap_timer; 35extern struct sys_timer omap_timer;
39 36