From patchwork Mon Dec 12 10:09:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5592 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4F2BD23E33 for ; Mon, 12 Dec 2011 10:09:41 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2A07DA18627 for ; Mon, 12 Dec 2011 10:09:41 +0000 (UTC) Received: by bke17 with SMTP id 17so6986640bke.11 for ; Mon, 12 Dec 2011 02:09:40 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr9439049bkw.72.1323684580787; Mon, 12 Dec 2011 02:09:40 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs43117bkc; Mon, 12 Dec 2011 02:09:40 -0800 (PST) Received: by 10.68.72.130 with SMTP id d2mr32382179pbv.115.1323684578085; Mon, 12 Dec 2011 02:09:38 -0800 (PST) Received: from TX2EHSOBE002.bigfish.com (tx2ehsobe001.messaging.microsoft.com. [65.55.88.11]) by mx.google.com with ESMTPS id z4si9086629pbp.34.2011.12.12.02.09.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 02:09:37 -0800 (PST) Received-SPF: neutral (google.com: 65.55.88.11 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=65.55.88.11; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.11 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail90-tx2-R.bigfish.com (10.9.14.248) by TX2EHSOBE002.bigfish.com (10.9.40.22) with Microsoft SMTP Server id 14.1.225.23; Mon, 12 Dec 2011 10:09:34 +0000 Received: from mail90-tx2 (localhost [127.0.0.1]) by mail90-tx2-R.bigfish.com (Postfix) with ESMTP id 8F7FB14023D; Mon, 12 Dec 2011 10:09:34 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail90-tx2 (localhost.localdomain [127.0.0.1]) by mail90-tx2 (MessageSwitch) id 1323684574185108_28384; Mon, 12 Dec 2011 10:09:34 +0000 (UTC) Received: from TX2EHSMHS038.bigfish.com (unknown [10.9.14.242]) by mail90-tx2.bigfish.com (Postfix) with ESMTP id 1F4E2420042; Mon, 12 Dec 2011 10:09:34 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS038.bigfish.com (10.9.99.138) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 12 Dec 2011 10:09:33 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.355.3; Mon, 12 Dec 2011 04:09:34 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pBCA9VLp005013; Mon, 12 Dec 2011 04:09:32 -0600 (CST) From: Richard Zhao To: CC: , , , , , , Richard Zhao Subject: [PATCH 1/1] net/fec: add KSZ9021RN phy fixup Date: Mon, 12 Dec 2011 18:09:18 +0800 Message-ID: <1323684558-16796-1-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com For imx6q sabrelite board, set phy RGMII pad skew. Signed-off-by: Richard Zhao --- drivers/net/ethernet/freescale/fec.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 112af9b..d3b4463 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -1513,6 +1513,21 @@ static inline void fec_reset_phy(struct platform_device *pdev) } #endif /* CONFIG_OF */ +/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ +static int ksz9021rn_phy_fixup(struct phy_device *phydev) +{ + /* min rx data delay */ + phy_write(phydev, 0x0b, 0x8105); + phy_write(phydev, 0x0c, 0x0000); + + /* max rx/tx clock delay, min rx/tx control delay */ + phy_write(phydev, 0x0b, 0x8104); + phy_write(phydev, 0x0c, 0xf0f0); + phy_write(phydev, 0x0b, 0x104); + + return 0; +} + static int __devinit fec_probe(struct platform_device *pdev) { @@ -1597,6 +1612,10 @@ fec_probe(struct platform_device *pdev) if (ret) goto failed_init; + /* register the PHY board fixup (for Micrel KSZ9021RN) */ + phy_register_fixup_for_uid(0x00221611, 0xfffffff0, + ksz9021rn_phy_fixup); + ret = fec_enet_mii_init(pdev); if (ret) goto failed_mii_init;