aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-04-23 02:53:59 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-12 16:34:17 -0400
commit7775a93363e0bacb8a29b357429562063b42796b (patch)
tree8dd8370b76c159f2a0ce2534ab70483d19fde67e /arch/arm/mach-shmobile
parentcc2512bc67104efdd913fe655171667cd1ce942a (diff)
ARM: mach-shmobile: kzm9g: add SDHI support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 57c391a7550c..657ba6473c65 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -24,6 +24,8 @@
24#include <linux/i2c.h> 24#include <linux/i2c.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/mmc/sh_mmcif.h> 26#include <linux/mmc/sh_mmcif.h>
27#include <linux/mmc/sh_mobile_sdhi.h>
28#include <linux/mfd/tmio.h>
27#include <linux/platform_device.h> 29#include <linux/platform_device.h>
28#include <linux/smsc911x.h> 30#include <linux/smsc911x.h>
29#include <linux/usb/r8a66597.h> 31#include <linux/usb/r8a66597.h>
@@ -183,6 +185,47 @@ static struct platform_device mmc_device = {
183 .resource = sh_mmcif_resources, 185 .resource = sh_mmcif_resources,
184}; 186};
185 187
188/* SDHI */
189static struct sh_mobile_sdhi_info sdhi0_info = {
190 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
191 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
192 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
193};
194
195static struct resource sdhi0_resources[] = {
196 [0] = {
197 .name = "SDHI0",
198 .start = 0xee100000,
199 .end = 0xee1000ff,
200 .flags = IORESOURCE_MEM,
201 },
202 [1] = {
203 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
204 .start = gic_spi(83),
205 .flags = IORESOURCE_IRQ,
206 },
207 [2] = {
208 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
209 .start = gic_spi(84),
210 .flags = IORESOURCE_IRQ,
211 },
212 [3] = {
213 .name = SH_MOBILE_SDHI_IRQ_SDIO,
214 .start = gic_spi(85),
215 .flags = IORESOURCE_IRQ,
216 },
217};
218
219static struct platform_device sdhi0_device = {
220 .name = "sh_mobile_sdhi",
221 .num_resources = ARRAY_SIZE(sdhi0_resources),
222 .resource = sdhi0_resources,
223 .dev = {
224 .platform_data = &sdhi0_info,
225 },
226};
227
228/* I2C */
186static struct i2c_board_info i2c1_devices[] = { 229static struct i2c_board_info i2c1_devices[] = {
187 { 230 {
188 I2C_BOARD_INFO("st1232-ts", 0x55), 231 I2C_BOARD_INFO("st1232-ts", 0x55),
@@ -195,6 +238,7 @@ static struct platform_device *kzm_devices[] __initdata = {
195 &usb_host_device, 238 &usb_host_device,
196 &lcdc_device, 239 &lcdc_device,
197 &mmc_device, 240 &mmc_device,
241 &sdhi0_device,
198}; 242};
199 243
200/* 244/*
@@ -316,6 +360,19 @@ static void __init kzm_init(void)
316 gpio_request(GPIO_FN_MMCD0_6_PU, NULL); 360 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
317 gpio_request(GPIO_FN_MMCD0_7_PU, NULL); 361 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
318 362
363 /* enable SD */
364 gpio_request(GPIO_FN_SDHIWP0, NULL);
365 gpio_request(GPIO_FN_SDHICD0, NULL);
366 gpio_request(GPIO_FN_SDHICMD0, NULL);
367 gpio_request(GPIO_FN_SDHICLK0, NULL);
368 gpio_request(GPIO_FN_SDHID0_3, NULL);
369 gpio_request(GPIO_FN_SDHID0_2, NULL);
370 gpio_request(GPIO_FN_SDHID0_1, NULL);
371 gpio_request(GPIO_FN_SDHID0_0, NULL);
372 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
373 gpio_request(GPIO_PORT15, NULL);
374 gpio_direction_output(GPIO_PORT15, 1); /* power */
375
319#ifdef CONFIG_CACHE_L2X0 376#ifdef CONFIG_CACHE_L2X0
320 /* Early BRESP enable, Shared attribute override enable, 64K*8way */ 377 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
321 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); 378 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);