diff mbox

[4/4] arm: mvebu: enable Ethernet controllers on Armada 370/XP eval boards

Message ID 1351245804-31478-5-git-send-email-thomas.petazzoni@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Petazzoni Oct. 26, 2012, 10:03 a.m. UTC
This patch enables the two network interfaces of the Armada 370
official Marvell evaluation platform, and the four network interfaces
of the Armada XP official Marvell evaluation platform.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/boot/dts/armada-370-db.dts |   12 ++++++++++++
 arch/arm/boot/dts/armada-xp-db.dts  |   24 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

Comments

Jason Gunthorpe Nov. 4, 2012, 2:03 a.m. UTC | #1
+                ethernet@d0070000 {
+                        clock-frequency = <200000000>;
+                        status = "okay";
+                        phy-mode = "rgmii-id";
+                        phy-addr = <0>;
+                };

We've been using the patches from Ian Molton for the mv643xx driver
that make it use the more standard, separately described MDIO
bus..

Please consider not copying the unsual 'phy-addr' binding
for the new driver.

What we are used to seeing for ethernet+mdio is more like:

                smi0: mdio@72000 {
                        device_type = "mdio";
                        compatible = "marvell,mdio-mv643xx";
                        reg = <0x72000 0x4000>;
                        interrupts = <46>;
                        tx_csum_limit = <1600>;

                        #address-cells = <1>;
                        #size-cells = <0>;
                        PHY1: ethernet-phy@1 {
                                reg = <1>;
                                device_type = "ethernet-phy";
                                phy-id = <0x01410e90>;
                        };
                };

                egiga0 {
                        device_type = "network";
                        compatible = "marvell,mv643xx-eth";
                        reg = <0x72000 0x4000>;
                        mdio = <&smi0>;
                        port_number = <0>;
                        phy-handle = <&PHY1>;
                        interrupts = <11>;
                };
        };

Where the MDIO bus is explicit, the PHY, its address and parameters
are explicit - the PHY has an of_node pointer - and phy-handle is used
to connect them.

I'm not sure having the MDIO bus as a distinct top level item is
great, considering how the registers overlap.. It might be better
to put it under the egiga0 block? But that is a minor nit :)

Regards,
Jason
Thomas Petazzoni Nov. 4, 2012, 9:12 a.m. UTC | #2
Hello Jason,

On Sat, 3 Nov 2012 20:03:11 -0600, Jason Gunthorpe wrote:

> We've been using the patches from Ian Molton for the mv643xx driver
> that make it use the more standard, separately described MDIO
> bus..

[...]

> Where the MDIO bus is explicit, the PHY, its address and parameters
> are explicit - the PHY has an of_node pointer - and phy-handle is used
> to connect them.
> 
> I'm not sure having the MDIO bus as a distinct top level item is
> great, considering how the registers overlap.. It might be better
> to put it under the egiga0 block? But that is a minor nit :)

Thanks for your comment. I'll see what I can come up with to make the
phy a separate DT entity.

Thanks!

Thomas
Thomas Petazzoni Nov. 12, 2012, 5:30 p.m. UTC | #3
Jason,

On Sat, 3 Nov 2012 20:03:11 -0600, Jason Gunthorpe wrote:

> We've been using the patches from Ian Molton for the mv643xx driver
> that make it use the more standard, separately described MDIO
> bus..
> 
> Please consider not copying the unsual 'phy-addr' binding
> for the new driver.

I have just sent a fifth version of the patch set that implements a
separate DT node for the PHY devices, as well as a separate MDIO bus.

Please let me know if it solves your comment.

Thanks!

Thomas
diff mbox

Patch

diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index fffd5c2..aea2cd3e 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -38,5 +38,17 @@ 
 			clock-frequency = <600000000>;
 			status = "okay";
 		};
+                ethernet@d0070000 {
+                        clock-frequency = <200000000>;
+                        status = "okay";
+                        phy-mode = "rgmii-id";
+                        phy-addr = <0>;
+                };
+                ethernet@d0074000 {
+                        clock-frequency = <200000000>;
+                        status = "okay";
+                        phy-mode = "rgmii-id";
+                        phy-addr = <1>;
+                };
 	};
 };
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index b1fc728..0cd4426 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -46,5 +46,29 @@ 
 			clock-frequency = <250000000>;
 			status = "okay";
 		};
+                ethernet@d0070000 {
+                        clock-frequency = <250000000>;
+                        status = "okay";
+                        phy-mode = "rgmii-id";
+                        phy-addr = <0>;
+                };
+                ethernet@d0074000 {
+                        clock-frequency = <250000000>;
+                        status = "okay";
+                        phy-mode = "rgmii-id";
+                        phy-addr = <1>;
+                };
+                ethernet@d0030000 {
+                        clock-frequency = <250000000>;
+                        status = "okay";
+                        phy-mode = "sgmii";
+                        phy-addr = <25>;
+                };
+                ethernet@d0034000 {
+                        clock-frequency = <250000000>;
+                        status = "okay";
+                        phy-mode = "sgmii";
+                        phy-addr = <27>;
+                };
 	};
 };