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.
This series tries to addess the "more than one clk" issue. Note: to
support BG4CT, we have lots of refactor work to do, eg. BG4CT doesn't
have mbus concept etc.
Jisheng Zhang (4):
net: mvneta: sort the headers in alphabetic order
net: mvneta: Try to get named core clock first
net: mvneta: mmc: get optional axi clk
net: mvneta: update clocks property and document additional
clock-names
.../bindings/net/marvell-armada-370-neta.txt | 6 +++-
drivers/net/ethernet/marvell/mvneta.c | 36 ++++++++++++++--------
2 files changed, 28 insertions(+), 14 deletions(-)
--
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
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 <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Now that mvneta driver allows to have more than one clock defined,
update the clocks property and document the clock-names property.
Signed-off-by: Jisheng Zhang <redacted>
---
Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -6,12 +6,16 @@ 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: Array of clocks required for this device; requires at least one+ for CORE clock. 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: Array of names corresponding to clocks property; shall be+ "core" for CORE clock and "axi" for optional AXI clock.+ Example:
--
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
Sorting the headers in alphabetic order will help to reduce the conflict
when adding new headers in the future.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
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 <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 8 ++++++++
1 file changed, 8 insertions(+)
From: Thomas Petazzoni <hidden> Date: 2016-01-20 08:46:15
Dear Jisheng Zhang,
On Wed, 20 Jan 2016 16:06:20 +0800, Jisheng Zhang wrote:
Sorting the headers in alphabetic order will help to reduce the conflict
when adding new headers in the future.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
Acked-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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
From: Thomas Petazzoni <hidden> Date: 2016-01-20 08:48:06
Dear Jisheng Zhang,
On Wed, 20 Jan 2016 16:06:21 +0800, Jisheng Zhang wrote:
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 <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Acked-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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
From: Thomas Petazzoni <hidden> Date: 2016-01-20 08:51:44
Dear Jisheng Zhang,
On Wed, 20 Jan 2016 16:06:22 +0800, Jisheng Zhang wrote:
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 <redacted>
Typo in the title, you have "mmc: ", while this patch is not related to
MMC, unless I'm missing something and MMC means something else in this
context.
quoted hunk
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)) {
For the error paths and cleanup steps, I very much prefer when things
are done in the opposite order of the allocation/creation steps. So can
you clk_disable_unprepare() the AXI clock before the core clock ?
On Wed, 20 Jan 2016 09:51:32 +0100 Thomas Petazzoni wrote:
Dear Jisheng Zhang,
On Wed, 20 Jan 2016 16:06:22 +0800, Jisheng Zhang wrote:
quoted
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 <redacted>
Typo in the title, you have "mmc: ", while this patch is not related to
MMC, unless I'm missing something and MMC means something else in this
context.
oops, thanks for pointing out this.
quoted
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)) {
For the error paths and cleanup steps, I very much prefer when things
are done in the opposite order of the allocation/creation steps. So can
you clk_disable_unprepare() the AXI clock before the core clock ?
Both are fine. But I agree with your prefer. Will cook a v2 soon
Thanks for reviewing.
@@ -6,12 +6,16 @@ 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: Array of clocks required for this device; requires at least one+ for CORE clock.
Rather than "Array", I would say "list", so what about:
- 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: Array of names corresponding to clocks property; shall be
+ "core" for CORE clock and "axi" for optional AXI clock.
Array -> List.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2016-01-20 09:31:30
On January 20, 2016 9:15:22 AM Jisheng Zhang [off-list ref] wrote:
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.
Jisheng,
although I do not expect mvneta to appear on a non-AXI bus
anytime soon, how about naming the clock "bus" instead?
If you know the clock is only required for bus master DMA but
not for register access, "dma" would be an even better name.
Sebastian
@@ -3744,6 +3751,7 @@ static int mvneta_remove(struct platform_device *pdev)unregister_netdev(dev);clk_disable_unprepare(pp->clk);+clk_disable_unprepare(pp->clk_axi);free_percpu(pp->ports);free_percpu(pp->stats);irq_dispose_mapping(dev->irq);--
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
On Wed, 20 Jan 2016 10:31:18 +0100 Sebastian Hesselbarth wrote:
On January 20, 2016 9:15:22 AM Jisheng Zhang wrote:
quoted
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.
Jisheng,
although I do not expect mvneta to appear on a non-AXI bus
anytime soon, how about naming the clock "bus" instead?
Good question. IIRC, this IP expects AXI bus, but I'll check with HW people.
Thanks a lot,
Jisheng
If you know the clock is only required for bus master DMA but
not for register access, "dma" would be an even better name.
Sebastian
@@ -3744,6 +3751,7 @@ static int mvneta_remove(struct platform_device *pdev)unregister_netdev(dev);clk_disable_unprepare(pp->clk);+clk_disable_unprepare(pp->clk_axi);free_percpu(pp->ports);free_percpu(pp->stats);irq_dispose_mapping(dev->irq);--
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
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2016-01-20 11:03:11
On 01/20/2016 10:42 AM, Jisheng Zhang wrote:
On Wed, 20 Jan 2016 10:31:18 +0100 Sebastian Hesselbarth wrote:
quoted
On January 20, 2016 9:15:22 AM Jisheng Zhang wrote:
quoted
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.
Jisheng,
although I do not expect mvneta to appear on a non-AXI bus
anytime soon, how about naming the clock "bus" instead?
Good question. IIRC, this IP expects AXI bus, but I'll check with HW people.
Actually, I am quite sure the current IP requires AXI. But my comment
was more about to make the binding a little bit more flexible to
_future_ variants/SoCs we may stumble upon.
Naming the clock "bus" or "dma" will work for the current _and_ future
IPs, while "axi" may not.
Sebastian
quoted
If you know the clock is only required for bus master DMA but
not for register access, "dma" would be an even better name.
Sebastian
@@ -3744,6 +3751,7 @@ static int mvneta_remove(struct platform_device *pdev)unregister_netdev(dev);clk_disable_unprepare(pp->clk);+clk_disable_unprepare(pp->clk_axi);free_percpu(pp->ports);free_percpu(pp->stats);irq_dispose_mapping(dev->irq);--
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
Dear Sebastian,
On Wed, 20 Jan 2016 12:03:03 +0100 Sebastian Hesselbarth wrote:
On 01/20/2016 10:42 AM, Jisheng Zhang wrote:
quoted
On Wed, 20 Jan 2016 10:31:18 +0100 Sebastian Hesselbarth wrote:
quoted
On January 20, 2016 9:15:22 AM Jisheng Zhang wrote:
quoted
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.
Jisheng,
although I do not expect mvneta to appear on a non-AXI bus
anytime soon, how about naming the clock "bus" instead?
Good question. IIRC, this IP expects AXI bus, but I'll check with HW people.
Actually, I am quite sure the current IP requires AXI. But my comment
was more about to make the binding a little bit more flexible to
_future_ variants/SoCs we may stumble upon.
Got your points. PS: the clk is for AXI bus logic, so "bus" makes sense.
Naming the clock "bus" or "dma" will work for the current _and_ future
IPs, while "axi" may not.
Indeed, will cook a v3
Thanks a lot for review,
Jisheng
Sebastian
quoted
quoted
If you know the clock is only required for bus master DMA but
not for register access, "dma" would be an even better name.
Sebastian
@@ -3744,6 +3751,7 @@ static int mvneta_remove(struct platform_device *pdev)unregister_netdev(dev);clk_disable_unprepare(pp->clk);+clk_disable_unprepare(pp->clk_axi);free_percpu(pp->ports);free_percpu(pp->stats);irq_dispose_mapping(dev->irq);--
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