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: 130683 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A36431007D4 for ; Mon, 12 Dec 2011 21:09:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936Ab1LLKJh (ORCPT ); Mon, 12 Dec 2011 05:09:37 -0500 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:27950 "EHLO TX2EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864Ab1LLKJg (ORCPT ); Mon, 12 Dec 2011 05:09:36 -0500 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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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;