From patchwork Fri Sep 27 20:43:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 278683 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 686FB2C0336 for ; Sat, 28 Sep 2013 06:49:13 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPey5-0006AV-HV; Fri, 27 Sep 2013 20:48:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPey3-0008Bp-4Y; Fri, 27 Sep 2013 20:48:51 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPexz-0008BV-1Q for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2013 20:48:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=z+wbN48N2+ILx5TZ07XEZzxjsjZjRVWLkwVJE4WKXRk=; b=cmwBhojl7pIyCM/wZxgfEXZrZjfnH5MmiYQqRcjntH+i4sSNtoiDcO0aZ8lV34ZH0f0mFLRFI2soZ0DBx2cKEhcPQralHpB+3u2hcqqakeEmUzE5weOLrMDeukFElYmf+W5ZkIsgGG9f0SKsrev0cU/VBaljNNn1kFwgQdOOfCQ=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:44897) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1VPesb-0007Xt-EJ; Fri, 27 Sep 2013 21:43:13 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1VPesY-0006gy-FX; Fri, 27 Sep 2013 21:43:10 +0100 Date: Fri, 27 Sep 2013 21:43:09 +0100 From: Russell King - ARM Linux To: Matt Sealey Subject: Re: device tree binding documentation outdated Message-ID: <20130927204309.GJ12758@n2100.arm.linux.org.uk> References: <20130926195158.GS12758@n2100.arm.linux.org.uk> <20130926205906.GT12758@n2100.arm.linux.org.uk> <20130926232907.GV12758@n2100.arm.linux.org.uk> <20130927131554.GB31178@titan.lakedaemon.net> <20130927170552.GC12758@n2100.arm.linux.org.uk> <20130927183101.GE12758@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130927_164848_022404_28F45868 X-CRM114-Status: GOOD ( 29.69 ) X-Spam-Score: -1.0 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Cc: "devicetree@vger.kernel.org" , Shawn Guo , Fabio Estevam , Jason Cooper , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Fri, Sep 27, 2013 at 03:16:48PM -0500, Matt Sealey wrote: > On Fri, Sep 27, 2013 at 1:52 PM, Fabio Estevam wrote: > > On Fri, Sep 27, 2013 at 3:31 PM, Russell King - ARM Linux > > wrote: > >> On Fri, Sep 27, 2013 at 06:05:52PM +0100, Russell King - ARM Linux wrote: > > > >> An interesting data point. Connect it to a 100mbit switch and it works. > >> gigabit and it behaves as above. > >> > >> So, the question is: does anyone have gigabit networking working on imx6 > >> with recent DT based kernels? > > > > Yes, we have Gigabit ethernet working on mx6sabrelite, wandboard, > > sabresd boards. > > > > Does the 3.0.35 kernel work with gigabit on cubox-i? Could this issue > > be related to the ar8035 phy fixup code? > > The AR8035 has a PHY ID of 0x004dd072 and the code in the i.MX6 > platform stuff specifies 0x004dd074 - so if it's really an 8035 then > it's not being run.. I've had this in my kernel since earlier today, after a previous comment about where to add this fixup. You may notice that I said earlier in this thread - around 1pm UK time - that I'd already confirmed that *this* fixup function *is* being run, and I even quoted this code in that email... :) As for "if it's really" I really have read the numbers off the top of the chip and it "really" is an AR8035. I wouldn't have the data sheet and been probing its pads directly. The phy is mounted between the MX6 (the big chip) and the HDMI connector. It's crystal is immediately beside it. At this point I'm going to say: please do not make the mistake of thinking I'm just a software engineer. I'm not. I'm a hardware engineer who still designs stuff from time to time. diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 85a1b51..4da6c68 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -164,6 +164,46 @@ static int ar8031_phy_fixup(struct phy_device *dev) #define PHY_ID_AR8031 0x004dd074 +static int ar8035_phy_fixup(struct phy_device *dev) +{ + u16 val; + + /* Ar803x phy SmartEEE feature cause link status generates glitch, + * which cause ethernet link down/up issue, so disable SmartEEE + */ + phy_write(dev, 0xd, 0x3); + phy_write(dev, 0xe, 0x805d); + phy_write(dev, 0xd, 0x4003); + + val = phy_read(dev, 0xe); + phy_write(dev, 0xe, val & ~(1 << 8)); + + /* To enable AR8031 output a 125MHz clk from CLK_25M */ + phy_write(dev, 0xd, 0x7); + phy_write(dev, 0xe, 0x8016); + phy_write(dev, 0xd, 0x4007); + + val = phy_read(dev, 0xe); + val &= 0xffe3; + val |= 0x18; + phy_write(dev, 0xe, val); + + /* introduce tx clock delay */ + phy_write(dev, 0x1d, 0x5); + val = phy_read(dev, 0x1e); + val |= 0x0100; + phy_write(dev, 0x1e, val); + + /*check phy power*/ + val = phy_read(dev, 0x0); + if (val & BMCR_PDOWN) + phy_write(dev, 0x0, val & ~BMCR_PDOWN); + + return 0; +} + +#define PHY_ID_AR8035 0x004dd072 + static void __init imx6q_enet_phy_init(void) { if (IS_BUILTIN(CONFIG_PHYLIB)) { @@ -173,6 +213,8 @@ static void __init imx6q_enet_phy_init(void) ksz9031rn_phy_fixup); phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, ar8031_phy_fixup); + phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef, + ar8035_phy_fixup); } }