From patchwork Wed Dec 14 01:26:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5646 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 1C62F23E01 for ; Wed, 14 Dec 2011 01:27:09 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 13BA3A1836D for ; Wed, 14 Dec 2011 01:27:09 +0000 (UTC) Received: by eeke52 with SMTP id e52so333470eek.11 for ; Tue, 13 Dec 2011 17:27:09 -0800 (PST) Received: by 10.204.157.12 with SMTP id z12mr106461bkw.18.1323826028853; Tue, 13 Dec 2011 17:27:08 -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 hg2cs97705bkc; Tue, 13 Dec 2011 17:27:08 -0800 (PST) Received: by 10.52.95.84 with SMTP id di20mr2833292vdb.63.1323826026609; Tue, 13 Dec 2011 17:27:06 -0800 (PST) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com. [216.32.181.181]) by mx.google.com with ESMTPS id k10si202173vcc.1.2011.12.13.17.27.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 17:27:06 -0800 (PST) Received-SPF: neutral (google.com: 216.32.181.181 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=216.32.181.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.181 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-ch1-R.bigfish.com (10.43.68.247) by CH1EHSOBE018.bigfish.com (10.43.70.68) with Microsoft SMTP Server id 14.1.225.23; Wed, 14 Dec 2011 01:27:07 +0000 Received: from mail90-ch1 (localhost [127.0.0.1]) by mail90-ch1-R.bigfish.com (Postfix) with ESMTP id 26EF72026A; Wed, 14 Dec 2011 01:27:07 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) 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-SS: 13, X-FB-DOMAIN-IP-MATCH: fail Received: from mail90-ch1 (localhost.localdomain [127.0.0.1]) by mail90-ch1 (MessageSwitch) id 1323826026869926_27776; Wed, 14 Dec 2011 01:27:06 +0000 (UTC) Received: from CH1EHSMHS026.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail90-ch1.bigfish.com (Postfix) with ESMTP id CABD6700047; Wed, 14 Dec 2011 01:27:06 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS026.bigfish.com (10.43.70.26) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 14 Dec 2011 01:27:06 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Tue, 13 Dec 2011 19:27:04 -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 pBE1QoVn015617; Tue, 13 Dec 2011 19:27:01 -0600 (CST) From: Richard Zhao To: CC: , , , , , Subject: [PATCH V3 4/4] arm/imx6q-sabrelite: add enet phy ksz9021rn fixup Date: Wed, 14 Dec 2011 09:26:47 +0800 Message-ID: <1323826007-17937-5-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323826007-17937-1-git-send-email-richard.zhao@linaro.org> References: <1323826007-17937-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com The default phy RGMII pad settings can not work, tune 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();