diff --git a/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dts b/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dts index 15c107177321..08069c541190 100644 --- a/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dts +++ b/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dts @@ -372,16 +372,22 @@ &sd_emmc_b { status = "okay"; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + max-frequency = <200000000>; sd { caps = "MMC_CAP_4_BIT_DATA", + "MMC_CAP_UHS_SDR25", "MMC_CAP_UHS_SDR50", "MMC_CAP_UHS_SDR104", "MMC_CAP_MMC_HIGHSPEED", "MMC_CAP_SD_HIGHSPEED"; vol_switch = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>; + gpio_power = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>; vol_switch_18 = <1>; f_min = <400000>; - f_max = <100000000>; + f_max = <200000000>; }; }; diff --git a/drivers/amlogic/mmc/aml_sd_emmc.c b/drivers/amlogic/mmc/aml_sd_emmc.c index 5145c91ce64b..e5e2fec1e1f3 100644 --- a/drivers/amlogic/mmc/aml_sd_emmc.c +++ b/drivers/amlogic/mmc/aml_sd_emmc.c @@ -3393,6 +3393,39 @@ static int meson_mmc_remove(struct platform_device *pdev) return 0; } +/* + * Shutdown callback + */ +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) +static void meson_mmc_shutdown(struct platform_device *pdev) +{ + struct amlsd_host *host = dev_get_drvdata(&pdev->dev); + struct mmc_host *mmc = host->mmc; + + if (mmc) { + struct amlsd_platform *pdata = mmc_priv(mmc); + + if ((pdata->vol_switch) && (pdata->gpio_power)) { + gpio_direction_output(pdata->vol_switch, 0); + mdelay(500); + gpio_direction_output(pdata->vol_switch, 1); + gpio_direction_output(pdata->gpio_power, 0); + mdelay(500); + gpio_direction_output(pdata->vol_switch, 0); + gpio_direction_output(pdata->gpio_power, 1); + mdelay(200); + gpio_free(pdata->vol_switch); + gpio_free(pdata->gpio_power); + } + if (pdata->hw_reset) { + gpio_direction_output(pdata->hw_reset, 0); + mdelay(500); + gpio_direction_output(pdata->hw_reset, 1); + } + } +} +#endif + static struct meson_mmc_data mmc_data_gxbb = { .chip_type = MMC_CHIP_GXBB, .port_a_base = 0xd0070000, @@ -3661,6 +3694,9 @@ MODULE_DEVICE_TABLE(of, meson_mmc_of_match); static struct platform_driver meson_mmc_driver = { .probe = meson_mmc_probe, .remove = meson_mmc_remove, +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + .shutdown = meson_mmc_shutdown, +#endif .driver = { .name = "meson-aml-mmc", .owner = THIS_MODULE, diff --git a/drivers/amlogic/mmc/amlsd.c b/drivers/amlogic/mmc/amlsd.c index eea5ccf78985..5cb2648709f3 100644 --- a/drivers/amlogic/mmc/amlsd.c +++ b/drivers/amlogic/mmc/amlsd.c @@ -355,6 +355,7 @@ int of_amlsd_init(struct amlsd_platform *pdata) } } #endif +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) if (pdata->gpio_power) { if (pdata->power_level) { ret = gpio_request_one(pdata->gpio_power, @@ -366,6 +367,7 @@ int of_amlsd_init(struct amlsd_platform *pdata) CHECK_RET(ret); } } +#endif /* if(pdata->port == MESON_SDIO_PORT_A) */ /* wifi_setup_dt(); */