aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorTakashi YOSHII <takashi.yoshii.zj@renesas.com>2010-12-22 01:35:30 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-12-22 02:36:33 -0500
commit6bf45a1018ff3cda8b6ef2fa7e023a023bc01dc8 (patch)
treeeeb8d1ebfe98169e6603f8bb7dd047d49b5c19ca /arch/arm
parent5d7814728d80ee56d02e99cc2ab0850c8625a047 (diff)
ARM: mach-shmobile: Add eMMC support through MMCIF on AG5EVM
Adding platform resources, PFC setting and release reset pin for eMMC on ag5evm. [damm@opensource.se: Add MSTP code for MMCIF] Signed-off-by: Takashi YOSHII <takashi.yoshii.zj@renesas.com> Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c54
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c4
2 files changed, 56 insertions, 2 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index c6b152469972..2f135923e2bd 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -32,6 +32,8 @@
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/input.h> 33#include <linux/input.h>
34#include <linux/input/sh_keysc.h> 34#include <linux/input/sh_keysc.h>
35#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mmcif.h>
35 37
36#include <sound/sh_fsi.h> 38#include <sound/sh_fsi.h>
37 39
@@ -146,10 +148,46 @@ static struct platform_device fsi_device = {
146 }, 148 },
147}; 149};
148 150
151static struct resource sh_mmcif_resources[] = {
152 [0] = {
153 .name = "MMCIF",
154 .start = 0xe6bd0000,
155 .end = 0xe6bd00ff,
156 .flags = IORESOURCE_MEM,
157 },
158 [1] = {
159 .start = gic_spi(141),
160 .flags = IORESOURCE_IRQ,
161 },
162 [2] = {
163 .start = gic_spi(140),
164 .flags = IORESOURCE_IRQ,
165 },
166};
167
168static struct sh_mmcif_plat_data sh_mmcif_platdata = {
169 .sup_pclk = 0,
170 .ocr = MMC_VDD_165_195,
171 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
172};
173
174static struct platform_device mmc_device = {
175 .name = "sh_mmcif",
176 .id = 0,
177 .dev = {
178 .dma_mask = NULL,
179 .coherent_dma_mask = 0xffffffff,
180 .platform_data = &sh_mmcif_platdata,
181 },
182 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
183 .resource = sh_mmcif_resources,
184};
185
149static struct platform_device *ag5evm_devices[] __initdata = { 186static struct platform_device *ag5evm_devices[] __initdata = {
150 &eth_device, 187 &eth_device,
151 &keysc_device, 188 &keysc_device,
152 &fsi_device, 189 &fsi_device,
190 &mmc_device,
153}; 191};
154 192
155static struct map_desc ag5evm_io_desc[] __initdata = { 193static struct map_desc ag5evm_io_desc[] __initdata = {
@@ -216,12 +254,26 @@ static void __init ag5evm_init(void)
216 gpio_request(GPIO_FN_KEYOUT8, NULL); 254 gpio_request(GPIO_FN_KEYOUT8, NULL);
217 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL); 255 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
218 256
219 /* enable IC2 2 and 3 */ 257 /* enable I2C channel 2 and 3 */
220 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL); 258 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
221 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL); 259 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
222 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL); 260 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
223 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL); 261 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
224 262
263 /* enable MMCIF */
264 gpio_request(GPIO_FN_MMCCLK0, NULL);
265 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
266 gpio_request(GPIO_FN_MMCD0_0, NULL);
267 gpio_request(GPIO_FN_MMCD0_1, NULL);
268 gpio_request(GPIO_FN_MMCD0_2, NULL);
269 gpio_request(GPIO_FN_MMCD0_3, NULL);
270 gpio_request(GPIO_FN_MMCD0_4, NULL);
271 gpio_request(GPIO_FN_MMCD0_5, NULL);
272 gpio_request(GPIO_FN_MMCD0_6, NULL);
273 gpio_request(GPIO_FN_MMCD0_7, NULL);
274 gpio_request(GPIO_PORT208, NULL); /* Reset */
275 gpio_direction_output(GPIO_PORT208, 1);
276
225 /* enable SMSC911X */ 277 /* enable SMSC911X */
226 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ 278 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
227 gpio_direction_input(GPIO_PORT144); 279 gpio_direction_input(GPIO_PORT144);
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 7d0dbe10c845..419581854a80 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -258,7 +258,7 @@ enum { MSTP001,
258 MSTP125, MSTP116, 258 MSTP125, MSTP116,
259 MSTP219, 259 MSTP219,
260 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 260 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
261 MSTP331, MSTP329, MSTP323, 261 MSTP331, MSTP329, MSTP323, MSTP312,
262 MSTP411, MSTP410, MSTP403, 262 MSTP411, MSTP410, MSTP403,
263 MSTP_NR }; 263 MSTP_NR };
264 264
@@ -280,6 +280,7 @@ static struct clk mstp_clks[MSTP_NR] = {
280 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ 280 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
281 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 281 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
282 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 282 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
283 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
283 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ 284 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */
284 [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ 285 [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */
285 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 286 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
@@ -308,6 +309,7 @@ static struct clk_lookup lookups[] = {
308 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 309 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
309 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 310 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
310 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 311 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
312 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
311 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ 313 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
312 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ 314 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
313 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 315 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */