mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
ODROIDC: mmc: Support UHS-1 micro sdcard
Since MESON8B has single SDHC and SDIO block, 'meson8b_odroidc.dtd' is to boot by sdcard and 'meson8b_odroidc_emmc.dtd' by eMMC. Change-Id: I5550197122c023d50665a3bcfc740567b99420f4 Conflicts: arch/arm/boot/dts/amlogic/meson8b_odroidc.dtd
This commit is contained in:
1567
arch/arm/boot/dts/amlogic/meson8b_odroidc_emmc.dtd
Normal file
1567
arch/arm/boot/dts/amlogic/meson8b_odroidc_emmc.dtd
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1068,7 +1068,7 @@ CONFIG_LIGHT_EPL6814=y
|
||||
CONFIG_LIGHT_ISL29023=y
|
||||
CONFIG_LIGHT_STK220X=y
|
||||
CONFIG_LIGHT_LTR558=y
|
||||
CONFIG_AML_GPIO_KEY=y
|
||||
# CONFIG_AML_GPIO_KEY is not set
|
||||
CONFIG_GPIO_AMLOGIC=y
|
||||
CONFIG_PINCTRL_AMLOGIC=y
|
||||
|
||||
@@ -1165,9 +1165,21 @@ CONFIG_AML_PHY=y
|
||||
CONFIG_AML_RTL8211F=y
|
||||
CONFIG_AM_ETHERNET_DEBUG_LEVEL=1
|
||||
CONFIG_AM_WIFI=y
|
||||
CONFIG_AM_WIFI_SD_MMC=y
|
||||
# CONFIG_AM_WIFI_SD_MMC is not set
|
||||
# CONFIG_DHD_USE_STATIC_BUF is not set
|
||||
CONFIG_AM_WIFI_USB=y
|
||||
# CONFIG_BCMDHD is not set
|
||||
CONFIG_RTL8188EU=m
|
||||
CONFIG_RTL8188EU_MP=m
|
||||
# CONFIG_RTL8192CU is not set
|
||||
# CONFIG_RTL8192DU is not set
|
||||
# CONFIG_RTL8192EU is not set
|
||||
# CONFIG_RTL8189ES is not set
|
||||
# CONFIG_RTL8723AS is not set
|
||||
# CONFIG_RTL8723BS is not set
|
||||
# CONFIG_RTL8723AU is not set
|
||||
# CONFIG_RTL8821AU is not set
|
||||
# CONFIG_RTL8812AU is not set
|
||||
|
||||
#
|
||||
# Bluetooth Device Support
|
||||
|
||||
@@ -94,6 +94,9 @@ struct amlsd_platform {
|
||||
unsigned int gpio_dat3;
|
||||
unsigned int jtag_pin;
|
||||
|
||||
#if defined(CONFIG_MACH_MESON8B_ODROIDC)
|
||||
unsigned int gpio_volsw;
|
||||
#endif
|
||||
int is_sduart;
|
||||
bool is_in;
|
||||
bool is_tuned; /* if card has been tuning */
|
||||
|
||||
46
drivers/amlogic/mmc/amlsd.c
Executable file → Normal file
46
drivers/amlogic/mmc/amlsd.c
Executable file → Normal file
@@ -720,6 +720,16 @@ int of_amlsd_init(struct amlsd_platform* pdata)
|
||||
CHECK_RET(ret);
|
||||
}
|
||||
}
|
||||
#if defined(CONFIG_MACH_MESON8B_ODROIDC)
|
||||
if(pdata->gpio_volsw) {
|
||||
ret = amlogic_gpio_request_one(pdata->gpio_volsw, GPIOF_OUT_INIT_LOW, MODULE_NAME);
|
||||
CHECK_RET(ret);
|
||||
if (ret == 0) {
|
||||
ret = amlogic_gpio_direction_output(pdata->gpio_volsw, 0, MODULE_NAME); // output low default 3.3V
|
||||
CHECK_RET(ret);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// if(pdata->port == MESON_SDIO_PORT_A)
|
||||
// wifi_setup_dt();
|
||||
@@ -1256,6 +1266,40 @@ int aml_check_unsupport_cmd(struct mmc_host* mmc, struct mmc_request* mrq)
|
||||
|
||||
int aml_sd_voltage_switch (struct amlsd_platform* pdata, char signal_voltage)
|
||||
{
|
||||
#if defined(CONFIG_MACH_MESON8B_ODROIDC)
|
||||
char *str;
|
||||
int delay_ms = 0;
|
||||
int volsw = 0;
|
||||
int ret=0;
|
||||
|
||||
switch (signal_voltage) {
|
||||
case MMC_SIGNAL_VOLTAGE_180:
|
||||
delay_ms = 10;
|
||||
volsw = 1;
|
||||
str = "1.80 V";
|
||||
if (!mmc_host_uhs(pdata->mmc)) {
|
||||
sdhc_err("switch to 1.8V for a non-uhs device.\n");
|
||||
}
|
||||
break;
|
||||
case MMC_SIGNAL_VOLTAGE_330:
|
||||
delay_ms = 20;
|
||||
volsw = 0;
|
||||
str = "3.30 V";
|
||||
break;
|
||||
default:
|
||||
str = "invalid";
|
||||
break;
|
||||
}
|
||||
|
||||
if(pdata->gpio_volsw) {
|
||||
ret = amlogic_set_value(pdata->gpio_volsw, volsw, MODULE_NAME);
|
||||
CHECK_RET(ret);
|
||||
printk("%s[%d] : Switched to voltage -> %s\n",__func__,__LINE__,str);
|
||||
}
|
||||
pdata->signal_voltage = signal_voltage;
|
||||
mdelay(delay_ms); // wait for voltage to be stable
|
||||
#else
|
||||
|
||||
#if ((defined CONFIG_ARCH_MESON8))
|
||||
#ifdef CONFIG_AMLOGIC_BOARD_HAS_PMU
|
||||
int vol = LDO4DAC_REG_3_3_V;
|
||||
@@ -1307,7 +1351,7 @@ int aml_sd_voltage_switch (struct amlsd_platform* pdata, char signal_voltage)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -181,6 +181,7 @@ int amlsd_get_platform_data(struct platform_device* pdev,
|
||||
SD_PARSE_GPIO_NUM_PROP(child, "jtag_pin", str, pdata->jtag_pin);
|
||||
SD_PARSE_U32_PROP(child, "card_type", prop, pdata->card_type);
|
||||
SD_PARSE_GPIO_NUM_PROP(child, "gpio_dat3", str, pdata->gpio_dat3);
|
||||
SD_PARSE_GPIO_NUM_PROP(child, "gpio_volsw", str, pdata->gpio_volsw);
|
||||
|
||||
pdata->port_init = of_amlsd_init;
|
||||
pdata->pwr_pre = of_amlsd_pwr_prepare;
|
||||
|
||||
Reference in New Issue
Block a user