From patchwork Mon Jul 7 21:03:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 4497921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B9A8BEEAA for ; Mon, 7 Jul 2014 21:07:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EE7A20148 for ; Mon, 7 Jul 2014 21:07:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95EB520131 for ; Mon, 7 Jul 2014 21:07:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4G5G-0005IX-W4; Mon, 07 Jul 2014 21:04:22 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4G5C-0005FR-R4 for linux-arm-kernel@lists.infradead.org; Mon, 07 Jul 2014 21:04:20 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id C26BC81AC2; Mon, 7 Jul 2014 23:03:53 +0200 (CEST) Date: Mon, 7 Jul 2014 23:03:53 +0200 From: Pavel Machek To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sergei.shtylyov@cogentembedded.com, davem@davemloft.net, kernel@pengutronix.de, shawn.guo@freescale.com, plagnioj@jcrosoft.com, nicolas.ferre@atmel.com, linux@maxim.org.za, netdev@vger.kernel.org, dinguyen@altera.com Subject: [PATCH] micrel phy: fix typo in define, point people to device tree Message-ID: <20140707210353.GA29415@amd.pavel.ucw.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140707_140419_065302_4D9507E7 X-CRM114-Status: GOOD ( 15.70 ) X-Spam-Score: 0.0 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's typo "SCEW" in some defines, which made my greps fail and confused me a lot. Plus, Dinh Nguyen pointed out that direct phy accesses from board files should no longer be needed -- device tree should be able to configure skew. Signed-off-by: Pavel Machek diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 075ec05..528d3ce 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c @@ -50,12 +50,15 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy) { int value; + /* Should probably use dts to configure skew, see + micrel-ksz90x1.txt */ + /* Set delay values */ - value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW | 0x8000; + value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW | 0x8000; phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value); value = 0xF2F4; phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value); - value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW | 0x8000; + value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW | 0x8000; phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value); value = 0x2222; phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index e60456d..fa6c7ad 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -42,18 +42,19 @@ /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ static int ksz9021rn_phy_fixup(struct phy_device *phydev) { + /* Should probably use dt to set these, see micrel-ksz90x1.txt */ if (IS_BUILTIN(CONFIG_PHYLIB)) { /* min rx data delay */ phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - 0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW); + 0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW); phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0x0000); /* max rx/tx clock delay, min rx/tx control delay */ phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - 0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW); + 0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW); phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0xf0f0); phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW); + MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW); } return 0; --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h @@ -38,9 +38,12 @@ /* struct phy_device dev_flags definitions */ #define MICREL_PHY_50MHZ_CLK 0x00000001 +/* These probably should not be exported; see micrel-ksz90x1.txt on + how to configure skew from device tree. */ #define MICREL_KSZ9021_EXTREG_CTRL 0xB #define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC -#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104 -#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW 0x105 +#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW 0x104 +#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW 0x105 +#define MICREL_KSZ9021_RGMII_TX_DATA_PAD_SKEW 0x106 #endif /* _MICREL_PHY_H */