aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2016-06-20 13:56:42 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-07-25 04:34:15 -0400
commit36b5d460261f16563f9196c49c936b3e17d237e3 (patch)
tree649f80a4b0422946e2023d549fc6c49a6db02eb8 /drivers/phy
parentd74857720d41c58f74966b5d06ebfa9111a62c69 (diff)
phy: rockchip-emmc: configure default output tap delay
The output tap delay controls helps maintain the hold requirements for eMMC. The exact value is dependent on the SoC and other factors, though it isn't really an exact science. But the default of 0 is not very good, as it doesn't give the eMMC much hold time, so let's bump up to 4 (approx 90 degree phase?). If we need to configure this any further (e.g., based on board or speed factors), we may need to consider a device tree representation. Suggested-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-rockchip-emmc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c
index f2f75cf69af1..a0b87cc6c818 100644
--- a/drivers/phy/phy-rockchip-emmc.c
+++ b/drivers/phy/phy-rockchip-emmc.c
@@ -69,6 +69,11 @@
69#define PHYCTRL_DR_66OHM 0x2 69#define PHYCTRL_DR_66OHM 0x2
70#define PHYCTRL_DR_100OHM 0x3 70#define PHYCTRL_DR_100OHM 0x3
71#define PHYCTRL_DR_40OHM 0x4 71#define PHYCTRL_DR_40OHM 0x4
72#define PHYCTRL_OTAPDLYENA 0x1
73#define PHYCTRL_OTAPDLYENA_MASK 0x1
74#define PHYCTRL_OTAPDLYENA_SHIFT 0xb
75#define PHYCTRL_OTAPDLYSEL_MASK 0xf
76#define PHYCTRL_OTAPDLYSEL_SHIFT 0x7
72 77
73struct rockchip_emmc_phy { 78struct rockchip_emmc_phy {
74 unsigned int reg_offset; 79 unsigned int reg_offset;
@@ -181,6 +186,20 @@ static int rockchip_emmc_phy_power_on(struct phy *phy)
181 PHYCTRL_DR_MASK, 186 PHYCTRL_DR_MASK,
182 PHYCTRL_DR_SHIFT)); 187 PHYCTRL_DR_SHIFT));
183 188
189 /* Output tap delay: enable */
190 regmap_write(rk_phy->reg_base,
191 rk_phy->reg_offset + GRF_EMMCPHY_CON0,
192 HIWORD_UPDATE(PHYCTRL_OTAPDLYENA,
193 PHYCTRL_OTAPDLYENA_MASK,
194 PHYCTRL_OTAPDLYENA_SHIFT));
195
196 /* Output tap delay */
197 regmap_write(rk_phy->reg_base,
198 rk_phy->reg_offset + GRF_EMMCPHY_CON0,
199 HIWORD_UPDATE(4,
200 PHYCTRL_OTAPDLYSEL_MASK,
201 PHYCTRL_OTAPDLYSEL_SHIFT));
202
184 /* Power up emmc phy analog blocks */ 203 /* Power up emmc phy analog blocks */
185 ret = rockchip_emmc_phy_power(rk_phy, PHYCTRL_PDB_PWR_ON); 204 ret = rockchip_emmc_phy_power(rk_phy, PHYCTRL_PDB_PWR_ON);
186 if (ret) 205 if (ret)