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: 2956961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6B67BFF0B for ; Fri, 27 Sep 2013 20:49:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB05B20351 for ; Fri, 27 Sep 2013 20:49:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C315D20336 for ; Fri, 27 Sep 2013 20:49:03 +0000 (UTC) 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 (-) 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-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); } }