Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/devices.c |
| 3 | * |
| 4 | * OMAP2 platform device setup/initialization |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 12 | #include <linux/module.h> |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 16 | #include <linux/io.h> |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 17 | #include <linux/clk.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 18 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | #include <mach/hardware.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 20 | #include <asm/mach-types.h> |
| 21 | #include <asm/mach/map.h> |
| 22 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 23 | #include <plat/control.h> |
| 24 | #include <plat/tc.h> |
| 25 | #include <plat/board.h> |
| 26 | #include <plat/mux.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 27 | #include <mach/gpio.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 28 | #include <plat/mmc.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 29 | |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 30 | #include "mux.h" |
| 31 | |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 32 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 33 | |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 34 | static struct resource cam_resources[] = { |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 35 | { |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 36 | .start = OMAP24XX_CAMERA_BASE, |
| 37 | .end = OMAP24XX_CAMERA_BASE + 0xfff, |
| 38 | .flags = IORESOURCE_MEM, |
| 39 | }, |
| 40 | { |
| 41 | .start = INT_24XX_CAM_IRQ, |
| 42 | .flags = IORESOURCE_IRQ, |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | static struct platform_device omap_cam_device = { |
| 47 | .name = "omap24xxcam", |
| 48 | .id = -1, |
| 49 | .num_resources = ARRAY_SIZE(cam_resources), |
| 50 | .resource = cam_resources, |
| 51 | }; |
| 52 | |
| 53 | static inline void omap_init_camera(void) |
| 54 | { |
| 55 | platform_device_register(&omap_cam_device); |
| 56 | } |
| 57 | |
| 58 | #elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) |
| 59 | |
| 60 | static struct resource omap3isp_resources[] = { |
| 61 | { |
| 62 | .start = OMAP3430_ISP_BASE, |
| 63 | .end = OMAP3430_ISP_END, |
| 64 | .flags = IORESOURCE_MEM, |
| 65 | }, |
| 66 | { |
| 67 | .start = OMAP3430_ISP_CBUFF_BASE, |
| 68 | .end = OMAP3430_ISP_CBUFF_END, |
| 69 | .flags = IORESOURCE_MEM, |
| 70 | }, |
| 71 | { |
| 72 | .start = OMAP3430_ISP_CCP2_BASE, |
| 73 | .end = OMAP3430_ISP_CCP2_END, |
| 74 | .flags = IORESOURCE_MEM, |
| 75 | }, |
| 76 | { |
| 77 | .start = OMAP3430_ISP_CCDC_BASE, |
| 78 | .end = OMAP3430_ISP_CCDC_END, |
| 79 | .flags = IORESOURCE_MEM, |
| 80 | }, |
| 81 | { |
| 82 | .start = OMAP3430_ISP_HIST_BASE, |
| 83 | .end = OMAP3430_ISP_HIST_END, |
| 84 | .flags = IORESOURCE_MEM, |
| 85 | }, |
| 86 | { |
| 87 | .start = OMAP3430_ISP_H3A_BASE, |
| 88 | .end = OMAP3430_ISP_H3A_END, |
| 89 | .flags = IORESOURCE_MEM, |
| 90 | }, |
| 91 | { |
| 92 | .start = OMAP3430_ISP_PREV_BASE, |
| 93 | .end = OMAP3430_ISP_PREV_END, |
| 94 | .flags = IORESOURCE_MEM, |
| 95 | }, |
| 96 | { |
| 97 | .start = OMAP3430_ISP_RESZ_BASE, |
| 98 | .end = OMAP3430_ISP_RESZ_END, |
| 99 | .flags = IORESOURCE_MEM, |
| 100 | }, |
| 101 | { |
| 102 | .start = OMAP3430_ISP_SBL_BASE, |
| 103 | .end = OMAP3430_ISP_SBL_END, |
| 104 | .flags = IORESOURCE_MEM, |
| 105 | }, |
| 106 | { |
| 107 | .start = OMAP3430_ISP_CSI2A_BASE, |
| 108 | .end = OMAP3430_ISP_CSI2A_END, |
| 109 | .flags = IORESOURCE_MEM, |
| 110 | }, |
| 111 | { |
| 112 | .start = OMAP3430_ISP_CSI2PHY_BASE, |
| 113 | .end = OMAP3430_ISP_CSI2PHY_END, |
| 114 | .flags = IORESOURCE_MEM, |
| 115 | }, |
| 116 | { |
| 117 | .start = INT_34XX_CAM_IRQ, |
| 118 | .flags = IORESOURCE_IRQ, |
| 119 | } |
| 120 | }; |
| 121 | |
| 122 | static struct platform_device omap3isp_device = { |
| 123 | .name = "omap3isp", |
| 124 | .id = -1, |
| 125 | .num_resources = ARRAY_SIZE(omap3isp_resources), |
| 126 | .resource = omap3isp_resources, |
| 127 | }; |
| 128 | |
| 129 | static inline void omap_init_camera(void) |
| 130 | { |
| 131 | platform_device_register(&omap3isp_device); |
| 132 | } |
| 133 | #else |
| 134 | static inline void omap_init_camera(void) |
| 135 | { |
| 136 | } |
| 137 | #endif |
| 138 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 139 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 140 | |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 141 | #define MBOX_REG_SIZE 0x120 |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 142 | |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 143 | #ifdef CONFIG_ARCH_OMAP2 |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 144 | static struct resource omap2_mbox_resources[] = { |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 145 | { |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 146 | .start = OMAP24XX_MAILBOX_BASE, |
| 147 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 148 | .flags = IORESOURCE_MEM, |
| 149 | }, |
| 150 | { |
| 151 | .start = INT_24XX_MAIL_U0_MPU, |
| 152 | .flags = IORESOURCE_IRQ, |
| 153 | }, |
| 154 | { |
| 155 | .start = INT_24XX_MAIL_U3_MPU, |
| 156 | .flags = IORESOURCE_IRQ, |
| 157 | }, |
| 158 | }; |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 159 | static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources); |
| 160 | #else |
| 161 | #define omap2_mbox_resources NULL |
| 162 | #define omap2_mbox_resources_sz 0 |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 163 | #endif |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 164 | |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 165 | #ifdef CONFIG_ARCH_OMAP3 |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 166 | static struct resource omap3_mbox_resources[] = { |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 167 | { |
| 168 | .start = OMAP34XX_MAILBOX_BASE, |
| 169 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, |
| 170 | .flags = IORESOURCE_MEM, |
| 171 | }, |
| 172 | { |
| 173 | .start = INT_24XX_MAIL_U0_MPU, |
| 174 | .flags = IORESOURCE_IRQ, |
| 175 | }, |
| 176 | }; |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 177 | static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); |
| 178 | #else |
| 179 | #define omap3_mbox_resources NULL |
| 180 | #define omap3_mbox_resources_sz 0 |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 181 | #endif |
| 182 | |
| 183 | #ifdef CONFIG_ARCH_OMAP4 |
| 184 | |
| 185 | #define OMAP4_MBOX_REG_SIZE 0x130 |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 186 | static struct resource omap4_mbox_resources[] = { |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 187 | { |
| 188 | .start = OMAP44XX_MAILBOX_BASE, |
| 189 | .end = OMAP44XX_MAILBOX_BASE + |
| 190 | OMAP4_MBOX_REG_SIZE - 1, |
| 191 | .flags = IORESOURCE_MEM, |
| 192 | }, |
| 193 | { |
| 194 | .start = INT_44XX_MAIL_U0_MPU, |
| 195 | .flags = IORESOURCE_IRQ, |
| 196 | }, |
| 197 | }; |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 198 | static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources); |
| 199 | #else |
| 200 | #define omap4_mbox_resources NULL |
| 201 | #define omap4_mbox_resources_sz 0 |
C A Subramaniam | 454bf34 | 2009-11-22 10:11:18 -0800 | [diff] [blame] | 202 | #endif |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 203 | |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 204 | static struct platform_device mbox_device = { |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame] | 205 | .name = "omap2-mailbox", |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 206 | .id = -1, |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 207 | }; |
| 208 | |
| 209 | static inline void omap_init_mbox(void) |
| 210 | { |
Tony Lindgren | d10f2b6 | 2010-02-12 12:26:47 -0800 | [diff] [blame^] | 211 | if (cpu_is_omap24xx()) { |
| 212 | mbox_device.resource = omap2_mbox_resources; |
| 213 | mbox_device.num_resources = omap2_mbox_resources_sz; |
| 214 | } else if (cpu_is_omap34xx()) { |
| 215 | mbox_device.resource = omap3_mbox_resources; |
| 216 | mbox_device.num_resources = omap3_mbox_resources_sz; |
| 217 | } else if (cpu_is_omap44xx()) { |
| 218 | mbox_device.resource = omap4_mbox_resources; |
| 219 | mbox_device.num_resources = omap4_mbox_resources_sz; |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 220 | } else { |
| 221 | pr_err("%s: platform not supported\n", __func__); |
| 222 | return; |
| 223 | } |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 224 | platform_device_register(&mbox_device); |
| 225 | } |
| 226 | #else |
| 227 | static inline void omap_init_mbox(void) { } |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 228 | #endif /* CONFIG_OMAP_MBOX_FWK */ |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 229 | |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 230 | #if defined(CONFIG_OMAP_STI) |
| 231 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 232 | #if defined(CONFIG_ARCH_OMAP2) |
| 233 | |
| 234 | #define OMAP2_STI_BASE 0x48068000 |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 235 | #define OMAP2_STI_CHANNEL_BASE 0x54000000 |
| 236 | #define OMAP2_STI_IRQ 4 |
| 237 | |
| 238 | static struct resource sti_resources[] = { |
| 239 | { |
| 240 | .start = OMAP2_STI_BASE, |
| 241 | .end = OMAP2_STI_BASE + 0x7ff, |
| 242 | .flags = IORESOURCE_MEM, |
| 243 | }, |
| 244 | { |
| 245 | .start = OMAP2_STI_CHANNEL_BASE, |
| 246 | .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1, |
| 247 | .flags = IORESOURCE_MEM, |
| 248 | }, |
| 249 | { |
| 250 | .start = OMAP2_STI_IRQ, |
| 251 | .flags = IORESOURCE_IRQ, |
| 252 | } |
| 253 | }; |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 254 | #elif defined(CONFIG_ARCH_OMAP3) |
| 255 | |
| 256 | #define OMAP3_SDTI_BASE 0x54500000 |
| 257 | #define OMAP3_SDTI_CHANNEL_BASE 0x54600000 |
| 258 | |
| 259 | static struct resource sti_resources[] = { |
| 260 | { |
| 261 | .start = OMAP3_SDTI_BASE, |
| 262 | .end = OMAP3_SDTI_BASE + 0xFFF, |
| 263 | .flags = IORESOURCE_MEM, |
| 264 | }, |
| 265 | { |
| 266 | .start = OMAP3_SDTI_CHANNEL_BASE, |
| 267 | .end = OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1, |
| 268 | .flags = IORESOURCE_MEM, |
| 269 | } |
| 270 | }; |
| 271 | |
| 272 | #endif |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 273 | |
| 274 | static struct platform_device sti_device = { |
| 275 | .name = "sti", |
| 276 | .id = -1, |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 277 | .num_resources = ARRAY_SIZE(sti_resources), |
| 278 | .resource = sti_resources, |
| 279 | }; |
| 280 | |
| 281 | static inline void omap_init_sti(void) |
| 282 | { |
| 283 | platform_device_register(&sti_device); |
| 284 | } |
| 285 | #else |
| 286 | static inline void omap_init_sti(void) {} |
| 287 | #endif |
| 288 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 289 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 290 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 291 | #include <plat/mcspi.h> |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 292 | |
| 293 | #define OMAP2_MCSPI1_BASE 0x48098000 |
| 294 | #define OMAP2_MCSPI2_BASE 0x4809a000 |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 295 | #define OMAP2_MCSPI3_BASE 0x480b8000 |
| 296 | #define OMAP2_MCSPI4_BASE 0x480ba000 |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 297 | |
Syed Rafiuddin | 7869c0b | 2009-09-22 16:46:18 -0700 | [diff] [blame] | 298 | #define OMAP4_MCSPI1_BASE 0x48098100 |
| 299 | #define OMAP4_MCSPI2_BASE 0x4809a100 |
| 300 | #define OMAP4_MCSPI3_BASE 0x480b8100 |
| 301 | #define OMAP4_MCSPI4_BASE 0x480ba100 |
| 302 | |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 303 | static struct omap2_mcspi_platform_config omap2_mcspi1_config = { |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 304 | .num_cs = 4, |
| 305 | }; |
| 306 | |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 307 | static struct resource omap2_mcspi1_resources[] = { |
| 308 | { |
| 309 | .start = OMAP2_MCSPI1_BASE, |
| 310 | .end = OMAP2_MCSPI1_BASE + 0xff, |
| 311 | .flags = IORESOURCE_MEM, |
| 312 | }, |
| 313 | }; |
| 314 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 315 | static struct platform_device omap2_mcspi1 = { |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 316 | .name = "omap2_mcspi", |
| 317 | .id = 1, |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 318 | .num_resources = ARRAY_SIZE(omap2_mcspi1_resources), |
| 319 | .resource = omap2_mcspi1_resources, |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 320 | .dev = { |
| 321 | .platform_data = &omap2_mcspi1_config, |
| 322 | }, |
| 323 | }; |
| 324 | |
| 325 | static struct omap2_mcspi_platform_config omap2_mcspi2_config = { |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 326 | .num_cs = 2, |
| 327 | }; |
| 328 | |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 329 | static struct resource omap2_mcspi2_resources[] = { |
| 330 | { |
| 331 | .start = OMAP2_MCSPI2_BASE, |
| 332 | .end = OMAP2_MCSPI2_BASE + 0xff, |
| 333 | .flags = IORESOURCE_MEM, |
| 334 | }, |
| 335 | }; |
| 336 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 337 | static struct platform_device omap2_mcspi2 = { |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 338 | .name = "omap2_mcspi", |
| 339 | .id = 2, |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 340 | .num_resources = ARRAY_SIZE(omap2_mcspi2_resources), |
| 341 | .resource = omap2_mcspi2_resources, |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 342 | .dev = { |
| 343 | .platform_data = &omap2_mcspi2_config, |
| 344 | }, |
| 345 | }; |
| 346 | |
Syed Rafiuddin | 7869c0b | 2009-09-22 16:46:18 -0700 | [diff] [blame] | 347 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
| 348 | defined(CONFIG_ARCH_OMAP4) |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 349 | static struct omap2_mcspi_platform_config omap2_mcspi3_config = { |
| 350 | .num_cs = 2, |
| 351 | }; |
| 352 | |
| 353 | static struct resource omap2_mcspi3_resources[] = { |
| 354 | { |
| 355 | .start = OMAP2_MCSPI3_BASE, |
| 356 | .end = OMAP2_MCSPI3_BASE + 0xff, |
| 357 | .flags = IORESOURCE_MEM, |
| 358 | }, |
| 359 | }; |
| 360 | |
| 361 | static struct platform_device omap2_mcspi3 = { |
| 362 | .name = "omap2_mcspi", |
| 363 | .id = 3, |
| 364 | .num_resources = ARRAY_SIZE(omap2_mcspi3_resources), |
| 365 | .resource = omap2_mcspi3_resources, |
| 366 | .dev = { |
| 367 | .platform_data = &omap2_mcspi3_config, |
| 368 | }, |
| 369 | }; |
| 370 | #endif |
| 371 | |
Syed Rafiuddin | 7869c0b | 2009-09-22 16:46:18 -0700 | [diff] [blame] | 372 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 373 | static struct omap2_mcspi_platform_config omap2_mcspi4_config = { |
| 374 | .num_cs = 1, |
| 375 | }; |
| 376 | |
| 377 | static struct resource omap2_mcspi4_resources[] = { |
| 378 | { |
| 379 | .start = OMAP2_MCSPI4_BASE, |
| 380 | .end = OMAP2_MCSPI4_BASE + 0xff, |
| 381 | .flags = IORESOURCE_MEM, |
| 382 | }, |
| 383 | }; |
| 384 | |
| 385 | static struct platform_device omap2_mcspi4 = { |
| 386 | .name = "omap2_mcspi", |
| 387 | .id = 4, |
| 388 | .num_resources = ARRAY_SIZE(omap2_mcspi4_resources), |
| 389 | .resource = omap2_mcspi4_resources, |
| 390 | .dev = { |
| 391 | .platform_data = &omap2_mcspi4_config, |
| 392 | }, |
| 393 | }; |
| 394 | #endif |
| 395 | |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 396 | #ifdef CONFIG_ARCH_OMAP4 |
| 397 | static inline void omap4_mcspi_fixup(void) |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 398 | { |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 399 | omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; |
| 400 | omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; |
| 401 | omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; |
| 402 | omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; |
| 403 | omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; |
| 404 | omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; |
| 405 | omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; |
| 406 | omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; |
| 407 | } |
| 408 | #else |
| 409 | static inline void omap4_mcspi_fixup(void) |
| 410 | { |
| 411 | } |
| 412 | #endif |
| 413 | |
Syed Rafiuddin | 7869c0b | 2009-09-22 16:46:18 -0700 | [diff] [blame] | 414 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
| 415 | defined(CONFIG_ARCH_OMAP4) |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 416 | static inline void omap2_mcspi3_init(void) |
| 417 | { |
| 418 | platform_device_register(&omap2_mcspi3); |
| 419 | } |
| 420 | #else |
| 421 | static inline void omap2_mcspi3_init(void) |
| 422 | { |
| 423 | } |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 424 | #endif |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 425 | |
Syed Rafiuddin | 7869c0b | 2009-09-22 16:46:18 -0700 | [diff] [blame] | 426 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 427 | static inline void omap2_mcspi4_init(void) |
| 428 | { |
| 429 | platform_device_register(&omap2_mcspi4); |
| 430 | } |
| 431 | #else |
| 432 | static inline void omap2_mcspi4_init(void) |
| 433 | { |
| 434 | } |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 435 | #endif |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 436 | |
| 437 | static void omap_init_mcspi(void) |
| 438 | { |
| 439 | if (cpu_is_omap44xx()) |
| 440 | omap4_mcspi_fixup(); |
| 441 | |
| 442 | platform_device_register(&omap2_mcspi1); |
| 443 | platform_device_register(&omap2_mcspi2); |
| 444 | |
| 445 | if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) |
| 446 | omap2_mcspi3_init(); |
| 447 | |
| 448 | if (cpu_is_omap343x() || cpu_is_omap44xx()) |
| 449 | omap2_mcspi4_init(); |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | #else |
| 453 | static inline void omap_init_mcspi(void) {} |
| 454 | #endif |
| 455 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 456 | #ifdef CONFIG_OMAP_SHA1_MD5 |
| 457 | static struct resource sha1_md5_resources[] = { |
| 458 | { |
| 459 | .start = OMAP24XX_SEC_SHA1MD5_BASE, |
| 460 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, |
| 461 | .flags = IORESOURCE_MEM, |
| 462 | }, |
| 463 | { |
| 464 | .start = INT_24XX_SHA1MD5, |
| 465 | .flags = IORESOURCE_IRQ, |
| 466 | } |
| 467 | }; |
| 468 | |
| 469 | static struct platform_device sha1_md5_device = { |
| 470 | .name = "OMAP SHA1/MD5", |
| 471 | .id = -1, |
| 472 | .num_resources = ARRAY_SIZE(sha1_md5_resources), |
| 473 | .resource = sha1_md5_resources, |
| 474 | }; |
| 475 | |
| 476 | static void omap_init_sha1_md5(void) |
| 477 | { |
| 478 | platform_device_register(&sha1_md5_device); |
| 479 | } |
| 480 | #else |
| 481 | static inline void omap_init_sha1_md5(void) { } |
| 482 | #endif |
| 483 | |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 484 | /*-------------------------------------------------------------------------*/ |
| 485 | |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 486 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 487 | |
| 488 | #define MMCHS_SYSCONFIG 0x0010 |
| 489 | #define MMCHS_SYSCONFIG_SWRESET (1 << 1) |
| 490 | #define MMCHS_SYSSTATUS 0x0014 |
| 491 | #define MMCHS_SYSSTATUS_RESETDONE (1 << 0) |
| 492 | |
| 493 | static struct platform_device dummy_pdev = { |
| 494 | .dev = { |
| 495 | .bus = &platform_bus_type, |
| 496 | }, |
| 497 | }; |
| 498 | |
| 499 | /** |
| 500 | * omap_hsmmc_reset() - Full reset of each HS-MMC controller |
| 501 | * |
| 502 | * Ensure that each MMC controller is fully reset. Controllers |
| 503 | * left in an unknown state (by bootloader) may prevent retention |
| 504 | * or OFF-mode. This is especially important in cases where the |
| 505 | * MMC driver is not enabled, _or_ built as a module. |
| 506 | * |
| 507 | * In order for reset to work, interface, functional and debounce |
| 508 | * clocks must be enabled. The debounce clock comes from func_32k_clk |
| 509 | * and is not under SW control, so we only enable i- and f-clocks. |
| 510 | **/ |
| 511 | static void __init omap_hsmmc_reset(void) |
| 512 | { |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 513 | u32 i, nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : |
| 514 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 515 | |
| 516 | for (i = 0; i < nr_controllers; i++) { |
| 517 | u32 v, base = 0; |
| 518 | struct clk *iclk, *fclk; |
| 519 | struct device *dev = &dummy_pdev.dev; |
| 520 | |
| 521 | switch (i) { |
| 522 | case 0: |
| 523 | base = OMAP2_MMC1_BASE; |
| 524 | break; |
| 525 | case 1: |
| 526 | base = OMAP2_MMC2_BASE; |
| 527 | break; |
| 528 | case 2: |
| 529 | base = OMAP3_MMC3_BASE; |
| 530 | break; |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 531 | case 3: |
| 532 | if (!cpu_is_omap44xx()) |
| 533 | return; |
| 534 | base = OMAP4_MMC4_BASE; |
| 535 | break; |
| 536 | case 4: |
| 537 | if (!cpu_is_omap44xx()) |
| 538 | return; |
| 539 | base = OMAP4_MMC5_BASE; |
| 540 | break; |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 541 | } |
| 542 | |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 543 | if (cpu_is_omap44xx()) |
| 544 | base += OMAP4_MMC_REG_OFFSET; |
| 545 | |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 546 | dummy_pdev.id = i; |
Russell King | 1e98ffa | 2009-01-19 18:56:17 +0000 | [diff] [blame] | 547 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); |
Russell King | 6f7607c | 2009-01-28 10:22:50 +0000 | [diff] [blame] | 548 | iclk = clk_get(dev, "ick"); |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 549 | if (iclk && clk_enable(iclk)) |
| 550 | iclk = NULL; |
| 551 | |
Russell King | 6f7607c | 2009-01-28 10:22:50 +0000 | [diff] [blame] | 552 | fclk = clk_get(dev, "fck"); |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 553 | if (fclk && clk_enable(fclk)) |
| 554 | fclk = NULL; |
| 555 | |
| 556 | if (!iclk || !fclk) { |
| 557 | printk(KERN_WARNING |
| 558 | "%s: Unable to enable clocks for MMC%d, " |
| 559 | "cannot reset.\n", __func__, i); |
| 560 | break; |
| 561 | } |
| 562 | |
| 563 | omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG); |
| 564 | v = omap_readl(base + MMCHS_SYSSTATUS); |
| 565 | while (!(omap_readl(base + MMCHS_SYSSTATUS) & |
| 566 | MMCHS_SYSSTATUS_RESETDONE)) |
| 567 | cpu_relax(); |
| 568 | |
| 569 | if (fclk) { |
| 570 | clk_disable(fclk); |
| 571 | clk_put(fclk); |
| 572 | } |
| 573 | if (iclk) { |
| 574 | clk_disable(iclk); |
| 575 | clk_put(iclk); |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | #else |
| 580 | static inline void omap_hsmmc_reset(void) {} |
| 581 | #endif |
| 582 | |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 583 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ |
| 584 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
| 585 | |
| 586 | static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, |
| 587 | int controller_nr) |
| 588 | { |
| 589 | if (cpu_is_omap2420() && controller_nr == 0) { |
| 590 | omap_cfg_reg(H18_24XX_MMC_CMD); |
| 591 | omap_cfg_reg(H15_24XX_MMC_CLKI); |
| 592 | omap_cfg_reg(G19_24XX_MMC_CLKO); |
| 593 | omap_cfg_reg(F20_24XX_MMC_DAT0); |
| 594 | omap_cfg_reg(F19_24XX_MMC_DAT_DIR0); |
| 595 | omap_cfg_reg(G18_24XX_MMC_CMD_DIR); |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 596 | if (mmc_controller->slots[0].wires == 4) { |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 597 | omap_cfg_reg(H14_24XX_MMC_DAT1); |
| 598 | omap_cfg_reg(E19_24XX_MMC_DAT2); |
| 599 | omap_cfg_reg(D19_24XX_MMC_DAT3); |
| 600 | omap_cfg_reg(E20_24XX_MMC_DAT_DIR1); |
| 601 | omap_cfg_reg(F18_24XX_MMC_DAT_DIR2); |
| 602 | omap_cfg_reg(E18_24XX_MMC_DAT_DIR3); |
| 603 | } |
| 604 | |
| 605 | /* |
| 606 | * Use internal loop-back in MMC/SDIO Module Input Clock |
| 607 | * selection |
| 608 | */ |
| 609 | if (mmc_controller->slots[0].internal_clock) { |
| 610 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); |
| 611 | v |= (1 << 24); |
| 612 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); |
| 613 | } |
| 614 | } |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 615 | |
Madhu | 4596d14 | 2009-11-22 10:11:06 -0800 | [diff] [blame] | 616 | if (cpu_is_omap34xx()) { |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 617 | if (controller_nr == 0) { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 618 | omap_mux_init_signal("sdmmc1_clk", |
| 619 | OMAP_PIN_INPUT_PULLUP); |
| 620 | omap_mux_init_signal("sdmmc1_cmd", |
| 621 | OMAP_PIN_INPUT_PULLUP); |
| 622 | omap_mux_init_signal("sdmmc1_dat0", |
| 623 | OMAP_PIN_INPUT_PULLUP); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 624 | if (mmc_controller->slots[0].wires == 4 || |
| 625 | mmc_controller->slots[0].wires == 8) { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 626 | omap_mux_init_signal("sdmmc1_dat1", |
| 627 | OMAP_PIN_INPUT_PULLUP); |
| 628 | omap_mux_init_signal("sdmmc1_dat2", |
| 629 | OMAP_PIN_INPUT_PULLUP); |
| 630 | omap_mux_init_signal("sdmmc1_dat3", |
| 631 | OMAP_PIN_INPUT_PULLUP); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 632 | } |
| 633 | if (mmc_controller->slots[0].wires == 8) { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 634 | omap_mux_init_signal("sdmmc1_dat4", |
| 635 | OMAP_PIN_INPUT_PULLUP); |
| 636 | omap_mux_init_signal("sdmmc1_dat5", |
| 637 | OMAP_PIN_INPUT_PULLUP); |
| 638 | omap_mux_init_signal("sdmmc1_dat6", |
| 639 | OMAP_PIN_INPUT_PULLUP); |
| 640 | omap_mux_init_signal("sdmmc1_dat7", |
| 641 | OMAP_PIN_INPUT_PULLUP); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 642 | } |
| 643 | } |
| 644 | if (controller_nr == 1) { |
| 645 | /* MMC2 */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 646 | omap_mux_init_signal("sdmmc2_clk", |
| 647 | OMAP_PIN_INPUT_PULLUP); |
| 648 | omap_mux_init_signal("sdmmc2_cmd", |
| 649 | OMAP_PIN_INPUT_PULLUP); |
| 650 | omap_mux_init_signal("sdmmc2_dat0", |
| 651 | OMAP_PIN_INPUT_PULLUP); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 652 | |
| 653 | /* |
| 654 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed |
| 655 | * in the board-*.c files |
| 656 | */ |
| 657 | if (mmc_controller->slots[0].wires == 4 || |
| 658 | mmc_controller->slots[0].wires == 8) { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 659 | omap_mux_init_signal("sdmmc2_dat1", |
| 660 | OMAP_PIN_INPUT_PULLUP); |
| 661 | omap_mux_init_signal("sdmmc2_dat2", |
| 662 | OMAP_PIN_INPUT_PULLUP); |
| 663 | omap_mux_init_signal("sdmmc2_dat3", |
| 664 | OMAP_PIN_INPUT_PULLUP); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 665 | } |
Madhu | 4679232 | 2009-11-22 10:11:08 -0800 | [diff] [blame] | 666 | if (mmc_controller->slots[0].wires == 8) { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 667 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", |
| 668 | OMAP_PIN_INPUT_PULLUP); |
| 669 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", |
| 670 | OMAP_PIN_INPUT_PULLUP); |
| 671 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", |
| 672 | OMAP_PIN_INPUT_PULLUP); |
| 673 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", |
| 674 | OMAP_PIN_INPUT_PULLUP); |
Madhu | 4679232 | 2009-11-22 10:11:08 -0800 | [diff] [blame] | 675 | } |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 676 | } |
| 677 | |
| 678 | /* |
| 679 | * For MMC3 the pins need to be muxed in the board-*.c files |
| 680 | */ |
| 681 | } |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, |
| 685 | int nr_controllers) |
| 686 | { |
| 687 | int i; |
Tony Lindgren | 0dffb5c | 2009-01-29 08:57:16 -0800 | [diff] [blame] | 688 | char *name; |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 689 | |
| 690 | for (i = 0; i < nr_controllers; i++) { |
| 691 | unsigned long base, size; |
| 692 | unsigned int irq = 0; |
| 693 | |
| 694 | if (!mmc_data[i]) |
| 695 | continue; |
| 696 | |
| 697 | omap2_mmc_mux(mmc_data[i], i); |
| 698 | |
| 699 | switch (i) { |
| 700 | case 0: |
| 701 | base = OMAP2_MMC1_BASE; |
| 702 | irq = INT_24XX_MMC_IRQ; |
| 703 | break; |
| 704 | case 1: |
| 705 | base = OMAP2_MMC2_BASE; |
| 706 | irq = INT_24XX_MMC2_IRQ; |
| 707 | break; |
| 708 | case 2: |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 709 | if (!cpu_is_omap44xx() && !cpu_is_omap34xx()) |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 710 | return; |
| 711 | base = OMAP3_MMC3_BASE; |
| 712 | irq = INT_34XX_MMC3_IRQ; |
| 713 | break; |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 714 | case 3: |
| 715 | if (!cpu_is_omap44xx()) |
| 716 | return; |
| 717 | base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; |
| 718 | irq = INT_44XX_MMC4_IRQ; |
| 719 | break; |
| 720 | case 4: |
| 721 | if (!cpu_is_omap44xx()) |
| 722 | return; |
| 723 | base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; |
| 724 | irq = INT_44XX_MMC5_IRQ; |
| 725 | break; |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 726 | default: |
| 727 | continue; |
| 728 | } |
| 729 | |
Tony Lindgren | 0dffb5c | 2009-01-29 08:57:16 -0800 | [diff] [blame] | 730 | if (cpu_is_omap2420()) { |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 731 | size = OMAP2420_MMC_SIZE; |
Tony Lindgren | 0dffb5c | 2009-01-29 08:57:16 -0800 | [diff] [blame] | 732 | name = "mmci-omap"; |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 733 | } else if (cpu_is_omap44xx()) { |
| 734 | if (i < 3) { |
| 735 | base += OMAP4_MMC_REG_OFFSET; |
| 736 | irq += IRQ_GIC_START; |
| 737 | } |
| 738 | size = OMAP4_HSMMC_SIZE; |
| 739 | name = "mmci-omap-hs"; |
Tony Lindgren | 0dffb5c | 2009-01-29 08:57:16 -0800 | [diff] [blame] | 740 | } else { |
kishore kadiyala | 82cf818 | 2009-09-22 16:45:25 -0700 | [diff] [blame] | 741 | size = OMAP3_HSMMC_SIZE; |
Tony Lindgren | 0dffb5c | 2009-01-29 08:57:16 -0800 | [diff] [blame] | 742 | name = "mmci-omap-hs"; |
| 743 | } |
| 744 | omap_mmc_add(name, i, base, size, irq, mmc_data[i]); |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 745 | }; |
| 746 | } |
| 747 | |
| 748 | #endif |
| 749 | |
| 750 | /*-------------------------------------------------------------------------*/ |
| 751 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 752 | #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) |
| 753 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) |
| 754 | #define OMAP_HDQ_BASE 0x480B2000 |
| 755 | #endif |
| 756 | static struct resource omap_hdq_resources[] = { |
| 757 | { |
| 758 | .start = OMAP_HDQ_BASE, |
| 759 | .end = OMAP_HDQ_BASE + 0x1C, |
| 760 | .flags = IORESOURCE_MEM, |
| 761 | }, |
| 762 | { |
| 763 | .start = INT_24XX_HDQ_IRQ, |
| 764 | .flags = IORESOURCE_IRQ, |
| 765 | }, |
| 766 | }; |
| 767 | static struct platform_device omap_hdq_dev = { |
| 768 | .name = "omap_hdq", |
| 769 | .id = 0, |
| 770 | .dev = { |
| 771 | .platform_data = NULL, |
| 772 | }, |
| 773 | .num_resources = ARRAY_SIZE(omap_hdq_resources), |
| 774 | .resource = omap_hdq_resources, |
| 775 | }; |
| 776 | static inline void omap_hdq_init(void) |
| 777 | { |
| 778 | (void) platform_device_register(&omap_hdq_dev); |
| 779 | } |
| 780 | #else |
| 781 | static inline void omap_hdq_init(void) {} |
| 782 | #endif |
| 783 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 784 | /*-------------------------------------------------------------------------*/ |
| 785 | |
| 786 | static int __init omap2_init_devices(void) |
| 787 | { |
| 788 | /* please keep these calls, and their implementations above, |
| 789 | * in alphabetical order so they're easier to sort through. |
| 790 | */ |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 791 | omap_hsmmc_reset(); |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 792 | omap_init_camera(); |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 793 | omap_init_mbox(); |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 794 | omap_init_mcspi(); |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 795 | omap_hdq_init(); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 796 | omap_init_sti(); |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 797 | omap_init_sha1_md5(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 798 | |
| 799 | return 0; |
| 800 | } |
| 801 | arch_initcall(omap2_init_devices); |