diff mbox

[5/6] csb1724: Enable device tree based mv643xx ethernet support.

Message ID 1343661359-10150-6-git-send-email-ian.molton@codethink.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Molton July 30, 2012, 3:15 p.m. UTC
This patch enables mv643xx based ethernet built into the SoM on the
    csb1724, via flattened device tree.

    Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
---
 arch/arm/boot/dts/kirkwood-csb1724.dts |   25 ++++++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi        |   16 ++++++++++++
 arch/arm/configs/csb1724_defconfig     |   45 ++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-csb1724.c |    3 +++
 4 files changed, 89 insertions(+)

Comments

Andrew Lunn July 30, 2012, 3:55 p.m. UTC | #1
On Mon, Jul 30, 2012 at 04:15:58PM +0100, Ian Molton wrote:
>     This patch enables mv643xx based ethernet built into the SoM on the
>     csb1724, via flattened device tree.
> 
>     Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
> ---
>  arch/arm/boot/dts/kirkwood-csb1724.dts |   25 ++++++++++++++++++
>  arch/arm/boot/dts/kirkwood.dtsi        |   16 ++++++++++++
>  arch/arm/configs/csb1724_defconfig     |   45 ++++++++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-csb1724.c |    3 +++
>  4 files changed, 89 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-csb1724.dts b/arch/arm/boot/dts/kirkwood-csb1724.dts
> index 44dfe9a..f652797 100644
> --- a/arch/arm/boot/dts/kirkwood-csb1724.dts
> +++ b/arch/arm/boot/dts/kirkwood-csb1724.dts
> @@ -25,6 +25,31 @@
>  			nr-ports = <2>;
>  			status = "ok";
>  		};
> +
> +		smi0: mdio@72000 {
> +			status = "ok";
> +		};
> +
> +		smi1: mdio@76000 {
> +			status = "ok";
> +		};
> +
> +		egiga0 {
> +			compatible = "marvell,mv643xx";
> +			mdio = <&smi0>;
> +			port_number = <0>;
> +			phy_addr = <0x80>;
> +			interrupts = <11>;
> +		};
> +
> +		egiga1 {
> +			compatible = "marvell,mv643xx";
> +			mdio = <&smi1>;
> +			port_number = <0>;
> +			phy_addr = <0x81>;
> +			interrupts = <15>;
> +		};
> +
>  	};
>  
>  };
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index cef9616..dd10422 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -105,5 +105,21 @@
>  			clock-frequency = <100000>;
>  			status = "disabled";
>  		};
> +
> +		smi0: mdio@72000 {
> +			compatible = "marvell,mdio-mv643xx";
> +			reg = <0x72000 0x4000>;
> +			interrupts = <46>;
> +			status = "disabled";
> +		};
> +
> +		smi1: mdio@76000 {
> +			compatible = "marvell,mdio-mv643xx";
> +			reg = <0x76000 0x4000>;
> +			interrupts = <47>;
> +			shared_smi = <&smi0>;
> +			status = "disabled";
> +		};
> +


Hi Ian

I'm trying to keep this in order. Currently i2c is in the wrong place,
but the rest are incremental. It looks like these should be between
wdt & sata.

What about default entries for egiga0 and egiga1 with status
"disabled"? It looks like the only thing which changes between boards
is phy_addr.

   Andrew
Andrew Lunn July 30, 2012, 4:17 p.m. UTC | #2
On Mon, Jul 30, 2012 at 04:15:58PM +0100, Ian Molton wrote:
>     This patch enables mv643xx based ethernet built into the SoM on the
>     csb1724, via flattened device tree.
> 
>     Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
> ---
>  arch/arm/boot/dts/kirkwood-csb1724.dts |   25 ++++++++++++++++++
>  arch/arm/boot/dts/kirkwood.dtsi        |   16 ++++++++++++
>  arch/arm/configs/csb1724_defconfig     |   45 ++++++++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-csb1724.c |    3 +++
>  4 files changed, 89 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-csb1724.dts b/arch/arm/boot/dts/kirkwood-csb1724.dts
> index 44dfe9a..f652797 100644
> --- a/arch/arm/boot/dts/kirkwood-csb1724.dts
> +++ b/arch/arm/boot/dts/kirkwood-csb1724.dts
> @@ -25,6 +25,31 @@
>  			nr-ports = <2>;
>  			status = "ok";
>  		};
> +
> +		smi0: mdio@72000 {
> +			status = "ok";
> +		};
> +
> +		smi1: mdio@76000 {
> +			status = "ok";
> +		};
> +
> +		egiga0 {
> +			compatible = "marvell,mv643xx";
> +			mdio = <&smi0>;
> +			port_number = <0>;
> +			phy_addr = <0x80>;
> +			interrupts = <11>;
> +		};

Hi Ian

Shouldn't there be two interrupt here?

 292         orion_ge00_init(eth_data,
 293                         GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM,
 294                         IRQ_KIRKWOOD_GE00_ERR);

Documentation of the binding would help....

     Andrew
Ian Molton July 30, 2012, 4:57 p.m. UTC | #3
On 30/07/12 17:17, Andrew Lunn wrote:

> Hi Ian
>
> Shouldn't there be two interrupt here?
>
> 292 orion_ge00_init(eth_data, 293
> GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM, 294
> IRQ_KIRKWOOD_GE00_ERR);

No. This is thanks to the horrific mess in the mv643xx driver - its got
two drivers in one source file, and they do horrid things like pass
round base addresses.

Im making an effort to try to split them out into seperate mdio and
MAC/PHY drivers.

This is a start. :)

-Ian
Ian Molton July 30, 2012, 4:58 p.m. UTC | #4
On 30/07/12 16:55, Andrew Lunn wrote:
> On Mon, Jul 30, 2012 at 04:15:58PM +0100, Ian Molton wrote:

> Hi Ian
>
> I'm trying to keep this in order. Currently i2c is in the wrong
> place, but the rest are incremental. It looks like these should be
> between wdt & sata.

Will fix.

> What about default entries for egiga0 and egiga1 with status
> "disabled"? It looks like the only thing which changes between
> boards is phy_addr.

Seems sensible. I'll change that for v2.

-Ian
diff mbox

Patch

diff --git a/arch/arm/boot/dts/kirkwood-csb1724.dts b/arch/arm/boot/dts/kirkwood-csb1724.dts
index 44dfe9a..f652797 100644
--- a/arch/arm/boot/dts/kirkwood-csb1724.dts
+++ b/arch/arm/boot/dts/kirkwood-csb1724.dts
@@ -25,6 +25,31 @@ 
 			nr-ports = <2>;
 			status = "ok";
 		};
+
+		smi0: mdio@72000 {
+			status = "ok";
+		};
+
+		smi1: mdio@76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			compatible = "marvell,mv643xx";
+			mdio = <&smi0>;
+			port_number = <0>;
+			phy_addr = <0x80>;
+			interrupts = <11>;
+		};
+
+		egiga1 {
+			compatible = "marvell,mv643xx";
+			mdio = <&smi1>;
+			port_number = <0>;
+			phy_addr = <0x81>;
+			interrupts = <15>;
+		};
+
 	};
 
 };
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index cef9616..dd10422 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -105,5 +105,21 @@ 
 			clock-frequency = <100000>;
 			status = "disabled";
 		};
+
+		smi0: mdio@72000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x72000 0x4000>;
+			interrupts = <46>;
+			status = "disabled";
+		};
+
+		smi1: mdio@76000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x76000 0x4000>;
+			interrupts = <47>;
+			shared_smi = <&smi0>;
+			status = "disabled";
+		};
+
 	};
 };
diff --git a/arch/arm/configs/csb1724_defconfig b/arch/arm/configs/csb1724_defconfig
index 927b269..fbea657 100644
--- a/arch/arm/configs/csb1724_defconfig
+++ b/arch/arm/configs/csb1724_defconfig
@@ -45,3 +45,48 @@  CONFIG_PROC_DEVICETREE=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
 CONFIG_DYNAMIC_DEBUG=y
+CONFIG_NET=y
+CONFIG_INET=y
+CONFIG_NETDEVICES=y
+CONFIG_MV643XX_ETH=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_IPV6=n
+CONFIG_NET_VENDOR_3COM=n
+CONFIG_NET_VENDOR_ADAPTEC=n
+CONFIG_NET_VENDOR_ALTEON=n
+CONFIG_NET_VENDOR_AMD=n
+CONFIG_NET_VENDOR_ATHEROS=n
+CONFIG_NET_VENDOR_BROADCOM=n
+CONFIG_NET_VENDOR_BROCADE=n
+CONFIG_NET_VENDOR_CHELSIO=n
+CONFIG_NET_VENDOR_CIRRUS=n
+CONFIG_NET_VENDOR_CISCO=n
+CONFIG_NET_VENDOR_DEC=n
+CONFIG_NET_VENDOR_HP=n
+CONFIG_NET_VENDOR_DLINK=n
+CONFIG_NET_VENDOR_EMULEX=n
+CONFIG_NET_VENDOR_EXAR=n
+CONFIG_NET_VENDOR_FARADAY=n
+CONFIG_NET_VENDOR_INTEL=n
+CONFIG_NET_VENDOR_MELLANOX=n
+CONFIG_NET_VENDOR_MICREL=n
+CONFIG_NET_VENDOR_MYRI=n
+CONFIG_NET_VENDOR_NATSEMI=n
+CONFIG_NET_VENDOR_NVIDIA=n
+CONFIG_NET_VENDOR_OKI=n
+CONFIG_NET_PACKET_ENGINE=n
+CONFIG_NET_VENDOR_QLOGIC=n
+CONFIG_NET_VENDOR_REALTEK=n
+CONFIG_NET_VENDOR_RDC=n
+CONFIG_NET_VENDOR_SEEQ=n
+CONFIG_NET_VENDOR_SILAN=n
+CONFIG_NET_VENDOR_SIS=n
+CONFIG_NET_VENDOR_SMSC=n
+CONFIG_NET_VENDOR_STMICRO=n
+CONFIG_NET_VENDOR_SUN=n
+CONFIG_NET_VENDOR_TEHUTI=n
+CONFIG_NET_VENDOR_TI=n
+CONFIG_NET_VENDOR_VIA=n
+CONFIG_NET_VENDOR_WIZNET=n
+
diff --git a/arch/arm/mach-kirkwood/board-csb1724.c b/arch/arm/mach-kirkwood/board-csb1724.c
index 979112d..50f0c5b 100644
--- a/arch/arm/mach-kirkwood/board-csb1724.c
+++ b/arch/arm/mach-kirkwood/board-csb1724.c
@@ -13,6 +13,7 @@ 
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include "common.h"
 #include "mpp.h"
 
 static unsigned int csb1724_mpp_config[] __initdata = {
@@ -56,4 +57,6 @@  void __init csb1724_init(void)
 	 * Basic setup. Needs to be called early.
 	 */
 	kirkwood_mpp_conf(csb1724_mpp_config);
+	kirkwood_ge00_init(NULL);
+	kirkwood_ge01_init(NULL);
 }