aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-04-10 10:47:05 +0800
committerPetr Štetiar <ynezz@true.cz>2020-05-07 12:53:06 +0200
commitcddd4591404fb4c53dc0b3c0b15b942cdbed4356 (patch)
tree392c1179de46b0f804e3789edca19069b64e6b44 /target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch
parentd1d2c0b5579ea4f69a42246c9318539d61ba1999 (diff)
downloadupstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.gz
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.bz2
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.zip
layerscape: add patches-5.4
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>
Diffstat (limited to 'target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch')
-rw-r--r--target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch
new file mode 100644
index 0000000000..74dd63d8e5
--- /dev/null
+++ b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch
@@ -0,0 +1,77 @@
+From e95c04bd6d9ebe081126184fb228461b1b3fa7aa Mon Sep 17 00:00:00 2001
+From: Yangbo Lu <yangbo.lu@nxp.com>
+Date: Thu, 12 Dec 2019 15:52:18 +0800
+Subject: [PATCH] LF-605 mmc: sdhci-of-esdhc: convert to use
+ esdhc_tuning_window_ptr()
+
+Convert to use a new function esdhc_tuning_window_ptr() to
+get tuning window start point and end point.
+
+Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+---
+ drivers/mmc/host/sdhci-of-esdhc.c | 34 +++++++++++++++++++++-------------
+ 1 file changed, 21 insertions(+), 13 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-of-esdhc.c
++++ b/drivers/mmc/host/sdhci-of-esdhc.c
+@@ -888,20 +888,11 @@ static void esdhc_tuning_block_enable(st
+ esdhc_clock_enable(host, true);
+ }
+
+-static void esdhc_prepare_sw_tuning(struct sdhci_host *host, u8 *window_start,
++static void esdhc_tuning_window_ptr(struct sdhci_host *host, u8 *window_start,
+ u8 *window_end)
+ {
+- struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+- struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host);
+- u8 tbstat_15_8, tbstat_7_0;
+ u32 val;
+
+- if (esdhc->quirk_tuning_erratum_type1) {
+- *window_start = 5 * esdhc->div_ratio;
+- *window_end = 3 * esdhc->div_ratio;
+- return;
+- }
+-
+ /* Write TBCTL[11:8]=4'h8 */
+ val = sdhci_readl(host, ESDHC_TBCTL);
+ val &= ~(0xf << 8);
+@@ -920,6 +911,25 @@ static void esdhc_prepare_sw_tuning(stru
+ val = sdhci_readl(host, ESDHC_TBSTAT);
+ val = sdhci_readl(host, ESDHC_TBSTAT);
+
++ *window_end = val & 0xff;
++ *window_start = (val >> 8) & 0xff;
++}
++
++static void esdhc_prepare_sw_tuning(struct sdhci_host *host, u8 *window_start,
++ u8 *window_end)
++{
++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
++ struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host);
++ u8 start_ptr, end_ptr;
++
++ if (esdhc->quirk_tuning_erratum_type1) {
++ *window_start = 5 * esdhc->div_ratio;
++ *window_end = 3 * esdhc->div_ratio;
++ return;
++ }
++
++ esdhc_tuning_window_ptr(host, &start_ptr, &end_ptr);
++
+ /* Reset data lines by setting ESDHCCTL[RSTD] */
+ sdhci_reset(host, SDHCI_RESET_DATA);
+ /* Write 32'hFFFF_FFFF to IRQSTAT register */
+@@ -930,10 +940,8 @@ static void esdhc_prepare_sw_tuning(stru
+ * then program TBPTR[TB_WNDW_END_PTR] = 4 * div_ratio
+ * and program TBPTR[TB_WNDW_START_PTR] = 8 * div_ratio.
+ */
+- tbstat_7_0 = val & 0xff;
+- tbstat_15_8 = (val >> 8) & 0xff;
+
+- if (abs(tbstat_15_8 - tbstat_7_0) > (4 * esdhc->div_ratio)) {
++ if (abs(start_ptr - end_ptr) > (4 * esdhc->div_ratio)) {
+ *window_start = 8 * esdhc->div_ratio;
+ *window_end = 4 * esdhc->div_ratio;
+ } else {