diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0594-amd-eMMC-sdhci-HS400-workaround-for-ZP.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0594-amd-eMMC-sdhci-HS400-workaround-for-ZP.patch | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0594-amd-eMMC-sdhci-HS400-workaround-for-ZP.patch b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0594-amd-eMMC-sdhci-HS400-workaround-for-ZP.patch new file mode 100644 index 00000000..0307e129 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0594-amd-eMMC-sdhci-HS400-workaround-for-ZP.patch @@ -0,0 +1,149 @@ +From a54d6dc90a41ca4b0aad8afb32ffe4eb82b4173d Mon Sep 17 00:00:00 2001 +From: Sudheesh Mavila <sudheesh.mavila@amd.com> +Date: Tue, 22 Jan 2019 23:01:45 +0530 +Subject: [PATCH 0594/2940] amd-eMMC sdhci HS400 workaround for ZP + +Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com> +--- + drivers/mmc/core/mmc.c | 12 ++++++++++-- + drivers/mmc/host/sdhci-acpi.c | 1 + + drivers/mmc/host/sdhci.c | 9 +++++++++ + drivers/mmc/host/sdhci.h | 1 + + include/linux/mmc/host.h | 1 + + 5 files changed, 22 insertions(+), 2 deletions(-) + mode change 100644 => 100755 drivers/mmc/core/mmc.c + mode change 100644 => 100755 drivers/mmc/host/sdhci-acpi.c + mode change 100644 => 100755 drivers/mmc/host/sdhci.c + mode change 100644 => 100755 include/linux/mmc/host.h + +diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c +old mode 100644 +new mode 100755 +index bc1bd2c25613..48f476a902e0 +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -1165,7 +1165,9 @@ static int mmc_select_hs400(struct mmc_card *card) + mmc_hostname(host), err); + return err; + } ++ /*In AMD Platform due to hardware ip issue this fails*/ + ++ if (!host->ops->set_hs400_dll) { + /* Set host controller to HS timing */ + mmc_set_timing(card->host, MMC_TIMING_MMC_HS); + +@@ -1176,7 +1178,7 @@ static int mmc_select_hs400(struct mmc_card *card) + /* Reduce frequency to HS frequency */ + max_dtr = card->ext_csd.hs_max_dtr; + mmc_set_clock(host, max_dtr); +- ++ } + err = mmc_switch_status(card); + if (err) + goto out_err; +@@ -1216,6 +1218,8 @@ static int mmc_select_hs400(struct mmc_card *card) + if (host->ops->hs400_complete) + host->ops->hs400_complete(host); + ++ if (host->ops->set_hs400_dll) ++ host->ops->set_hs400_dll(host); + return 0; + + out_err: +@@ -1238,6 +1242,7 @@ int mmc_hs400_to_hs200(struct mmc_card *card) + + /* Reduce frequency to HS */ + max_dtr = card->ext_csd.hs_max_dtr; ++ if (!host->ops->set_hs400_dll) + mmc_set_clock(host, max_dtr); + + /* Switch HS400 to HS DDR */ +@@ -1247,12 +1252,15 @@ int mmc_hs400_to_hs200(struct mmc_card *card) + true, false, true); + if (err) + goto out_err; +- ++ /*In AMD Platform due to hardware ip issue this fails*/ ++ if (!host->ops->set_hs400_dll) ++ { + mmc_set_timing(host, MMC_TIMING_MMC_DDR52); + + err = mmc_switch_status(card); + if (err) + goto out_err; ++ } + + /* Switch HS DDR to HS */ + err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, +diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c +old mode 100644 +new mode 100755 +index c61109f7b793..6dbfe9c5fe42 +--- a/drivers/mmc/host/sdhci-acpi.c ++++ b/drivers/mmc/host/sdhci-acpi.c +@@ -526,6 +526,7 @@ static const struct sdhci_ops sdhci_acpi_ops_amd = { + .set_bus_width = sdhci_set_bus_width, + .reset = sdhci_reset, + .set_uhs_signaling = sdhci_set_uhs_signaling, ++ .set_hs400_dll = sdhci_acpi_amd_hs400_dll, + }; + + static const struct sdhci_acpi_chip sdhci_acpi_chip_amd = { +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +old mode 100644 +new mode 100755 +index 55a84e79d591..83b25a3af9a1 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -2055,6 +2055,14 @@ static void sdhci_hw_reset(struct mmc_host *mmc) + host->ops->hw_reset(host); + } + ++static void sdhci_set_hs400_dll(struct mmc_host *mmc) ++{ ++ struct sdhci_host *host = mmc_priv(mmc); ++ ++ if (host->ops && host->ops->set_hs400_dll) ++ host->ops->set_hs400_dll(host); ++} ++ + static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) + { + if (!(host->flags & SDHCI_DEVICE_DEAD)) { +@@ -2543,6 +2551,7 @@ static const struct mmc_host_ops sdhci_ops = { + .get_cd = sdhci_get_cd, + .get_ro = sdhci_get_ro, + .hw_reset = sdhci_hw_reset, ++ .set_hs400_dll = sdhci_set_hs400_dll, + .enable_sdio_irq = sdhci_enable_sdio_irq, + .start_signal_voltage_switch = sdhci_start_signal_voltage_switch, + .prepare_hs400_tuning = sdhci_prepare_hs400_tuning, +diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h +index 65fe35e9673d..716a0d082cd9 100755 +--- a/drivers/mmc/host/sdhci.h ++++ b/drivers/mmc/host/sdhci.h +@@ -627,6 +627,7 @@ struct sdhci_ops { + int (*platform_execute_tuning)(struct sdhci_host *host, u32 opcode); + void (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); + void (*hw_reset)(struct sdhci_host *host); ++ void (*set_hs400_dll)(struct sdhci_host *host); + void (*adma_workaround)(struct sdhci_host *host, u32 intmask); + void (*card_event)(struct sdhci_host *host); + void (*voltage_switch)(struct sdhci_host *host); +diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h +old mode 100644 +new mode 100755 +index beed7121c781..80dfd22cba96 +--- a/include/linux/mmc/host.h ++++ b/include/linux/mmc/host.h +@@ -160,6 +160,7 @@ struct mmc_host_ops { + unsigned int max_dtr, int host_drv, + int card_drv, int *drv_type); + void (*hw_reset)(struct mmc_host *host); ++ void (*set_hs400_dll)(struct mmc_host *host); + void (*card_event)(struct mmc_host *host); + + /* +-- +2.17.1 + |