From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753814AbcFTNNI (ORCPT ); Mon, 20 Jun 2016 09:13:08 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:55392 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752320AbcFTNMs (ORCPT ); Mon, 20 Jun 2016 09:12:48 -0400 Subject: Re: [PATCH 3/4] phy: rockchip-emmc: configure default output tap delay To: Brian Norris References: <1463092986-61777-1-git-send-email-briannorris@chromium.org> <1463092986-61777-3-git-send-email-briannorris@chromium.org> CC: Heiko Stuebner , , , Doug Anderson , Shawn Lin , , Brian Norris From: Kishon Vijay Abraham I Message-ID: <5767EB98.2030908@ti.com> Date: Mon, 20 Jun 2016 18:41:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1463092986-61777-3-git-send-email-briannorris@chromium.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 13 May 2016 04:13 AM, Brian Norris wrote: > 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 > Signed-off-by: Brian Norris Acked-by: Kishon Vijay Abraham I > --- > drivers/phy/phy-rockchip-emmc.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c > index 5641dede32f6..f94d3a6587ed 100644 > --- a/drivers/phy/phy-rockchip-emmc.c > +++ b/drivers/phy/phy-rockchip-emmc.c > @@ -69,6 +69,11 @@ > #define PHYCTRL_DR_66OHM 0x2 > #define PHYCTRL_DR_100OHM 0x3 > #define PHYCTRL_DR_40OHM 0x4 > +#define PHYCTRL_OTAPDLYENA 0x1 > +#define PHYCTRL_OTAPDLYENA_MASK 0x1 > +#define PHYCTRL_OTAPDLYENA_SHIFT 0xb > +#define PHYCTRL_OTAPDLYSEL_MASK 0xf > +#define PHYCTRL_OTAPDLYSEL_SHIFT 0x7 > > struct rockchip_emmc_phy { > unsigned int reg_offset; > @@ -181,6 +186,20 @@ static int rockchip_emmc_phy_power_on(struct phy *phy) > PHYCTRL_DR_MASK, > PHYCTRL_DR_SHIFT)); > > + /* Output tap delay: enable */ > + regmap_write(rk_phy->reg_base, > + rk_phy->reg_offset + GRF_EMMCPHY_CON0, > + HIWORD_UPDATE(PHYCTRL_OTAPDLYENA, > + PHYCTRL_OTAPDLYENA_MASK, > + PHYCTRL_OTAPDLYENA_SHIFT)); > + > + /* Output tap delay */ > + regmap_write(rk_phy->reg_base, > + rk_phy->reg_offset + GRF_EMMCPHY_CON0, > + HIWORD_UPDATE(4, > + PHYCTRL_OTAPDLYSEL_MASK, > + PHYCTRL_OTAPDLYSEL_SHIFT)); > + > /* Power up emmc phy analog blocks */ > ret = rockchip_emmc_phy_power(rk_phy, PHYCTRL_PDB_PWR_ON); > if (ret) >