From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] NET: mv643xx: get smi clock from device tree
Date: Sun, 27 Jan 2013 15:27:30 +0100 [thread overview]
Message-ID: <1359296850-25348-1-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <684d670633e771b738725b082d88fdb773002f4a.1359232975.git.jason@lakedaemon.net>
mv643xx_eth is split up into core (ethernet) and smi (mdio) driver
parts. If clock gates are introduced as for Kirkwood and Dove SoCs,
smi registers are accessed with clock gated and cause the SoC to
hang.
This patch also gets and enables a clock passed from DT for the
shared smi part of the driver. It has been tested on Dove and also
allows the driver compiled and used as a module.
DT conversion patches for mv643xx_eth on Dove will be sent on another
patch set.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Simon Baatz <gmbnomis@gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 67e5d86..c0f0671 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -296,6 +296,9 @@ struct mv643xx_eth_shared_private {
int extended_rx_coal_limit;
int tx_bw_control;
int tx_csum_limit;
+#if defined(CONFIG_HAVE_CLK)
+ struct clk *clk;
+#endif
};
@@ -2626,6 +2629,12 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node,
"tx_csum_limit", &pd->tx_csum_limit);
+#if defined(CONFIG_HAVE_CLK)
+ msp->clk = of_clk_get(pdev->dev.of_node, 0);
+ if (!IS_ERR(msp->clk))
+ clk_prepare_enable(msp->clk);
+#endif
+
np = of_parse_phandle(pdev->dev.of_node, "shared_smi", 0);
if (np)
pd->shared_smi = of_find_device_by_node(np);
@@ -2695,6 +2704,12 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
out_free_mii_bus:
mdiobus_free(msp->smi_bus);
out_unmap:
+#if defined(CONFIG_HAVE_CLK)
+ if (!IS_ERR(msp->clk)) {
+ clk_disable_unprepare(msp->clk);
+ clk_put(msp->clk);
+ }
+#endif
iounmap(msp->base);
out_free:
kfree(msp);
@@ -2713,6 +2728,12 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
}
if (msp->err_interrupt != NO_IRQ)
free_irq(msp->err_interrupt, msp);
+#if defined(CONFIG_HAVE_CLK)
+ if (!IS_ERR(msp->clk)) {
+ clk_disable_unprepare(msp->clk);
+ clk_put(msp->clk);
+ }
+#endif
iounmap(msp->base);
kfree(msp);
--
1.7.10.4
next prev parent reply other threads:[~2013-01-27 14:27 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 2/6] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-24 5:50 ` Andrew Lunn
2013-01-24 13:43 ` Florian Fainelli
2013-01-24 14:39 ` Jason Cooper
2013-01-24 15:41 ` Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 4/6] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 5/6] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
2013-01-24 1:39 ` Jason Cooper
2013-01-24 6:23 ` Andrew Lunn
2013-01-24 12:07 ` Jason Cooper
2013-01-24 13:37 ` Florian Fainelli
2013-01-24 14:37 ` Jason Cooper
2013-01-24 15:54 ` Arnd Bergmann
2013-01-24 16:13 ` Jason Cooper
2013-01-24 17:51 ` Florian Fainelli
2013-01-24 18:16 ` Jason Cooper
2013-01-24 20:27 ` Florian Fainelli
2013-01-24 20:38 ` Jason Cooper
2013-01-24 20:52 ` Florian Fainelli
2013-01-24 1:33 ` [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-26 20:08 ` Sergei Shtylyov
2013-01-26 20:22 ` Jason Cooper
2013-01-27 15:04 ` Sergei Shtylyov
2013-01-27 15:26 ` Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 7/8] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-25 5:32 ` [RFC V2 PATCH 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-25 11:15 ` [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion Arnd Bergmann
2013-01-25 12:52 ` Jason Cooper
2013-01-25 15:03 ` Sebastian Hesselbarth
2013-01-25 18:34 ` Jason Gunthorpe
2013-01-25 20:03 ` Arnd Bergmann
2013-01-28 10:40 ` Ezequiel Garcia
2013-01-28 18:07 ` Jason Gunthorpe
2013-01-28 18:24 ` Thomas Petazzoni
2013-01-28 18:41 ` Ezequiel Garcia
2013-01-28 19:03 ` Thomas Petazzoni
2013-01-28 19:19 ` Jason Gunthorpe
2013-01-28 19:19 ` Ezequiel Garcia
2013-01-28 18:43 ` Jason Gunthorpe
2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
2013-01-25 20:53 ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-26 16:21 ` Andrew Lunn
2013-01-25 20:53 ` [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-26 16:55 ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Andrew Lunn
2013-01-26 16:55 ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
2013-01-26 17:38 ` Sebastian Hesselbarth
2013-01-26 18:24 ` Andrew Lunn
2013-01-26 18:51 ` Sebastian Hesselbarth
2013-01-26 20:40 ` Jason Cooper
2013-01-26 20:39 ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Jason Cooper
2013-01-25 20:53 ` [PATCH V3 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-25 20:53 ` [PATCH V3 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-25 20:53 ` [PATCH V3 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-25 20:53 ` [PATCH V3 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-01-25 20:53 ` [PATCH V3 7/8] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-28 10:12 ` Mark Rutland
2013-01-28 19:38 ` Jason Cooper
2013-01-29 10:26 ` Ian Molton
2013-01-25 20:54 ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-26 12:38 ` Andrew Lunn
2013-01-26 12:50 ` Sebastian Hesselbarth
2013-01-26 13:40 ` Andrew Lunn
2013-01-26 13:46 ` Sebastian Hesselbarth
2013-01-26 15:42 ` Jason Cooper
2013-01-27 12:21 ` Russell King - ARM Linux
2013-01-27 13:10 ` Sebastian Hesselbarth
2013-01-27 18:38 ` Russell King - ARM Linux
2013-01-26 15:06 ` Jason Cooper
2013-01-26 15:12 ` Andrew Lunn
2013-01-26 15:33 ` Andrew Lunn
2013-01-26 15:44 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-26 20:50 ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-02-16 16:25 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-02-16 16:11 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus Jason Cooper
2013-02-16 16:15 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 04/11] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-26 20:50 ` [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-02-16 16:17 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 06/11] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-26 20:50 ` [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-02-15 20:37 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 08/11] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-26 20:50 ` [PATCH V4 09/11] NET: mv643xx: Get clk from device tree Jason Cooper
2013-01-27 14:27 ` Sebastian Hesselbarth [this message]
2013-01-26 20:50 ` [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-27 13:41 ` Sebastian Hesselbarth
2013-01-27 15:35 ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 11/11] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Jason Cooper
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=1359296850-25348-1-git-send-email-sebastian.hesselbarth@gmail.com \
--to=sebastian.hesselbarth@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).