Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-20 12:08:06 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-20 12:08:16 +0100
commitc17aa547fa1625cf952f55b51be23d46c264cd2c (patch)
treef6dde2087fcfefe31d8ad6a772f976b6972a08d6
parent5d547c14ad0dc8f680858b0bf2dc27e9b25ee436 (diff)
phy: rockchip-emmc: retry calpad busy trimming (bsc#1051510).
-rw-r--r--patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch78
-rw-r--r--series.conf1
2 files changed, 79 insertions, 0 deletions
diff --git a/patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch b/patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch
new file mode 100644
index 0000000000..cdb42ddaac
--- /dev/null
+++ b/patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch
@@ -0,0 +1,78 @@
+From a4781c2a74b249cad814ceea7272997bbd20051e Mon Sep 17 00:00:00 2001
+From: Shawn Lin <shawn.lin@rock-chips.com>
+Date: Thu, 11 Jan 2018 10:40:26 +0800
+Subject: [PATCH] phy: rockchip-emmc: retry calpad busy trimming
+Git-commit: a4781c2a74b249cad814ceea7272997bbd20051e
+Patch-mainline: v4.17-rc1
+References: bsc#1051510
+
+It turns out that 5us isn't enough for all cases, so let's
+retry some more times to wait for caldone.
+
+Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
+Tested-by: Ziyuan Xu <xzy.xu@rock-chips.com>
+Signed-off-by: Caesar Wang <wxt@rock-chips.com>
+Reviewed-by: Douglas Anderson <dianders@chromium.org>
+Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/phy/rockchip/phy-rockchip-emmc.c | 27 +++++++++++++++++----------
+ 1 file changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c
+index f1b24f18e9b2..b0d10934413f 100644
+--- a/drivers/phy/rockchip/phy-rockchip-emmc.c
++++ b/drivers/phy/rockchip/phy-rockchip-emmc.c
+@@ -76,6 +76,10 @@
+ #define PHYCTRL_OTAPDLYSEL_MASK 0xf
+ #define PHYCTRL_OTAPDLYSEL_SHIFT 0x7
+
++#define PHYCTRL_IS_CALDONE(x) \
++ ((((x) >> PHYCTRL_CALDONE_SHIFT) & \
++ PHYCTRL_CALDONE_MASK) == PHYCTRL_CALDONE_DONE)
++
+ struct rockchip_emmc_phy {
+ unsigned int reg_offset;
+ struct regmap *reg_base;
+@@ -90,6 +94,7 @@ static int rockchip_emmc_phy_power(struct phy *phy, bool on_off)
+ unsigned int freqsel = PHYCTRL_FREQSEL_200M;
+ unsigned long rate;
+ unsigned long timeout;
++ int ret;
+
+ /*
+ * Keep phyctrl_pdb and phyctrl_endll low to allow
+@@ -160,17 +165,19 @@ static int rockchip_emmc_phy_power(struct phy *phy, bool on_off)
+ PHYCTRL_PDB_SHIFT));
+
+ /*
+- * According to the user manual, it asks driver to
+- * wait 5us for calpad busy trimming
++ * According to the user manual, it asks driver to wait 5us for
++ * calpad busy trimming. However it is documented that this value is
++ * PVT(A.K.A process,voltage and temperature) relevant, so some
++ * failure cases are found which indicates we should be more tolerant
++ * to calpad busy trimming.
+ */
+- udelay(5);
+- regmap_read(rk_phy->reg_base,
+- rk_phy->reg_offset + GRF_EMMCPHY_STATUS,
+- &caldone);
+- caldone = (caldone >> PHYCTRL_CALDONE_SHIFT) & PHYCTRL_CALDONE_MASK;
+- if (caldone != PHYCTRL_CALDONE_DONE) {
+- pr_err("rockchip_emmc_phy_power: caldone timeout.\n");
+- return -ETIMEDOUT;
++ ret = regmap_read_poll_timeout(rk_phy->reg_base,
++ rk_phy->reg_offset + GRF_EMMCPHY_STATUS,
++ caldone, PHYCTRL_IS_CALDONE(caldone),
++ 0, 50);
++ if (ret) {
++ pr_err("%s: caldone failed, ret=%d\n", __func__, ret);
++ return ret;
+ }
+
+ /* Set the frequency of the DLL operation */
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index e85b0330ab..cf26e1148f 100644
--- a/series.conf
+++ b/series.conf
@@ -14839,6 +14839,7 @@
patches.drivers/usbip-Correct-maximum-value-of-CONFIG_USBIP_VHCI_HC_.patch
patches.fixes/0001-xhci-zero-usb-device-slot_id-member-when-disabling-a.patch
patches.drivers/phy-qcom-qmp-Fix-phy-pipe-clock-gating.patch
+ patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch
patches.drivers/USB-serial-ftdi_sio-add-RT-Systems-VX-8-cable.patch
patches.drivers/USB-serial-cp210x-add-ELDAT-Easywave-RX09-id.patch
patches.drivers/USB-serial-ftdi_sio-add-support-for-Harman-FirmwareH.patch