aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.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-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.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-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch')
-rw-r--r--target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch
new file mode 100644
index 0000000000..a391616cfb
--- /dev/null
+++ b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch
@@ -0,0 +1,90 @@
+From f3d460fb85677a5f62324771e5715ceb11726ecc Mon Sep 17 00:00:00 2001
+From: Yangbo Lu <yangbo.lu@nxp.com>
+Date: Thu, 12 Dec 2019 15:52:19 +0800
+Subject: [PATCH] LF-605 mmc: sdhci-of-esdhc: update tuning erratum A-008171
+
+There is an official update for eSDHC tuning erratum A-008171.
+This patch is to implement the changes,
+- Affect all revisions of SoC.
+- Changes for tuning window checking.
+- Hardware hits a new condition that tuning succeeds although
+ the eSDHC might not have tuned properly for type2 SoCs
+ (soc_tuning_erratum_type2[] array in driver). So check
+ tuning window after tuning succeeds.
+
+Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+---
+ drivers/mmc/host/sdhci-of-esdhc.c | 39 ++++++++++++++++++++++++++-------------
+ 1 file changed, 26 insertions(+), 13 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-of-esdhc.c
++++ b/drivers/mmc/host/sdhci-of-esdhc.c
+@@ -854,20 +854,20 @@ static int esdhc_signal_voltage_switch(s
+ }
+
+ static struct soc_device_attribute soc_tuning_erratum_type1[] = {
+- { .family = "QorIQ T1023", .revision = "1.0", },
+- { .family = "QorIQ T1040", .revision = "1.0", },
+- { .family = "QorIQ T2080", .revision = "1.0", },
+- { .family = "QorIQ LS1021A", .revision = "1.0", },
++ { .family = "QorIQ T1023", },
++ { .family = "QorIQ T1040", },
++ { .family = "QorIQ T2080", },
++ { .family = "QorIQ LS1021A", },
+ { },
+ };
+
+ static struct soc_device_attribute soc_tuning_erratum_type2[] = {
+- { .family = "QorIQ LS1012A", .revision = "1.0", },
+- { .family = "QorIQ LS1043A", .revision = "1.*", },
+- { .family = "QorIQ LS1046A", .revision = "1.0", },
+- { .family = "QorIQ LS1080A", .revision = "1.0", },
+- { .family = "QorIQ LS2080A", .revision = "1.0", },
+- { .family = "QorIQ LA1575A", .revision = "1.0", },
++ { .family = "QorIQ LS1012A", },
++ { .family = "QorIQ LS1043A", },
++ { .family = "QorIQ LS1046A", },
++ { .family = "QorIQ LS1080A", },
++ { .family = "QorIQ LS2080A", },
++ { .family = "QorIQ LA1575A", },
+ { },
+ };
+
+@@ -935,13 +935,13 @@ static void esdhc_prepare_sw_tuning(stru
+ /* Write 32'hFFFF_FFFF to IRQSTAT register */
+ sdhci_writel(host, 0xFFFFFFFF, SDHCI_INT_STATUS);
+
+- /* If TBSTAT[15:8]-TBSTAT[7:0] > 4 * div_ratio
+- * or TBSTAT[7:0]-TBSTAT[15:8] > 4 * div_ratio,
++ /* If TBSTAT[15:8]-TBSTAT[7:0] > (4 * div_ratio) + 2
++ * or TBSTAT[7:0]-TBSTAT[15:8] > (4 * div_ratio) + 2,
+ * then program TBPTR[TB_WNDW_END_PTR] = 4 * div_ratio
+ * and program TBPTR[TB_WNDW_START_PTR] = 8 * div_ratio.
+ */
+
+- if (abs(start_ptr - end_ptr) > (4 * esdhc->div_ratio)) {
++ if (abs(start_ptr - end_ptr) > (4 * esdhc->div_ratio + 2)) {
+ *window_start = 8 * esdhc->div_ratio;
+ *window_end = 4 * esdhc->div_ratio;
+ } else {
+@@ -1014,6 +1014,19 @@ static int esdhc_execute_tuning(struct m
+ if (ret)
+ break;
+
++ /* For type2 affected platforms of the tuning erratum,
++ * tuning may succeed although eSDHC might not have
++ * tuned properly. Need to check tuning window.
++ */
++ if (esdhc->quirk_tuning_erratum_type2 &&
++ !host->tuning_err) {
++ esdhc_tuning_window_ptr(host, &window_start,
++ &window_end);
++ if (abs(window_start - window_end) >
++ (4 * esdhc->div_ratio + 2))
++ host->tuning_err = -EAGAIN;
++ }
++
+ /* If HW tuning fails and triggers erratum,
+ * try workaround.
+ */