From patchwork Wed Jan 30 23:05:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 2070071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B91373FD1A for ; Wed, 30 Jan 2013 23:08:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0giX-0005u4-H2; Wed, 30 Jan 2013 23:05:21 +0000 Received: from quartz.orcorp.ca ([184.70.90.242]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U0giV-0005tP-9b for linux-arm-kernel@lists.infradead.org; Wed, 30 Jan 2013 23:05:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=YKUeUPzyKJo6w9oaYTPf65EAAKgiNhDQFAWJdZSPhbE=; b=j/QPTAeLNz3vzNVQIcucKJULDoyc0lVL/zkPXF2SR2+FN51ZeLZl2kxIvhGMaeYuN91l6tbMYgEOEGwHHa9x5nWTKD8gpKqTaFxo21dT3Y4Bx9lrIOCbypmwfSLYvdXjLWWKBKQkNRgcp2peYhC5itvjY/sVX48QWbY/p9+MFBY=; Received: from [10.0.0.162] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U0giO-0006SC-NV; Wed, 30 Jan 2013 16:05:12 -0700 Received: from jgg by jggl.edm.orcorp.ca with local (Exim 4.76) (envelope-from ) id 1U0giU-00021z-PH; Wed, 30 Jan 2013 16:05:18 -0700 Date: Wed, 30 Jan 2013 16:05:18 -0700 From: Jason Gunthorpe To: Jason Cooper Subject: Re: [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock Message-ID: <20130130230518.GA7395@obsidianresearch.com> References: <20130127144610.GW1758@titan.lakedaemon.net> <51053F81.6020904@gmail.com> <20130127152431.GX1758@titan.lakedaemon.net> <20130128223148.GA10275@schnuecks.de> <20130129004824.GB7717@titan.lakedaemon.net> <20130129194243.GA30831@schnuecks.de> <51082C4E.5050903@gmail.com> <20130129203221.GG7717@titan.lakedaemon.net> <51083580.1010900@gmail.com> <20130130224300.GU7717@titan.lakedaemon.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130130224300.GU7717@titan.lakedaemon.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.162 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130130_180519_450638_46B162E6 X-CRM114-Status: GOOD ( 15.45 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, mturquette@linaro.org, Simon Baatz , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, Jan 30, 2013 at 05:43:00PM -0500, Jason Cooper wrote: > > On 01/29/2013 09:32 PM, Jason Cooper wrote: > > >On Tue, Jan 29, 2013 at 09:08:46PM +0100, Sebastian Hesselbarth wrote: > > >>Leaves Issue 3, gbe forgets about its MAC address when gated or powered > > >>down. That should be done with local-mac-address passed by DT enabled > > >>u-boot or any other (dirty) ATAG hack ;) > > > > > >A patch to mv643xx_eth to pull this from DT should solve this. > > Somewhere, Jason Gunthorpe shared his patch to do this. I'll poke > around for it and try to get it merged in. Yes, you asked for the doc update and I haven't had a moment to get a tree setup for that.. Here are some words though: - local-mac-address : Optional, the MAC address to assign to the device. If not specified then the MAC address in the HW registers is used, but the driver can not be made modular. Signed-off-by: Jason Gunthorpe diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 7048d7c..2b2cfcb 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2891,6 +2891,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev) struct mv643xx_eth_private *mp; struct net_device *dev; struct resource *res; + const u8 *mac; + int len; int err; if (pdev->dev.of_node) { @@ -2912,6 +2914,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev) else pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT; + mac = of_get_property(pdev->dev.of_node, "local-mac-address", &len); + if (mac && len == 6) + memcpy(pd->mac_addr, mac, sizeof pd->mac_addr); + np = of_parse_phandle(pdev->dev.of_node, "mdio", 0); if (np) { pd->shared = of_find_device_by_node(np);