diff options
-rw-r--r-- | arch/arm/mach-shmobile/board-ape6evm.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 8c7529cc4860..ccf8b0429083 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c | |||
@@ -21,8 +21,10 @@ | |||
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/mfd/tmio.h> | ||
24 | #include <linux/mmc/host.h> | 25 | #include <linux/mmc/host.h> |
25 | #include <linux/mmc/sh_mmcif.h> | 26 | #include <linux/mmc/sh_mmcif.h> |
27 | #include <linux/mmc/sh_mobile_sdhi.h> | ||
26 | #include <linux/pinctrl/machine.h> | 28 | #include <linux/pinctrl/machine.h> |
27 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
28 | #include <linux/regulator/fixed.h> | 30 | #include <linux/regulator/fixed.h> |
@@ -58,11 +60,16 @@ static const struct smsc911x_platform_config lan9220_data = { | |||
58 | 60 | ||
59 | /* | 61 | /* |
60 | * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we | 62 | * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we |
61 | * model a VDD supply to MMCIF, using a fixed 3.3V regulator. | 63 | * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the |
64 | * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also | ||
65 | * supplied by the same tps80032 regulator and thus can also be adjusted | ||
66 | * dynamically. | ||
62 | */ | 67 | */ |
63 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = | 68 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = |
64 | { | 69 | { |
65 | REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), | 70 | REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), |
71 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
72 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), | ||
66 | }; | 73 | }; |
67 | 74 | ||
68 | /* MMCIF */ | 75 | /* MMCIF */ |
@@ -75,6 +82,29 @@ static struct resource mmcif0_resources[] = { | |||
75 | DEFINE_RES_IRQ(gic_spi(169)), | 82 | DEFINE_RES_IRQ(gic_spi(169)), |
76 | }; | 83 | }; |
77 | 84 | ||
85 | /* SDHI0 */ | ||
86 | static struct sh_mobile_sdhi_info sdhi0_pdata = { | ||
87 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, | ||
88 | .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, | ||
89 | }; | ||
90 | |||
91 | static struct resource sdhi0_resources[] = { | ||
92 | DEFINE_RES_MEM_NAMED(0xee100000, 0x100, "SDHI0"), | ||
93 | DEFINE_RES_IRQ(gic_spi(165)), | ||
94 | }; | ||
95 | |||
96 | /* SDHI1 */ | ||
97 | static struct sh_mobile_sdhi_info sdhi1_pdata = { | ||
98 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, | ||
99 | .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | ||
100 | MMC_CAP_NEEDS_POLL, | ||
101 | }; | ||
102 | |||
103 | static struct resource sdhi1_resources[] = { | ||
104 | DEFINE_RES_MEM_NAMED(0xee120000, 0x100, "SDHI1"), | ||
105 | DEFINE_RES_IRQ(gic_spi(166)), | ||
106 | }; | ||
107 | |||
78 | static const struct pinctrl_map ape6evm_pinctrl_map[] = { | 108 | static const struct pinctrl_map ape6evm_pinctrl_map[] = { |
79 | /* SCIFA0 console */ | 109 | /* SCIFA0 console */ |
80 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", | 110 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", |
@@ -87,6 +117,18 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { | |||
87 | "mmc0_data8", "mmc0"), | 117 | "mmc0_data8", "mmc0"), |
88 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", | 118 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", |
89 | "mmc0_ctrl", "mmc0"), | 119 | "mmc0_ctrl", "mmc0"), |
120 | /* SDHI0: uSD: no WP */ | ||
121 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", | ||
122 | "sdhi0_data4", "sdhi0"), | ||
123 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", | ||
124 | "sdhi0_ctrl", "sdhi0"), | ||
125 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", | ||
126 | "sdhi0_cd", "sdhi0"), | ||
127 | /* SDHI1 */ | ||
128 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", | ||
129 | "sdhi1_data4", "sdhi1"), | ||
130 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", | ||
131 | "sdhi1_ctrl", "sdhi1"), | ||
90 | }; | 132 | }; |
91 | 133 | ||
92 | static void __init ape6evm_add_standard_devices(void) | 134 | static void __init ape6evm_add_standard_devices(void) |
@@ -124,6 +166,12 @@ static void __init ape6evm_add_standard_devices(void) | |||
124 | platform_device_register_resndata(&platform_bus, "sh_mmcif", 0, | 166 | platform_device_register_resndata(&platform_bus, "sh_mmcif", 0, |
125 | mmcif0_resources, ARRAY_SIZE(mmcif0_resources), | 167 | mmcif0_resources, ARRAY_SIZE(mmcif0_resources), |
126 | &mmcif0_pdata, sizeof(mmcif0_pdata)); | 168 | &mmcif0_pdata, sizeof(mmcif0_pdata)); |
169 | platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0, | ||
170 | sdhi0_resources, ARRAY_SIZE(sdhi0_resources), | ||
171 | &sdhi0_pdata, sizeof(sdhi0_pdata)); | ||
172 | platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1, | ||
173 | sdhi1_resources, ARRAY_SIZE(sdhi1_resources), | ||
174 | &sdhi1_pdata, sizeof(sdhi1_pdata)); | ||
127 | } | 175 | } |
128 | 176 | ||
129 | static const char *ape6evm_boards_compat_dt[] __initdata = { | 177 | static const char *ape6evm_boards_compat_dt[] __initdata = { |