linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: gmbnomis@gmail.com (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	[thread overview]
Message-ID: <1359283223-23082-2-git-send-email-gmbnomis@gmail.com> (raw)
In-Reply-To: <1359283223-23082-1-git-send-email-gmbnomis@gmail.com>

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 <gmbnomis@gmail.com>
---
 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);
 }
 
 
-- 
1.7.9.5

  reply	other threads:[~2013-01-27 10:40 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27 10:40 [PATCH v2 0/2] Do not gate ge0/1 and runit clocks on Kirkwood Simon Baatz
2013-01-27 10:40 ` Simon Baatz [this message]
2013-01-27 10:52   ` [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock Sebastian Hesselbarth
2013-01-27 11:08     ` Simon Baatz
2013-01-27 11:18       ` Sebastian Hesselbarth
2013-01-27 14:19       ` Sebastian Hesselbarth
2013-01-27 14:46         ` Jason Cooper
2013-01-27 14:53           ` Sebastian Hesselbarth
2013-01-27 15:24             ` Jason Cooper
2013-01-28 22:31               ` Simon Baatz
2013-01-29  0:48                 ` Jason Cooper
2013-01-29 19:42                   ` Simon Baatz
2013-01-29 20:08                     ` Sebastian Hesselbarth
2013-01-29 20:32                       ` Jason Cooper
2013-01-29 20:48                         ` Sebastian Hesselbarth
2013-01-29 21:23                           ` Jason Cooper
2013-01-30 22:43                           ` Jason Cooper
2013-01-30 23:05                             ` Jason Gunthorpe
2013-01-31  0:29                               ` Jason Cooper
2013-01-31  0:39                                 ` Jason Gunthorpe
2013-01-30  0:03                       ` Simon Baatz
2013-01-30  0:51                         ` Sebastian Hesselbarth
2013-01-30  4:26                           ` Jason Cooper
2013-01-30  8:30                           ` Simon Baatz
2013-01-30 10:16                             ` Sebastian Hesselbarth
2013-01-30 14:53                               ` Simon Baatz
2013-01-30 23:01                               ` Jason Cooper
2013-01-30 23:15                                 ` Jason Gunthorpe
2013-01-31  0:40                                   ` Jason Cooper
2013-01-30 23:22                                 ` Sebastian Hesselbarth
2013-01-31  0:32                                   ` Jason Cooper
2013-01-31 22:26                                     ` Simon Baatz
2013-01-31 22:44                                 ` Simon Baatz
2013-01-31 22:49                                   ` Sebastian Hesselbarth
2013-02-01  0:11                                     ` Jason Cooper
2013-02-01  0:01                                   ` Jason Cooper
2013-02-01  0:19                                     ` Jason Gunthorpe
2013-02-01  6:14                                       ` Andrew Lunn
2013-02-01  6:46                                         ` Jason Gunthorpe
2013-02-02 23:04                                       ` Simon Baatz
2013-02-03 16:45                                         ` Jason Cooper
2013-01-28 18:28             ` Jason Gunthorpe
2013-01-29  6:56               ` Andrew Lunn
2013-01-29 17:29                 ` Jason Gunthorpe
2013-01-28 18:22     ` Jason Gunthorpe
2013-01-28 19:46       ` Jason Cooper
2013-01-29 19:54         ` Simon Baatz
2013-01-29 21:13           ` Jason Cooper
2013-01-28 20:26       ` Jason Cooper
2013-01-27 10:40 ` [PATCH v2 2/2] clk: mvebu: Do not gate runit clock on Kirkwood Simon Baatz
2013-01-27 10:55   ` Sebastian Hesselbarth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359283223-23082-2-git-send-email-gmbnomis@gmail.com \
    --to=gmbnomis@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).