From patchwork Sun Jan 27 10:40:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Baatz X-Patchwork-Id: 2051541 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 BE0323FCDE for ; Sun, 27 Jan 2013 10:43:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TzPfP-0004dq-4t; Sun, 27 Jan 2013 10:40:51 +0000 Received: from mail-wg0-f45.google.com ([74.125.82.45]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TzPfC-0004bg-1g for linux-arm-kernel@lists.infradead.org; Sun, 27 Jan 2013 10:40:39 +0000 Received: by mail-wg0-f45.google.com with SMTP id dq12so1143747wgb.12 for ; Sun, 27 Jan 2013 02:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=9HnmG+KqjEC56ZPwY7uRZAD2/1c4c7nZVXm3UzxTYOY=; b=Aia3L8KHF14CRiBQWus/tsHzAOsKxnUKl04oY0Yq8PWeYTcOuGKMeWFSWEhB4qii1f NaiHFHFsMLwVbDFyPIKK/0EpECRMDcmN3+QxQQqNp3k2UbqmpJldGwB4H/rYAqm+pPGu i/uLmtDL3TaKVB1lCBbMboKkhOdyLn/nwNm7fQtfwjZkBlxFS0AaFAaenTxu188qD3DY KPjx4PXiHPQXVjwhxsdO9UkxRBMktkh8Harh2UQw9qqOqar28XkQDV9cCJydvwCN6rn5 u7XG4zw7Mh8B5A9S5krSaW+6iFN8Tglj/hRMX+p34BO8LJjDwbGo/FzgDTSyMo7jRWeA YoVw== X-Received: by 10.180.88.138 with SMTP id bg10mr4828962wib.13.1359283235900; Sun, 27 Jan 2013 02:40:35 -0800 (PST) Received: from gandalf.schnuecks.de (p5DE8D22A.dip.t-dialin.net. [93.232.210.42]) by mx.google.com with ESMTPS id be1sm7188003wib.10.2013.01.27.02.40.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Jan 2013 02:40:35 -0800 (PST) Received: by gandalf.schnuecks.de (Postfix, from userid 500) id 2AD5440156; Sun, 27 Jan 2013 11:40:33 +0100 (CET) From: Simon Baatz To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock Date: Sun, 27 Jan 2013 11:40:22 +0100 Message-Id: <1359283223-23082-2-git-send-email-gmbnomis@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359283223-23082-1-git-send-email-gmbnomis@gmail.com> References: <1359283223-23082-1-git-send-email-gmbnomis@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130127_054038_355052_ACC4E6D5 X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.45 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gmbnomis[at]gmail.com) -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, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com 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: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Commit 1611f87 (ARM: Kirkwood: switch to DT clock providers) broke the functions to initialize the ethernet interfaces (kirkwood_ge00_init() and kirkwood_ge01_init()). In the DT case, the functions could not enable the correct clocks. Fix this by looking up the clocks through the device name. Signed-off-by: Simon Baatz --- arch/arm/mach-kirkwood/common.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index bac21a5..2c97847 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -218,11 +218,10 @@ static struct clk __init *kirkwood_register_gate_fn(const char *name, bit_idx, 0, &gating_lock, fn_en, fn_dis); } -static struct clk *ge0, *ge1; void __init kirkwood_clk_init(void) { - struct clk *runit, *sata0, *sata1, *usb0, *sdio; + struct clk *runit, *ge0, *ge1, *sata0, *sata1, *usb0, *sdio; struct clk *crypto, *xor0, *xor1, *pex0, *pex1, *audio; tclk = clk_register_fixed_rate(NULL, "tclk", NULL, @@ -288,12 +287,15 @@ void __init kirkwood_ehci_init(void) ****************************************************************************/ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) { + struct clk *ge0; orion_ge00_init(eth_data, GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM, IRQ_KIRKWOOD_GE00_ERR, 1600); /* The interface forgets the MAC address assigned by u-boot if the clock is turned off, so claim the clk now. */ - clk_prepare_enable(ge0); + ge0 = clk_get_sys(MV643XX_ETH_NAME ".0", NULL); + if (!IS_ERR(ge0)) + clk_prepare_enable(ge0); } @@ -302,10 +304,13 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) ****************************************************************************/ void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data) { + struct clk *ge1; orion_ge01_init(eth_data, GE01_PHYS_BASE, IRQ_KIRKWOOD_GE01_SUM, IRQ_KIRKWOOD_GE01_ERR, 1600); - clk_prepare_enable(ge1); + ge1 = clk_get_sys(MV643XX_ETH_NAME ".1", NULL); + if (!IS_ERR(ge1)) + clk_prepare_enable(ge1); }