From patchwork Tue Dec 13 08:24: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: 5624 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 9A52A23E04 for ; Tue, 13 Dec 2011 08:25:22 +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 7E264A187B8 for ; Tue, 13 Dec 2011 08:25:22 +0000 (UTC) Received: by bke17 with SMTP id 17so8770727bke.11 for ; Tue, 13 Dec 2011 00:25:22 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr11976541bkw.72.1323764722166; Tue, 13 Dec 2011 00:25:22 -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 hg2cs73477bkc; Tue, 13 Dec 2011 00:25:21 -0800 (PST) Received: by 10.68.190.202 with SMTP id gs10mr41985148pbc.5.1323764720405; Tue, 13 Dec 2011 00:25:20 -0800 (PST) Received: from TX2EHSOBE007.bigfish.com (tx2ehsobe004.messaging.microsoft.com. [65.55.88.14]) by mx.google.com with ESMTPS id 3si1424559pbr.127.2011.12.13.00.25.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 00:25:20 -0800 (PST) Received-SPF: neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=65.55.88.14; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail157-tx2-R.bigfish.com (10.9.14.250) by TX2EHSOBE007.bigfish.com (10.9.40.27) with Microsoft SMTP Server id 14.1.225.23; Tue, 13 Dec 2011 08:25:15 +0000 Received: from mail157-tx2 (localhost [127.0.0.1]) by mail157-tx2-R.bigfish.com (Postfix) with ESMTP id 539164C040A; Tue, 13 Dec 2011 08:25:15 +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 mail157-tx2 (localhost.localdomain [127.0.0.1]) by mail157-tx2 (MessageSwitch) id 1323764714923351_11413; Tue, 13 Dec 2011 08:25:14 +0000 (UTC) Received: from TX2EHSMHS005.bigfish.com (unknown [10.9.14.247]) by mail157-tx2.bigfish.com (Postfix) with ESMTP id DA3A1320019; Tue, 13 Dec 2011 08:25:14 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS005.bigfish.com (10.9.99.105) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 13 Dec 2011 08:25:10 +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; Tue, 13 Dec 2011 02:25:01 -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 pBD8Ov4I023727; Tue, 13 Dec 2011 02:24:58 -0600 (CST) From: Richard Zhao To: CC: , , , , , Subject: [PATCH 1/1] arm/imx6q-sabrelite: add enet phy ksz9021rn fixup Date: Tue, 13 Dec 2011 16:24:18 +0800 Message-ID: <1323764658-26381-1-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323757530-19402-1-git-send-email-richard.zhao@linaro.org> References: <1323757530-19402-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com tune phy RGMII pad skew. Signed-off-by: Richard Zhao --- arch/arm/mach-imx/mach-imx6q.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index d24d6c4..b3dcdcb 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include #include #include @@ -23,8 +25,27 @@ #include #include +/* 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 void __init imx6q_init_machine(void) { + if (of_machine_is_compatible("fsl,imx6q-sabrelite")) + phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, + ksz9021rn_phy_fixup); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); imx6q_pm_init();