[parent not found: <1453281622-7829-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>]
* [PATCH v2 1/4] net: mvneta: sort the headers in alphabetic order
[not found] ` <1453281622-7829-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
@ 2016-01-20 9:20 ` Jisheng Zhang
0 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2016-01-20 9:20 UTC (permalink / raw)
To: thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, mw-nYOzD4b6Jr9Wk0Htik3J/w,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Jisheng Zhang
Sorting the headers in alphabetic order will help to reduce the conflict
when adding new headers in the future.
Signed-off-by: Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/net/ethernet/marvell/mvneta.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index fabc8df..8e85a53 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -11,28 +11,28 @@
* warranty of any kind, whether express or implied.
*/
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
+#include <linux/clk.h>
+#include <linux/cpu.h>
#include <linux/etherdevice.h>
-#include <linux/platform_device.h>
-#include <linux/skbuff.h>
+#include <linux/if_vlan.h>
#include <linux/inetdevice.h>
-#include <linux/mbus.h>
-#include <linux/module.h>
#include <linux/interrupt.h>
-#include <linux/if_vlan.h>
-#include <net/ip.h>
-#include <net/ipv6.h>
#include <linux/io.h>
-#include <net/tso.h>
+#include <linux/kernel.h>
+#include <linux/mbus.h>
+#include <linux/module.h>
+#include <linux/netdevice.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
-#include <linux/of_address.h>
#include <linux/phy.h>
-#include <linux/clk.h>
-#include <linux/cpu.h>
+#include <linux/platform_device.h>
+#include <linux/skbuff.h>
+#include <net/ip.h>
+#include <net/ipv6.h>
+#include <net/tso.h>
/* Registers */
#define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2))
--
2.7.0.rc3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/4] net: mvneta: Try to get named core clock first
2016-01-20 9:20 [PATCH v2 0/4] net: mvneta: support more than one clk Jisheng Zhang
[not found] ` <1453281622-7829-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
@ 2016-01-20 9:20 ` Jisheng Zhang
2016-01-20 9:20 ` [PATCH v2 3/4] net: mvneta: get optional axi clk Jisheng Zhang
2016-01-20 9:20 ` [PATCH v2 4/4] net: mvneta: update clocks property and document additional clock-names Jisheng Zhang
3 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2016-01-20 9:20 UTC (permalink / raw)
To: thomas.petazzoni, davem, mw, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak
Cc: devicetree, netdev, linux-kernel, sebastian.hesselbarth,
linux-arm-kernel, Jisheng Zhang
Some platforms may provide more than one clk for the mvneta IP, for
example Marvell BG4CT provides "core" clk for the mac core, and "axi"
clk for the AXI bus logic.
To support for more than one clock, we'll need to distinguish between
the clock by name. Change clock probing to first try to get "core"
clock before falling back to unnamed clock.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
drivers/net/ethernet/marvell/mvneta.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 8e85a53..736a9ec 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3605,7 +3605,9 @@ static int mvneta_probe(struct platform_device *pdev)
pp->indir[0] = rxq_def;
- pp->clk = devm_clk_get(&pdev->dev, NULL);
+ pp->clk = devm_clk_get(&pdev->dev, "core");
+ if (IS_ERR(pp->clk))
+ pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
goto err_put_phy_node;
--
2.7.0.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/4] net: mvneta: get optional axi clk
2016-01-20 9:20 [PATCH v2 0/4] net: mvneta: support more than one clk Jisheng Zhang
[not found] ` <1453281622-7829-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
2016-01-20 9:20 ` [PATCH v2 2/4] net: mvneta: Try to get named core clock first Jisheng Zhang
@ 2016-01-20 9:20 ` Jisheng Zhang
2016-01-20 9:20 ` [PATCH v2 4/4] net: mvneta: update clocks property and document additional clock-names Jisheng Zhang
3 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2016-01-20 9:20 UTC (permalink / raw)
To: thomas.petazzoni, davem, mw, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak
Cc: Jisheng Zhang, devicetree, netdev, linux-kernel, linux-arm-kernel,
sebastian.hesselbarth
Some platforms may provide more than one clk for the mvneta IP, for
example Marvell BG4CT provides "core" clk for the mac core, and
"axi" clk for the AXI bus logic. Obviously this "axi" clk also need to
be enabled. This patch adds this optional "axi" clk support.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
drivers/net/ethernet/marvell/mvneta.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 736a9ec..ca25933 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -373,6 +373,8 @@ struct mvneta_port {
/* Core clock */
struct clk *clk;
+ /* AXI clock */
+ struct clk *clk_axi;
u8 mcast_count[256];
u16 tx_ring_size;
u16 rx_ring_size;
@@ -3615,6 +3617,10 @@ static int mvneta_probe(struct platform_device *pdev)
clk_prepare_enable(pp->clk);
+ pp->clk_axi = devm_clk_get(&pdev->dev, "axi");
+ if (!IS_ERR(pp->clk_axi))
+ clk_prepare_enable(pp->clk_axi);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pp->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pp->base)) {
@@ -3726,6 +3732,7 @@ err_free_stats:
err_free_ports:
free_percpu(pp->ports);
err_clk:
+ clk_disable_unprepare(pp->clk_axi);
clk_disable_unprepare(pp->clk);
err_put_phy_node:
of_node_put(phy_node);
@@ -3743,6 +3750,7 @@ static int mvneta_remove(struct platform_device *pdev)
struct mvneta_port *pp = netdev_priv(dev);
unregister_netdev(dev);
+ clk_disable_unprepare(pp->clk_axi);
clk_disable_unprepare(pp->clk);
free_percpu(pp->ports);
free_percpu(pp->stats);
--
2.7.0.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 4/4] net: mvneta: update clocks property and document additional clock-names
2016-01-20 9:20 [PATCH v2 0/4] net: mvneta: support more than one clk Jisheng Zhang
` (2 preceding siblings ...)
2016-01-20 9:20 ` [PATCH v2 3/4] net: mvneta: get optional axi clk Jisheng Zhang
@ 2016-01-20 9:20 ` Jisheng Zhang
3 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2016-01-20 9:20 UTC (permalink / raw)
To: thomas.petazzoni, davem, mw, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak
Cc: Jisheng Zhang, devicetree, netdev, linux-kernel, linux-arm-kernel,
sebastian.hesselbarth
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt
index aeea50c..1c913d4 100644
--- a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt
+++ b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt
@@ -6,12 +6,17 @@ Required properties:
- interrupts: interrupt for the device
- phy: See ethernet.txt file in the same directory.
- phy-mode: See ethernet.txt file in the same directory
-- clocks: a pointer to the reference clock for this device.
+- clocks: List of clocks for this device. At least one clock is
+ mandatory for the core clock. If several clocks are given, then the
+ clock-names property must be used to identify them.
Optional properties:
- tx-csum-limit: maximum mtu supported by port that allow TX checksum.
Value is presented in bytes. If not used, by default 1600B is set for
"marvell,armada-370-neta" and 9800B for others.
+- clock-names: List of names corresponding to clocks property; shall be
+ "core" for CORE clock and "axi" for the optional AXI clock.
+
Example:
--
2.7.0.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread