aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Edworthy <phil.edworthy@renesas.com>2012-08-06 08:31:05 -0400
committerSimon Horman <horms@verge.net.au>2012-09-05 21:23:38 -0400
commit894cda18de4b8963b16bc706fea53566df6d7b05 (patch)
tree94c501b72c8cc16632debe7096e5300700bf882a
parent4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff)
ARM: shmobile: marzen: add SDHI0 support
[horms@verge.net.au: moved defconfig portion into a separate patch] [horms@verge.net.au: added "ARM: shmobile:" to title] Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 3a528cf4366c..dec3ffc9df09 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -30,6 +30,8 @@
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
32#include <linux/smsc911x.h> 32#include <linux/smsc911x.h>
33#include <linux/mmc/sh_mobile_sdhi.h>
34#include <linux/mfd/tmio.h>
33#include <mach/hardware.h> 35#include <mach/hardware.h>
34#include <mach/r8a7779.h> 36#include <mach/r8a7779.h>
35#include <mach/common.h> 37#include <mach/common.h>
@@ -39,6 +41,12 @@
39#include <asm/hardware/gic.h> 41#include <asm/hardware/gic.h>
40#include <asm/traps.h> 42#include <asm/traps.h>
41 43
44/* Fixed 3.3V regulator to be used by SDHI0 */
45static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
46 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
47 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
48};
49
42/* Dummy supplies, where voltage doesn't matter */ 50/* Dummy supplies, where voltage doesn't matter */
43static struct regulator_consumer_supply dummy_supplies[] = { 51static struct regulator_consumer_supply dummy_supplies[] = {
44 REGULATOR_SUPPLY("vddvario", "smsc911x"), 52 REGULATOR_SUPPLY("vddvario", "smsc911x"),
@@ -75,13 +83,45 @@ static struct platform_device eth_device = {
75 .num_resources = ARRAY_SIZE(smsc911x_resources), 83 .num_resources = ARRAY_SIZE(smsc911x_resources),
76}; 84};
77 85
86static struct resource sdhi0_resources[] = {
87 [0] = {
88 .name = "sdhi0",
89 .start = 0xffe4c000,
90 .end = 0xffe4c0ff,
91 .flags = IORESOURCE_MEM,
92 },
93 [1] = {
94 .start = gic_spi(104),
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct sh_mobile_sdhi_info sdhi0_platform_data = {
100 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
101 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
102};
103
104static struct platform_device sdhi0_device = {
105 .name = "sh_mobile_sdhi",
106 .num_resources = ARRAY_SIZE(sdhi0_resources),
107 .resource = sdhi0_resources,
108 .id = 0,
109 .dev = {
110 .platform_data = &sdhi0_platform_data,
111 }
112};
113
78static struct platform_device *marzen_devices[] __initdata = { 114static struct platform_device *marzen_devices[] __initdata = {
79 &eth_device, 115 &eth_device,
116 &sdhi0_device,
80}; 117};
81 118
82static void __init marzen_init(void) 119static void __init marzen_init(void)
83{ 120{
84 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 121 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
122 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
123 regulator_register_fixed(0, dummy_supplies,
124 ARRAY_SIZE(dummy_supplies));
85 125
86 r8a7779_pinmux_init(); 126 r8a7779_pinmux_init();
87 127
@@ -97,6 +137,16 @@ static void __init marzen_init(void)
97 gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */ 137 gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */
98 gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */ 138 gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */
99 139
140 /* SD0 (CN20) */
141 gpio_request(GPIO_FN_SD0_CLK, NULL);
142 gpio_request(GPIO_FN_SD0_CMD, NULL);
143 gpio_request(GPIO_FN_SD0_DAT0, NULL);
144 gpio_request(GPIO_FN_SD0_DAT1, NULL);
145 gpio_request(GPIO_FN_SD0_DAT2, NULL);
146 gpio_request(GPIO_FN_SD0_DAT3, NULL);
147 gpio_request(GPIO_FN_SD0_CD, NULL);
148 gpio_request(GPIO_FN_SD0_WP, NULL);
149
100 r8a7779_add_standard_devices(); 150 r8a7779_add_standard_devices();
101 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 151 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
102} 152}