Skip to content

Commit

Permalink
gianfar: Convert gianfar to an of_platform_driver
Browse files Browse the repository at this point in the history
Does the same for the accompanying MDIO driver, and then modifies the TBI
configuration method.  The old way used fields in einfo, which no longer
exists.  The new way is to create an MDIO device-tree node for each instance
of gianfar, and create a tbi-handle property to associate ethernet controllers
with the TBI PHYs they are connected to.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Fleming authored and David S. Miller committed Dec 16, 2008
1 parent 257d938 commit b31a1d8
Show file tree
Hide file tree
Showing 42 changed files with 1,217 additions and 424 deletions.
12 changes: 10 additions & 2 deletions Documentation/powerpc/dts-bindings/fsl/tsec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

The MDIO is a bus to which the PHY devices are connected. For each
device that exists on this bus, a child node should be created. See
the definition of the PHY node below for an example of how to define
a PHY.
the definition of the PHY node in booting-without-of.txt for an example
of how to define a PHY.

Required properties:
- reg : Offset and length of the register set for the device
Expand All @@ -21,6 +21,14 @@ Example:
};
};

* TBI Internal MDIO bus

As of this writing, every tsec is associated with an internal TBI PHY.
This PHY is accessed through the local MDIO bus. These buses are defined
similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi".
The TBI PHYs underneath them are similar to normal PHYs, but the reg property
is considered instructive, rather than descriptive. The reg property should
be chosen so it doesn't interfere with other PHYs on the bus.

* Gianfar-compatible ethernet nodes

Expand Down
20 changes: 20 additions & 0 deletions arch/powerpc/boot/dts/asp834x-redboot.dts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,26 @@
reg = <0x2>;
device_type = "ethernet-phy";
};

tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
cell-index = <0>;
device_type = "network";
Expand All @@ -210,6 +228,7 @@
local-mac-address = [ 00 08 e5 11 32 33 ];
interrupts = <32 0x8 33 0x8 34 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy0>;
linux,network-index = <0>;
};
Expand All @@ -223,6 +242,7 @@
local-mac-address = [ 00 08 e5 11 32 34 ];
interrupts = <35 0x8 36 0x8 37 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi1>;
phy-handle = <&phy1>;
linux,network-index = <1>;
};
Expand Down
20 changes: 20 additions & 0 deletions arch/powerpc/boot/dts/ksi8560.dts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,26 @@
reg = <0x2>;
device_type = "ethernet-phy";
};

tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
device_type = "network";
model = "TSEC";
Expand All @@ -152,6 +170,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
interrupt-parent = <&mpic>;
tbi-handle = <&tbi0>;
phy-handle = <&PHY1>;
};

Expand All @@ -164,6 +183,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
interrupt-parent = <&mpic>;
tbi-handle = <&tbi1>;
phy-handle = <&PHY2>;
};

Expand Down
20 changes: 20 additions & 0 deletions arch/powerpc/boot/dts/mpc8313erdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <37 0x8 36 0x8 35 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = < &tbi0 >;
phy-handle = < &phy1 >;
fsl,magic-packet;

Expand All @@ -210,6 +211,10 @@
reg = <0x4>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};
};

Expand All @@ -222,9 +227,24 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <34 0x8 33 0x8 32 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = < &tbi1 >;
phy-handle = < &phy4 >;
sleep = <&pmc 0x10000000>;
fsl,magic-packet;

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


};

serial0: serial@4500 {
Expand Down
19 changes: 19 additions & 0 deletions arch/powerpc/boot/dts/mpc8315erdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,25 @@
reg = <0x1>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
cell-index = <0>;
device_type = "network";
Expand All @@ -217,6 +234,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <32 0x8 33 0x8 34 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = < &phy0 >;
};

Expand All @@ -229,6 +247,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <35 0x8 36 0x8 37 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi1>;
phy-handle = < &phy1 >;
};

Expand Down
18 changes: 18 additions & 0 deletions arch/powerpc/boot/dts/mpc8349emitx.dts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@
reg = <0x1c>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

enet0: ethernet@24000 {
Expand All @@ -195,6 +211,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <32 0x8 33 0x8 34 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy1c>;
linux,network-index = <0>;
};
Expand All @@ -211,6 +228,7 @@
/* Vitesse 7385 isn't on the MDIO bus */
fixed-link = <1 1 1000 0 0>;
linux,network-index = <1>;
tbi-handle = <&tbi1>;
};

serial0: serial@4500 {
Expand Down
5 changes: 5 additions & 0 deletions arch/powerpc/boot/dts/mpc8349emitxgp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
reg = <0x1c>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

enet0: ethernet@24000 {
Expand All @@ -174,6 +178,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <32 0x8 33 0x8 34 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy1c>;
linux,network-index = <0>;
};
Expand Down
19 changes: 19 additions & 0 deletions arch/powerpc/boot/dts/mpc834x_mds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,25 @@
reg = <0x1>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
cell-index = <0>;
device_type = "network";
Expand All @@ -196,6 +213,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <32 0x8 33 0x8 34 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy0>;
linux,network-index = <0>;
};
Expand All @@ -209,6 +227,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <35 0x8 36 0x8 37 0x8>;
interrupt-parent = <&ipic>;
tbi-handle = <&tbi1>;
phy-handle = <&phy1>;
linux,network-index = <1>;
};
Expand Down
19 changes: 19 additions & 0 deletions arch/powerpc/boot/dts/mpc8377_mds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,25 @@
reg = <0x3>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
cell-index = <0>;
device_type = "network";
Expand All @@ -205,6 +222,7 @@
interrupts = <32 0x8 33 0x8 34 0x8>;
phy-connection-type = "mii";
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy2>;
};

Expand All @@ -218,6 +236,7 @@
interrupts = <35 0x8 36 0x8 37 0x8>;
phy-connection-type = "mii";
interrupt-parent = <&ipic>;
tbi-handle = <&tbi1>;
phy-handle = <&phy3>;
};

Expand Down
19 changes: 19 additions & 0 deletions arch/powerpc/boot/dts/mpc8377_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,25 @@
reg = <0x2>;
device_type = "ethernet-phy";
};
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};

mdio@25520 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,gianfar-tbi";
reg = <0x25520 0x20>;

tbi1: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};


enet0: ethernet@24000 {
cell-index = <0>;
device_type = "network";
Expand All @@ -223,6 +240,7 @@
interrupts = <32 0x8 33 0x8 34 0x8>;
phy-connection-type = "mii";
interrupt-parent = <&ipic>;
tbi-handle = <&tbi0>;
phy-handle = <&phy2>;
};

Expand All @@ -237,6 +255,7 @@
phy-connection-type = "mii";
interrupt-parent = <&ipic>;
fixed-link = <1 1 1000 0 0>;
tbi-handle = <&tbi1>;
};

serial0: serial@4500 {
Expand Down
Loading

0 comments on commit b31a1d8

Please sign in to comment.