Skip to contentSkip to conversation

Linux >=2.6.24 support for FEC on MPC5200 (not B!)

PATCH In review René Bürgel 2 participants 3 messages Mar 12, 2008 – Mar 20, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Linux >=2.6.24 support for FEC on MPC5200 (not B!)

Here is a patch for the lite5200 to get the FEC working again for kernel >=2.6.24. It was created against Linux 2.6.24.

The FEC driver is also compatible with the MPC5200, not only with the MPC5200B, so an according entry was added to the drivers matching list.
Furthermore the settings for the PHY were entered in the dts file for the Lite5200. Note, that this is not exactly the same as in the Lite5200B, because the PHY is located at f0003000:01 for the 5200, and at :00 for the 5200B. I could test the patch on a Lite5200 and a Lite5200B, both booted a kernel via tftp and mounted the root via nfs successfully. I hope, you can include the patch into the official tree.

Kind regards, René Bürgel

Signature · 9 lines
Unicontrol Systemtechnik GmbH
OT Dittersbach
Sachsenburger Weg 34
09669 Frankenberg

Tel.: 03 72 06/ 88 73 - 12
Fax: 03 72 06/ 88 73 - 60
E-Mail: [email protected]
Internet: www.unicontrol.de
arch/powerpc/boot/dts/lite5200.dts renamed from kernel/current/arch/powerpc/boot/dts/lite5200.dts +16 -0
@@ -273,6 +273,22 @@
 			mac-address = [ 02 03 04 05 06 07 ]; // Bad!
 			interrupts = <2 5 0>;
 			interrupt-parent = <&mpc5200_pic>;
+			phy-handle = <&phy0>;
+		};
+
+		mdio@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			device_type = "mdio";
+			compatible = "mpc5200-fec-phy";
+			reg = <3000 400>;	// fec range, since we need to setup fec interrupts
+			interrupts = <2 5 0>;	// these are for "mii command finished", not link changes & co.
+			interrupt-parent = <&mpc5200_pic>;
+
+			phy0:ethernet-phy@1 {
+				device_type = "ethernet-phy";
+				reg = <1>;
+			};
 		};
 
 		ata@3a00 {
drivers/net/fec_mpc52xx.c renamed from kernel/linux-2.6.24-uc/drivers/net/fec_mpc52xx.c +4 -0
@@ -1059,6 +1059,10 @@
 static struct of_device_id mpc52xx_fec_match[] = {
 	{
 		.type		= "network",
+		.compatible	= "mpc5200b-fec",
+	},
+	{
+		.type		= "network",
 		.compatible	= "mpc5200-fec",
 	},
 	{ }
drivers/net/fec_mpc52xx_phy.c renamed from kernel/linux-2.6.24-uc/drivers/net/fec_mpc52xx_phy.c +4 -0
@@ -181,6 +181,10 @@
 		.type = "mdio",
 		.compatible = "mpc5200b-fec-phy",
 	},
+	{
+		.type = "mdio",
+		.compatible = "mpc5200-fec-phy",
+	},
 	{},
 };
 
#1 lore raw
Quoted 12 lines · On Wed, Mar 12, 2008 at 12:57 PM, Ren=E9 B=FCrgel <[email protected]>=…

Here is a patch for the lite5200 to get the FEC working again for kernel

Quoted 1 line

=3D2.6.24. It was created against Linux 2.6.24.

The FEC driver is also compatible with the MPC5200, not only with the MPC5200B, so an according entry was added to the drivers matching list. Furthermore the settings for the PHY were entered in the dts file for the Lite5200. Note, that this is not exactly the same as in the Lite5200B, because the PHY is located at f0003000:01 for the 5200, and at :00 for the 5200B. I could test the patch on a Lite5200 and a Lite5200B, both booted a kernel via tftp and mounted the root via nfs successfully.
I hope, you can include the patch into the official tree.

Looks good. I'll pick this one up.

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

#2 lore raw
In reply to René Bürgel
Quoted 12 lines · On Wed, Mar 12, 2008 at 12:57 PM, Ren=E9 B=FCrgel <[email protected]>=…

Here is a patch for the lite5200 to get the FEC working again for kernel

Quoted 1 line

=3D2.6.24. It was created against Linux 2.6.24.

The FEC driver is also compatible with the MPC5200, not only with the MPC5200B, so an according entry was added to the drivers matching list. Furthermore the settings for the PHY were entered in the dts file for the Lite5200. Note, that this is not exactly the same as in the Lite5200B, because the PHY is located at f0003000:01 for the 5200, and at :00 for the 5200B. I could test the patch on a Lite5200 and a Lite5200B, both booted a kernel via tftp and mounted the root via nfs successfully.
I hope, you can include the patch into the official tree.

Oops, I spoke too soon on picking this up. The patch looks mostly good, but it does not apply to the head of the tree. Can you please rebase it on top of Linus' current tree and repost? While you're at it, I've got a couple of minor comments below that should be addressed:

Quoted 4 lines

+ mdio@3000 {

 +                       #address-cells =3D <1>;
 +                       #size-cells =3D <0>;
 +                       device_type =3D "mdio";

Drop the device_type property

Quoted 1 line

+ compatible =3D "mpc5200-fec-phy";

should be "mpc5200-mdio" (see current lite5200 for the example)

Cheers,
g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.