mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
cddd459140
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release which was tagged LSDK-20.04-V5.4. https://source.codeaurora.org/external/qoriq/qoriq-components/linux/ For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in LSDK, port the dts patches from 4.14. The patches are sorted into the following categories: 301-arch-xxxx 302-dts-xxxx 303-core-xxxx 701-net-xxxx 801-audio-xxxx 802-can-xxxx 803-clock-xxxx 804-crypto-xxxx 805-display-xxxx 806-dma-xxxx 807-gpio-xxxx 808-i2c-xxxx 809-jailhouse-xxxx 810-keys-xxxx 811-kvm-xxxx 812-pcie-xxxx 813-pm-xxxx 814-qe-xxxx 815-sata-xxxx 816-sdhc-xxxx 817-spi-xxxx 818-thermal-xxxx 819-uart-xxxx 820-usb-xxxx 821-vfio-xxxx Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
73 lines
2.1 KiB
Diff
73 lines
2.1 KiB
Diff
From 0f5cf5dcc3ca4f8e610ebe1e62e3d3546b9d09ca Mon Sep 17 00:00:00 2001
|
|
From: Yangbo Lu <yangbo.lu@nxp.com>
|
|
Date: Mon, 16 Sep 2019 19:17:44 +0800
|
|
Subject: [PATCH] mmc: sdhci-of-esdhc: poll ESDHC_FLUSH_ASYNC_FIFO bit until
|
|
completion
|
|
|
|
The ESDHC_FLUSH_ASYNC_FIFO bit which is set to flush asynchronous FIFO
|
|
should be polled until it's auto cleared by hardware.
|
|
|
|
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
|
---
|
|
drivers/mmc/host/sdhci-of-esdhc.c | 35 ++++++++++++++++++++++++++++-------
|
|
1 file changed, 28 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/mmc/host/sdhci-of-esdhc.c
|
|
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
|
|
@@ -591,6 +591,32 @@ static void esdhc_clock_enable(struct sd
|
|
}
|
|
}
|
|
|
|
+static void esdhc_flush_async_fifo(struct sdhci_host *host)
|
|
+{
|
|
+ ktime_t timeout;
|
|
+ u32 val;
|
|
+
|
|
+ val = sdhci_readl(host, ESDHC_DMA_SYSCTL);
|
|
+ val |= ESDHC_FLUSH_ASYNC_FIFO;
|
|
+ sdhci_writel(host, val, ESDHC_DMA_SYSCTL);
|
|
+
|
|
+ /* Wait max 20 ms */
|
|
+ timeout = ktime_add_ms(ktime_get(), 20);
|
|
+ while (1) {
|
|
+ bool timedout = ktime_after(ktime_get(), timeout);
|
|
+
|
|
+ if (!(sdhci_readl(host, ESDHC_DMA_SYSCTL) &
|
|
+ ESDHC_FLUSH_ASYNC_FIFO))
|
|
+ break;
|
|
+ if (timedout) {
|
|
+ pr_err("%s: flushing asynchronous FIFO timeout.\n",
|
|
+ mmc_hostname(host->mmc));
|
|
+ break;
|
|
+ }
|
|
+ usleep_range(10, 20);
|
|
+ }
|
|
+}
|
|
+
|
|
static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
|
|
{
|
|
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
|
@@ -683,9 +709,7 @@ static void esdhc_of_set_clock(struct sd
|
|
sdhci_writel(host, temp | ESDHC_HS400_WNDW_ADJUST, ESDHC_TBCTL);
|
|
|
|
esdhc_clock_enable(host, false);
|
|
- temp = sdhci_readl(host, ESDHC_DMA_SYSCTL);
|
|
- temp |= ESDHC_FLUSH_ASYNC_FIFO;
|
|
- sdhci_writel(host, temp, ESDHC_DMA_SYSCTL);
|
|
+ esdhc_flush_async_fifo(host);
|
|
}
|
|
|
|
/* Wait max 20 ms */
|
|
@@ -852,10 +876,7 @@ static void esdhc_tuning_block_enable(st
|
|
u32 val;
|
|
|
|
esdhc_clock_enable(host, false);
|
|
-
|
|
- val = sdhci_readl(host, ESDHC_DMA_SYSCTL);
|
|
- val |= ESDHC_FLUSH_ASYNC_FIFO;
|
|
- sdhci_writel(host, val, ESDHC_DMA_SYSCTL);
|
|
+ esdhc_flush_async_fifo(host);
|
|
|
|
val = sdhci_readl(host, ESDHC_TBCTL);
|
|
if (enable)
|