32
32
#define MCI_DATA31DIREN (1 << 5)
33
33
#define MCI_FBCLKEN (1 << 7)
35
/* GPIO pins used by the sdi0 level shifter */
36
static int sdi0_en = -1;
37
static int sdi0_vsel = -1;
39
35
static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
40
36
unsigned char power_mode)
46
* Level shifter voltage should depend on vdd to when deciding
47
* on either 1.8V or 2.9V. Once the decision has been made the
48
* level shifter must be disabled and re-enabled with a changed
49
* select signal in order to switch the voltage. Since there is
50
* no framework support yet for indicating 1.8V in vdd, use the
53
gpio_direction_output(sdi0_vsel, 0);
54
gpio_direction_output(sdi0_en, 1);
57
gpio_direction_output(sdi0_vsel, 0);
58
gpio_direction_output(sdi0_en, 0);
38
if (power_mode == MMC_POWER_UP)
39
gpio_set_value_cansleep(GPIO_SDMMC_EN, 1);
40
else if (power_mode == MMC_POWER_OFF)
41
gpio_set_value_cansleep(GPIO_SDMMC_EN, 0);
62
43
return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
63
44
MCI_DATA2DIREN | MCI_DATA31DIREN;
86
67
static struct mmci_platform_data mop500_sdi0_data = {
87
68
.vdd_handler = mop500_sdi0_vdd_handler,
88
69
.ocr_mask = MMC_VDD_29_30,
90
.capabilities = MMC_CAP_4_BIT_DATA |
91
MMC_CAP_SD_HIGHSPEED |
92
MMC_CAP_MMC_HIGHSPEED,
71
.capabilities = MMC_CAP_4_BIT_DATA,
94
73
#ifdef CONFIG_STE_DMA40
95
74
.dma_filter = stedma40_filter,
216
199
/* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
217
200
if (!cpu_is_u8500v10())
218
201
mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
219
/* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */
220
if (!machine_is_snowball())
221
db8500_add_sdi2(&mop500_sdi2_data, periphid);
202
db8500_add_sdi2(&mop500_sdi2_data, periphid);
223
204
/* On-board eMMC */
224
205
db8500_add_sdi4(&mop500_sdi4_data, periphid);
226
if (machine_is_hrefv60() || machine_is_snowball()) {
227
if (machine_is_hrefv60()) {
228
mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
229
sdi0_en = HREFV60_SDMMC_EN_GPIO;
230
sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
231
} else if (machine_is_snowball()) {
232
mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
233
mop500_sdi0_data.cd_invert = true;
234
sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
235
sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
207
if (machine_is_hrefv60()) {
208
mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
209
sdi0_en = HREFV60_SDMMC_EN_GPIO;
210
sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
237
211
sdi0_configure();
241
214
* On boards with the TC35892 GPIO expander, sdi0 will finally
242
215
* be added when the TC35892 initializes and calls