mv643xx_eth device tree bindings
Subsystems (6)
cover mv643xx_eth device tree bindings
Hi all,
This patch serie implements mv643xx_eth device tree bindings. I opted for the reuse of the bindings already defined in Documentation/devicetree/bindings/marvell.txt so that we do not create any confusion.
For reference, I have included the mv643xx-eth related nodes in the corresponding Kirkwood, Dove and Orion5x .dtsi files so you can more easily test on your own platforms.
I tested these on a custom 88F6181-based boards, but I would appreciate more testing.
Thanks!
Florian Fainelli (4):
mv643xx_eth: add Device Tree bindings
ARM: kirkwood: add device node entries for the gigabit interfaces
ARM: orion5x: add gigabit ethernet device tree node
ARM: dove: add gigabit device tree nodes to dove.dtsi
Documentation/devicetree/bindings/marvell.txt | 21 ++++- arch/arm/boot/dts/dove.dtsi | 25 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 46 ++++++++++ arch/arm/boot/dts/orion5x.dtsi | 23 +++++ arch/arm/mach-kirkwood/common.c | 4 +- drivers/net/ethernet/marvell/mv643xx_eth.c | 114 ++++++++++++++++++++++++- 6 files changed, 226 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 1/4 mv643xx_eth: add Device Tree bindings
This patch adds Device Tree bindings following the already defined bindings at Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles.
--- Documentation/devicetree/bindings/marvell.txt | 21 ++++- drivers/net/ethernet/marvell/mv643xx_eth.c | 114 ++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/marvell.txt +19 -2
@@ -112,9 +112,14 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - #address-cells : <1> - #size-cells : <0> - - compatible : "marvell,mv64360-eth-block" + - compatible : "marvell,mv64360-eth-block", "marvell,mv64360-eth-group", + "marvell,mv643xx-eth-block" - reg : Offset and length of the register set for this block + Optional properties: + - tx-csum-limit : Hardware limit above which transmit checksumming + is disabled. + Example Discovery Ethernet block node: ethernet-block at 2000 { #address-cells = <1>;
@@ -130,7 +135,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - device_type : Should be "network". - - compatible : Should be "marvell,mv64360-eth". + - compatible : Should be "marvell,mv64360-eth", "marvell,mv643xx-eth". - reg : Should be <0>, <1>, or <2>, according to which registers within the silicon block the device uses. - interrupts : <a> where a is the interrupt number for the port.
@@ -140,6 +145,18 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. controller. - local-mac-address : 6 bytes, MAC address + Optional properties: + - clocks : Phandle to the clock control device and gate bit + - clock-names : String describing the clock gate bit + - rx-queue-count : number of RX queues to use + - tx-queue-count : number of TX queues to use + - rx-queue-size : size of the RX queue (in bytes) + - tx-queue-size : size of the TX queue (in bytes) + - rx-sram-addr : address of the SRAM for RX path (non 0 means used) + - rx-sram-size : size of the SRAM for RX path (non 0 means used) + - tx-sram-addr : address of the SRAM for TX path (non 0 means used) + - tx-sram-size : size of the SRAM for TX path (non 0 means used) + Example Discovery Ethernet port node: ethernet at 0 { device_type = "network";
drivers/net/ethernet/marvell/mv643xx_eth.c +111 -3
199 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Re: [PATCH 1/4] mv643xx_eth: add Device Tree bindings
Le 03/29/13 19:14, Florian Fainelli a ?crit :
Quoted 9 lines
This patch adds Device Tree bindings following the already defined bindings at
Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles.Signed-off-by Florian Fainelli <[email protected]>---
[snip]
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_shared_probe(struct platform_device *pdev) · line 2605
Quoted 3 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +1
-1-return 0 ; +return of_platform_bus_probe (np, mv643xx_eth_match, &pdev->dev);
This breaks on non-OF builds, I will wait for more comments to show up and fix this in the next round.
--
Florian
PATCH 2/4 ARM: kirkwood: add device node entries for the gigabit interfaces
In reply to Florian FainelliThis patch modifies kirkwood.dtsi to specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.
--- arch/arm/boot/dts/kirkwood.dtsi | 46 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.c | 4 ++-- 2 files changed, 48 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood.dtsi +46 -0
@@ -7,6 +7,8 @@ aliases { gpio0 = &gpio0; gpio1 = &gpio1; + egiga0 = &egiga0; + egiga1 = &egiga1; }; intc: interrupt-controller { compatible = "marvell,orion-intc", "marvell,intc";
@@ -202,5 +204,49 @@ clocks = <&gate_clk 4>; status = "disabled"; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 70000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x70000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga0: egiga0 at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <11>; + clocks = <&gate_clk 0>; + clock-names = "0"; + }; + }; + + ethernet-group at 74000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x74000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga1: egiga1 at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <15>; + clocks = <&gate_clk 19>; + clock-names = "1"; + }; + }; }; };
arch/arm/mach-kirkwood/common.c +2 -2
@@ -251,8 +251,8 @@ void __init kirkwood_clk_init(void)/* clkdev entries, mapping clks to devices */ orion_clkdev_add (NULL ,"orion_spi.0" , runit);orion_clkdev_add (NULL ,"orion_spi.1" , runit); -orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".0" , ge0); -orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".1" , ge1); +orion_clkdev_add ("0" ,MV643XX_ETH_NAME ".0" , ge0); +orion_clkdev_add ("1" ,MV643XX_ETH_NAME ".1" , ge1);orion_clkdev_add (NULL ,"orion_wdt" , tclk);orion_clkdev_add ("0" ,"sata_mv.0" , sata0);orion_clkdev_add ("1" ,"sata_mv.0" , sata1);
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1364580879-4297-3-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org
Re: [PATCH 2/4] ARM: kirkwood: add device node entries for the gigabit interfaces
Quoted 12 lines · Florian Fainelli
This patch modifies
kirkwood.dtsito specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.Signed-off-by Florian Fainelli <[email protected]>--- arch/arm/boot/dts/kirkwood.dtsi | 46 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.c | 4 ++-- 2 files changed, 48 insertions(+), 2 deletions(-)
...
arch/arm/mach-kirkwood/common.c void __init kirkwood_clk_init(void) · line 255
Quoted 12 lines
arch/arm/mach-kirkwood/common.c +2
-2@@ -251,8 +251,8 @@ void __init kirkwood_clk_init(void)/* clkdev entries, mapping clks to devices */ orion_clkdev_add (NULL ,"orion_spi.0" , runit);orion_clkdev_add (NULL ,"orion_spi.1" , runit); -orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".0" , ge0); -orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".1" , ge1); +orion_clkdev_add ("0" ,MV643XX_ETH_NAME ".0" , ge0); +orion_clkdev_add ("1" ,MV643XX_ETH_NAME ".1" , ge1);
Your first patch is going to go through David's tree, and I'd like to prevent any hard dependency between his tree and arm-soc. Can this change be pulled out and applied separately? At first glance, it looks like a fix to match sata and pcie.
thx,
Jason.
Re: [PATCH 2/4] ARM: kirkwood: add device node entries for the gigabit interfaces
Le 03/29/13 19:48, Jason Cooper a ?crit :
Quoted 23 lines · Florian Fainelli
Quoted 12 lines
This patch modifies
kirkwood.dtsito specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.Signed-off-by Florian Fainelli <[email protected]>--- arch/arm/boot/dts/kirkwood.dtsi | 46 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.c | 4 ++-- 2 files changed, 48 insertions(+), 2 deletions(-)...
Quoted 9 lines
arch/arm/mach-kirkwood/common.c +0
-1@@ -251,8 +251,8 @@ void __init kirkwood_clk_init(void)/* clkdev entries, mapping clks to devices */ orion_clkdev_add (NULL ,"orion_spi.0" , runit);orion_clkdev_add (NULL ,"orion_spi.1" , runit); -orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".0" , ge0);
Quoted 8 lines
arch/arm/mach-kirkwood/common.c void __init kirkwood_clk_init(void) · line 255
Quoted 3 lines
arch/arm/mach-kirkwood/common.c +2
-1-orion_clkdev_add (NULL ,MV643XX_ETH_NAME ".1" , ge1); +orion_clkdev_add ("0" ,MV643XX_ETH_NAME ".0" , ge0); +orion_clkdev_add ("1" ,MV643XX_ETH_NAME ".1" , ge1);Your first patch is going to go through David's tree, and I'd like to prevent any hard dependency between his tree and arm-soc. Can this change be pulled out and applied separately? At first glance, it looks like a fix to match sata and pcie.
I just actually did the same thing as what SATA has (two clocks with names), define a clock name "0" and "1" (is not that too generic BTW?) for ge0 and ge1. But I don't think this change is required. --
Florian
Re: [PATCH 2/4] ARM: kirkwood: add device node entries for the gigabit interfaces
In reply to a message not in the archiveLe 03/29/13 19:14, Florian Fainelli a ?crit :
Quoted 8 lines
This patch modifies
kirkwood.dtsito specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.Signed-off-by Florian Fainelli <[email protected]>---
[snip]
Review
Quoted 2 lines
(quoted diff) +2
-0+ + ethernet-group at 70000 {
This one is off-by 0x2000 and should have been 72000
arch/arm/boot/dts/kirkwood.dtsi line 220
Quoted 4 lines
arch/arm/boot/dts/kirkwood.dtsi +4
-0+ #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x70000 0x4000>;
Same here
Quoted 4 lines
arch/arm/boot/dts/kirkwood.dtsi +4
-0+ tx-csum-limit = <1600>; + status = "disabled"; + + egiga0: egiga0 at 0 {
arch/arm/boot/dts/kirkwood.dtsi line 234
Quoted 10 lines
arch/arm/boot/dts/kirkwood.dtsi +10
-0+ device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <11>; + clocks = <&gate_clk 0>; + clock-names = "0"; + }; + }; + + ethernet-group at 74000 {
And here, it should be 76000
arch/arm/boot/dts/kirkwood.dtsi line 238
Quoted 4 lines
arch/arm/boot/dts/kirkwood.dtsi +4
-0+ #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x74000 0x4000>;
And here too.
--
Florian
PATCH 3/4 ARM: orion5x: add gigabit ethernet device tree node
In reply to Florian FainelliThis patch adds the gigabit ethernet device tree node to orion5x.dtsi. This node is disabled by default and must be enabled on a per-board basis. For completeness and easier testing the MDIO node is also added and disabled by default.
--- arch/arm/boot/dts/orion5x.dtsi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
arch/arm/boot/dts/orion5x.dtsi +23 -0
@@ -94,5 +94,28 @@ interrupts = <22>; status = "okay"; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 70000 { + #address-cells = <1>. + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x70000 0x4000>; + status = "disabled"; + + egiga0: ethernet at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <21>; + }; + }; }; };
Signature · 1 line
1.7.10.4
PATCH 4/4 ARM: dove: add gigabit device tree nodes to dove.dtsi
In reply to Florian FainelliThis patch adds the gigabit ethernet device tree nodes to dove.dtsi in a disabled state. The gigabit ethernet device tree node must be enabled on a per-board basis. For completeness and easier testing the MDIO node is also added in a disabled state.
--- arch/arm/boot/dts/dove.dtsi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm/boot/dts/dove.dtsi +25 -0
@@ -253,5 +253,30 @@ dmacap,xor; }; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 70000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x70000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga0: ethernet at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <29>; + clocks = <&gate_clk 2>; + }; + }; }; };
Signature · 1 line
1.7.10.4