aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/devices.c')
-rw-r--r--arch/arm/mach-omap1/devices.c60
1 files changed, 51 insertions, 9 deletions
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 06808434ea04..379100c17639 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -14,15 +14,17 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/spi/spi.h>
17 18
18#include <mach/hardware.h> 19#include <mach/hardware.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20 21
21#include <mach/tc.h> 22#include <plat/tc.h>
22#include <mach/board.h> 23#include <plat/board.h>
23#include <mach/mux.h> 24#include <plat/mux.h>
24#include <mach/gpio.h> 25#include <mach/gpio.h>
25#include <mach/mmc.h> 26#include <plat/mmc.h>
27#include <plat/omap7xx.h>
26 28
27/*-------------------------------------------------------------------------*/ 29/*-------------------------------------------------------------------------*/
28 30
@@ -71,7 +73,7 @@ static inline void omap_init_rtc(void) {}
71# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1 73# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1
72#endif 74#endif
73 75
74#define OMAP1_MBOX_BASE OMAP1_IO_ADDRESS(OMAP16XX_MAILBOX_BASE) 76#define OMAP1_MBOX_BASE OMAP16XX_MAILBOX_BASE
75 77
76static struct resource mbox_resources[] = { 78static struct resource mbox_resources[] = {
77 { 79 {
@@ -108,15 +110,22 @@ static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
108 int controller_nr) 110 int controller_nr)
109{ 111{
110 if (controller_nr == 0) { 112 if (controller_nr == 0) {
111 omap_cfg_reg(MMC_CMD); 113 if (cpu_is_omap7xx()) {
112 omap_cfg_reg(MMC_CLK); 114 omap_cfg_reg(MMC_7XX_CMD);
113 omap_cfg_reg(MMC_DAT0); 115 omap_cfg_reg(MMC_7XX_CLK);
116 omap_cfg_reg(MMC_7XX_DAT0);
117 } else {
118 omap_cfg_reg(MMC_CMD);
119 omap_cfg_reg(MMC_CLK);
120 omap_cfg_reg(MMC_DAT0);
121 }
122
114 if (cpu_is_omap1710()) { 123 if (cpu_is_omap1710()) {
115 omap_cfg_reg(M15_1710_MMC_CLKI); 124 omap_cfg_reg(M15_1710_MMC_CLKI);
116 omap_cfg_reg(P19_1710_MMC_CMDDIR); 125 omap_cfg_reg(P19_1710_MMC_CMDDIR);
117 omap_cfg_reg(P20_1710_MMC_DATDIR0); 126 omap_cfg_reg(P20_1710_MMC_DATDIR0);
118 } 127 }
119 if (mmc_controller->slots[0].wires == 4) { 128 if (mmc_controller->slots[0].wires == 4 && !cpu_is_omap7xx()) {
120 omap_cfg_reg(MMC_DAT1); 129 omap_cfg_reg(MMC_DAT1);
121 /* NOTE: DAT2 can be on W10 (here) or M15 */ 130 /* NOTE: DAT2 can be on W10 (here) or M15 */
122 if (!mmc_controller->slots[0].nomux) 131 if (!mmc_controller->slots[0].nomux)
@@ -189,6 +198,38 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
189 198
190/*-------------------------------------------------------------------------*/ 199/*-------------------------------------------------------------------------*/
191 200
201/* OMAP7xx SPI support */
202#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE)
203
204struct platform_device omap_spi1 = {
205 .name = "omap1_spi100k",
206 .id = 1,
207};
208
209struct platform_device omap_spi2 = {
210 .name = "omap1_spi100k",
211 .id = 2,
212};
213
214static void omap_init_spi100k(void)
215{
216 omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff);
217 if (omap_spi1.dev.platform_data)
218 platform_device_register(&omap_spi1);
219
220 omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff);
221 if (omap_spi2.dev.platform_data)
222 platform_device_register(&omap_spi2);
223}
224
225#else
226static inline void omap_init_spi100k(void)
227{
228}
229#endif
230
231/*-------------------------------------------------------------------------*/
232
192#if defined(CONFIG_OMAP_STI) 233#if defined(CONFIG_OMAP_STI)
193 234
194#define OMAP1_STI_BASE 0xfffea000 235#define OMAP1_STI_BASE 0xfffea000
@@ -256,6 +297,7 @@ static int __init omap1_init_devices(void)
256 297
257 omap_init_mbox(); 298 omap_init_mbox();
258 omap_init_rtc(); 299 omap_init_rtc();
300 omap_init_spi100k();
259 omap_init_sti(); 301 omap_init_sti();
260 302
261 return 0; 303 return 0;