Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1426894

[PATCH v3 03/15] phy: rockchip-emmc: configure default output tap delay

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Douglas Anderson <dianders@chromium.org>
Newsgroups linux.kernel
Subject [PATCH v3 03/15] phy: rockchip-emmc: configure default output tap delay
Date Mon, 20 Jun 2016 20:10:02 +0200
Message-ID <rMbO2-3aM-27@gated-at.bofh.it> (permalink)
References <rMbO2-3aM-21@gated-at.bofh.it>
X-Original-To ulf.hansson@linaro.org, Heiko Stuebner <heiko@sntech.de>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lLIJocY1KZ2robeCeYcgKI3vQOzrfKxkJmorzaolbpY=; b=CS89jYMbJevIGUNjffW0uzZxHn7ojozm8voQrU1NbdHgOYtLGtx5+ZTDFXvNh7qQ7Y wzPeBAqUgEdQ5jit+uL+32busGOoUiOjKbtUVg2kx8561pNk/0+hqt0ec/qv9vjuLZQe /r4vT/1yLYdtnkDS/xtv+SKHvO/z4i4ZIqC0Q=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lLIJocY1KZ2robeCeYcgKI3vQOzrfKxkJmorzaolbpY=; b=UBZHOrvcPsWj5aN2CPbfaxJveCb543GUT4n4l/jFXWmaVSfgp33KQTKhZO2D+xOKgF SEbDNCXcfYB65mQeL5HEZm7xFVcs2SZdExvZE/NgzkGQdPwGRNZUIMmZ1UcA3ofMKez2 G9Vl4n/dab7WnfrquDt9UXdYMNrek4HMd6fj0pqoouOCxDZNJ8pXR/6Y1+4+YUfqX+Tl l2QTE360BZ+9TqE6tG+fvXGYEt84VkB89hDoQyoxc+YqJw5jIrZlZU4fPG8zT9Z52iBo VRtoQjMhDGxK5aaXbuEzmd5mpmb/iKv0/ZeldTHo7UGHTQ1Md8r1Rt4DrZk24LtMtSeb wvdA==
X-Gm-Message-State ALyK8tLbwnpcD8wcF1u1x6q5awB9LFX7Ox0iWUE/91s7EPnBlr6Jcwze2k8KVP2DYeSbvjSu
X-Received by 10.98.47.129 with SMTP id v123mr22493276pfv.71.1466445635593; Mon, 20 Jun 2016 11:00:35 -0700 (PDT)
X-Mailer git-send-email 2.8.0.rc3.226.g39d4020
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 63
Organization linux.* mail to news gateway
X-Original-Cc kishon@ti.com, robh+dt@kernel.org, shawn.lin@rock-chips.com, xzy.xu@rock-chips.com, briannorris@chromium.org, adrian.hunter@intel.com, linux-rockchip@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, groeck@chromium.org, Douglas Anderson <dianders@chromium.org>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
X-Original-Date Mon, 20 Jun 2016 10:56:42 -0700
X-Original-Message-ID <1466445414-11974-4-git-send-email-dianders@chromium.org>
X-Original-References <1466445414-11974-1-git-send-email-dianders@chromium.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1426894

Show key headers only | View raw


From: Brian Norris <briannorris@chromium.org>

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>
---
Changes in v3:
- Add Brian's PHY patches into my series

Changes in v2: None

 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 f2f75cf69af1..a0b87cc6c818 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)
-- 
2.8.0.rc3.226.g39d4020

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 03/15] phy: rockchip-emmc: configure default output tap delay Douglas Anderson <dianders@chromium.org> - 2016-06-20 20:10 +0200

csiph-web