aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2006-12-07 16:58:10 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-08 15:36:31 -0400
commitc40fae9525e6c29c87a4f4361ff0a8d67a36e448 (patch)
tree00c3e0008b3e963c5a622245b951f1135e456c24 /arch/arm/mach-omap2
parentf4e4c324a5f81f18156499d1ade3732ba1f5b523 (diff)
ARM: OMAP: Sync core code with linux-omap
This patch syncs omap specific core code with linux-omap. Most of the changes are needed to fix bitrot caused by driver updates in linux-omap tree. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/devices.c60
-rw-r--r--arch/arm/mach-omap2/gpmc.c12
-rw-r--r--arch/arm/mach-omap2/io.c18
4 files changed, 81 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 2a1aca7a6371..7393109f5c30 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -9,6 +9,7 @@ config ARCH_OMAP2420
9 bool "OMAP2420 support" 9 bool "OMAP2420 support"
10 depends on ARCH_OMAP24XX 10 depends on ARCH_OMAP24XX
11 select OMAP_DM_TIMER 11 select OMAP_DM_TIMER
12 select ARCH_OMAP_OTG
12 13
13comment "OMAP Board Type" 14comment "OMAP Board Type"
14 depends on ARCH_OMAP2 15 depends on ARCH_OMAP2
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index aa4322451e8b..b3ac9622f4a7 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -66,6 +66,40 @@ static void omap_init_i2c(void) {}
66 66
67#endif 67#endif
68 68
69#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
70#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
71
72static struct resource mbox_resources[] = {
73 {
74 .start = OMAP2_MBOX_BASE,
75 .end = OMAP2_MBOX_BASE + 0x11f,
76 .flags = IORESOURCE_MEM,
77 },
78 {
79 .start = INT_24XX_MAIL_U0_MPU,
80 .flags = IORESOURCE_IRQ,
81 },
82 {
83 .start = INT_24XX_MAIL_U3_MPU,
84 .flags = IORESOURCE_IRQ,
85 },
86};
87
88static struct platform_device mbox_device = {
89 .name = "mailbox",
90 .id = -1,
91 .num_resources = ARRAY_SIZE(mbox_resources),
92 .resource = mbox_resources,
93};
94
95static inline void omap_init_mbox(void)
96{
97 platform_device_register(&mbox_device);
98}
99#else
100static inline void omap_init_mbox(void) { }
101#endif
102
69#if defined(CONFIG_OMAP_STI) 103#if defined(CONFIG_OMAP_STI)
70 104
71#define OMAP2_STI_BASE IO_ADDRESS(0x48068000) 105#define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
@@ -111,29 +145,45 @@ static inline void omap_init_sti(void) {}
111#define OMAP2_MCSPI1_BASE 0x48098000 145#define OMAP2_MCSPI1_BASE 0x48098000
112#define OMAP2_MCSPI2_BASE 0x4809a000 146#define OMAP2_MCSPI2_BASE 0x4809a000
113 147
114/* FIXME: use resources instead */
115
116static struct omap2_mcspi_platform_config omap2_mcspi1_config = { 148static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
117 .base = io_p2v(OMAP2_MCSPI1_BASE),
118 .num_cs = 4, 149 .num_cs = 4,
119}; 150};
120 151
152static struct resource omap2_mcspi1_resources[] = {
153 {
154 .start = OMAP2_MCSPI1_BASE,
155 .end = OMAP2_MCSPI1_BASE + 0xff,
156 .flags = IORESOURCE_MEM,
157 },
158};
159
121struct platform_device omap2_mcspi1 = { 160struct platform_device omap2_mcspi1 = {
122 .name = "omap2_mcspi", 161 .name = "omap2_mcspi",
123 .id = 1, 162 .id = 1,
163 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
164 .resource = omap2_mcspi1_resources,
124 .dev = { 165 .dev = {
125 .platform_data = &omap2_mcspi1_config, 166 .platform_data = &omap2_mcspi1_config,
126 }, 167 },
127}; 168};
128 169
129static struct omap2_mcspi_platform_config omap2_mcspi2_config = { 170static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
130 .base = io_p2v(OMAP2_MCSPI2_BASE),
131 .num_cs = 2, 171 .num_cs = 2,
132}; 172};
133 173
174static struct resource omap2_mcspi2_resources[] = {
175 {
176 .start = OMAP2_MCSPI2_BASE,
177 .end = OMAP2_MCSPI2_BASE + 0xff,
178 .flags = IORESOURCE_MEM,
179 },
180};
181
134struct platform_device omap2_mcspi2 = { 182struct platform_device omap2_mcspi2 = {
135 .name = "omap2_mcspi", 183 .name = "omap2_mcspi",
136 .id = 2, 184 .id = 2,
185 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
186 .resource = omap2_mcspi2_resources,
137 .dev = { 187 .dev = {
138 .platform_data = &omap2_mcspi2_config, 188 .platform_data = &omap2_mcspi2_config,
139 }, 189 },
@@ -157,10 +207,10 @@ static int __init omap2_init_devices(void)
157 * in alphabetical order so they're easier to sort through. 207 * in alphabetical order so they're easier to sort through.
158 */ 208 */
159 omap_init_i2c(); 209 omap_init_i2c();
210 omap_init_mbox();
160 omap_init_mcspi(); 211 omap_init_mcspi();
161 omap_init_sti(); 212 omap_init_sti();
162 213
163 return 0; 214 return 0;
164} 215}
165arch_initcall(omap2_init_devices); 216arch_initcall(omap2_init_devices);
166
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index d8f57824423f..54c836a98456 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -246,14 +246,22 @@ static int gpmc_cs_mem_enabled(int cs)
246 return l & (1 << 6); 246 return l & (1 << 6);
247} 247}
248 248
249static void gpmc_cs_set_reserved(int cs, int reserved) 249int gpmc_cs_set_reserved(int cs, int reserved)
250{ 250{
251 if (cs > GPMC_CS_NUM)
252 return -ENODEV;
253
251 gpmc_cs_map &= ~(1 << cs); 254 gpmc_cs_map &= ~(1 << cs);
252 gpmc_cs_map |= (reserved ? 1 : 0) << cs; 255 gpmc_cs_map |= (reserved ? 1 : 0) << cs;
256
257 return 0;
253} 258}
254 259
255static int gpmc_cs_reserved(int cs) 260int gpmc_cs_reserved(int cs)
256{ 261{
262 if (cs > GPMC_CS_NUM)
263 return -ENODEV;
264
257 return gpmc_cs_map & (1 << cs); 265 return gpmc_cs_map & (1 << cs);
258} 266}
259 267
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a0728c33e5d9..59458642e9eb 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -40,9 +40,21 @@ static struct map_desc omap2_io_desc[] __initdata = {
40 .type = MT_DEVICE 40 .type = MT_DEVICE
41 }, 41 },
42 { 42 {
43 .virtual = L4_24XX_VIRT, 43 .virtual = DSP_MEM_24XX_VIRT,
44 .pfn = __phys_to_pfn(L4_24XX_PHYS), 44 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
45 .length = L4_24XX_SIZE, 45 .length = DSP_MEM_24XX_SIZE,
46 .type = MT_DEVICE
47 },
48 {
49 .virtual = DSP_IPI_24XX_VIRT,
50 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
51 .length = DSP_IPI_24XX_SIZE,
52 .type = MT_DEVICE
53 },
54 {
55 .virtual = DSP_MMU_24XX_VIRT,
56 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
57 .length = DSP_MMU_24XX_SIZE,
46 .type = MT_DEVICE 58 .type = MT_DEVICE
47 } 59 }
48}; 60};