diff options
author | Tim Nordell <tim.nordell@logicpd.com> | 2010-09-27 12:05:48 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-28 14:39:18 -0400 |
commit | 8430281b0a909048cc0e38756b11ae309bb783cd (patch) | |
tree | b7e09c4a0417668777b3221a40ce623c84b4ba3d /arch/arm/mach-omap2/board-omap3logic.c | |
parent | d40f3f15d31e93fce3960d90caaa5a40b52494e8 (diff) |
ARM: OMAP3LOGIC: Adding SDMMC support
Add low-level initialization for hsmmc controller for
LogicPD's OMAP 3530 LV SOM and OMAP 35x Torpedo board.
Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
[tony@atomide.com: updated for the recent mmc platform init changes]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3logic.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3logic.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index ac3b0f7163ce..8b6036053e1b 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/regulator/machine.h> | 26 | #include <linux/regulator/machine.h> |
27 | 27 | ||
28 | #include <linux/i2c/twl.h> | 28 | #include <linux/i2c/twl.h> |
29 | #include <linux/mmc/host.h> | ||
29 | 30 | ||
30 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
@@ -33,6 +34,7 @@ | |||
33 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
34 | 35 | ||
35 | #include "mux.h" | 36 | #include "mux.h" |
37 | #include "hsmmc.h" | ||
36 | 38 | ||
37 | #include <plat/mux.h> | 39 | #include <plat/mux.h> |
38 | #include <plat/board.h> | 40 | #include <plat/board.h> |
@@ -87,6 +89,7 @@ static struct twl4030_platform_data omap3logic_twldata = { | |||
87 | 89 | ||
88 | /* platform_data for children goes here */ | 90 | /* platform_data for children goes here */ |
89 | .gpio = &omap3logic_gpio_data, | 91 | .gpio = &omap3logic_gpio_data, |
92 | .vmmc1 = &omap3logic_vmmc1, | ||
90 | }; | 93 | }; |
91 | 94 | ||
92 | static struct i2c_board_info __initdata omap3logic_i2c_boardinfo[] = { | 95 | static struct i2c_board_info __initdata omap3logic_i2c_boardinfo[] = { |
@@ -105,6 +108,40 @@ static int __init omap3logic_i2c_init(void) | |||
105 | return 0; | 108 | return 0; |
106 | } | 109 | } |
107 | 110 | ||
111 | static struct omap2_hsmmc_info __initdata board_mmc_info[] = { | ||
112 | { | ||
113 | .name = "external", | ||
114 | .mmc = 1, | ||
115 | .caps = MMC_CAP_4_BIT_DATA, | ||
116 | .gpio_cd = -EINVAL, | ||
117 | .gpio_wp = -EINVAL, | ||
118 | }, | ||
119 | {} /* Terminator */ | ||
120 | }; | ||
121 | |||
122 | static void __init board_mmc_init(void) | ||
123 | { | ||
124 | if (machine_is_omap3530_lv_som()) { | ||
125 | /* OMAP3530 LV SOM board */ | ||
126 | board_mmc_info[0].gpio_cd = OMAP3530_LV_SOM_MMC_GPIO_CD; | ||
127 | board_mmc_info[0].gpio_wp = OMAP3530_LV_SOM_MMC_GPIO_WP; | ||
128 | omap_mux_init_signal("gpio_110", OMAP_PIN_OUTPUT); | ||
129 | omap_mux_init_signal("gpio_126", OMAP_PIN_OUTPUT); | ||
130 | } else if (machine_is_omap3_torpedo()) { | ||
131 | /* OMAP3 Torpedo board */ | ||
132 | board_mmc_info[0].gpio_cd = OMAP3_TORPEDO_MMC_GPIO_CD; | ||
133 | omap_mux_init_signal("gpio_127", OMAP_PIN_OUTPUT); | ||
134 | } else { | ||
135 | /* unsupported board */ | ||
136 | printk(KERN_ERR "%s(): unknown machine type\n", __func__); | ||
137 | return; | ||
138 | } | ||
139 | |||
140 | omap2_hsmmc_init(board_mmc_info); | ||
141 | /* link regulators to MMC adapters */ | ||
142 | omap3logic_vmmc1_supply.dev = board_mmc_info[0].dev; | ||
143 | } | ||
144 | |||
108 | static void __init omap3logic_init_irq(void) | 145 | static void __init omap3logic_init_irq(void) |
109 | { | 146 | { |
110 | omap2_init_common_hw(NULL, NULL); | 147 | omap2_init_common_hw(NULL, NULL); |
@@ -116,7 +153,7 @@ static void __init omap3logic_init(void) | |||
116 | { | 153 | { |
117 | omap3logic_i2c_init(); | 154 | omap3logic_i2c_init(); |
118 | omap_serial_init(); | 155 | omap_serial_init(); |
119 | 156 | board_mmc_init(); | |
120 | /* Ensure SDRC pins are mux'd for self-refresh */ | 157 | /* Ensure SDRC pins are mux'd for self-refresh */ |
121 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 158 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
122 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 159 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |