Skip to contentSkip to conversation

mpc5200: remove "mpc5200b-*" from compatible lists in dts files

RFC/POWERPC Grant Likely 2 participants 3 messages Apr 18, 2008 – Apr 19, 2008

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

From: Grant Likely <[email protected]>

The mpc5200b is a bug fix of the mpc5200 with a few incompatible changes. By rights, the current dts trees are the most "correct", but in practical purposes there is no value in the 5200b devices having 2 compatible entries for each internal peripheral node. Freescale has done a good job of documenting exactly where the incompatibilities lie, so it restrict the extra compatible properties to devices with *documented* changes.

Removing the extra 'b' fields makes the device trees smaller
---

 arch/powerpc/boot/dts/cm5200.dts    |   48 +++++++++++++------------
 arch/powerpc/boot/dts/lite5200b.dts |   66 ++++++++++++++++++-----------------
 arch/powerpc/boot/dts/motionpro.dts |   50 +++++++++++++--------------
 arch/powerpc/kernel/prom_init.c     |    2 +
 drivers/net/fec_mpc52xx_phy.c       |    2 +
 5 files changed, 84 insertions(+), 84 deletions(-)
arch/powerpc/boot/dts/cm5200.dts +24 -24
index 2f74cc4..5f929c3 100644
@@ -43,14 +43,14 @@
 	soc5200@f0000000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
-		compatible = "fsl,mpc5200b-immr";
+		compatible = "fsl,mpc5200-immr";
 		ranges = <0 0xf0000000 0x0000c000>;
 		reg = <0xf0000000 0x00000100>;
 		bus-frequency = <0>;		// from bootloader
 		system-frequency = <0>;		// from bootloader
 
 		cdm@200 {
-			compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
+			compatible = "fsl,mpc5200-cdm";
 			reg = <0x200 0x38>;
 		};
 
@@ -58,12 +58,12 @@
 			// 5200 interrupts are encoded into two levels;
 			interrupt-controller;
 			#interrupt-cells = <3>;
-			compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
+			compatible = "fsl,mpc5200-pic";
 			reg = <0x500 0x80>;
 		};
 
 		timer@600 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x600 0x10>;
 			interrupts = <1 9 0>;
 			interrupt-parent = <&mpc5200_pic>;
@@ -71,91 +71,91 @@
 		};
 
 		timer@610 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x610 0x10>;
 			interrupts = <1 10 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@620 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x620 0x10>;
 			interrupts = <1 11 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@630 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x630 0x10>;
 			interrupts = <1 12 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@640 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x640 0x10>;
 			interrupts = <1 13 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@650 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x650 0x10>;
 			interrupts = <1 14 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@660 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x660 0x10>;
 			interrupts = <1 15 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		timer@670 {	// General Purpose Timer
-			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			compatible = "fsl,mpc5200-gpt";
 			reg = <0x670 0x10>;
 			interrupts = <1 16 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		rtc@800 {	// Real time clock
-			compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
+			compatible = "fsl,mpc5200-rtc";
 			reg = <0x800 0x100>;
 			interrupts = <1 5 0 1 6 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		gpio@b00 {
-			compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
+			compatible = "fsl,mpc5200-gpio";
 			reg = <0xb00 0x40>;
 			interrupts = <1 7 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		gpio@c00 {
-			compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
+			compatible = "fsl,mpc5200-gpio-wkup";
 			reg = <0xc00 0x40>;
 			interrupts = <1 8 0 0 3 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		spi@f00 {
-			compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
+			compatible = "fsl,mpc5200-spi";
 			reg = <0xf00 0x20>;
 			interrupts = <2 13 0 2 14 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		usb@1000 {
-			compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
+			compatible = "fsl,mpc5200-ohci","ohci-be";
 			reg = <0x1000 0xff>;
 			interrupts = <2 6 0>;
 			interrupt-parent = <&mpc5200_pic>;
 		};
 
 		dma-controller@1200 {
-			compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
+			compatible = "fsl,mpc5200-bestcomm";
 			reg = <0x1200 0x80>;
 			interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
 			              3 4 0  3 5 0  3 6 0  3 7 0
@@ -165,13 +165,13 @@
 		};
 
 		xlb@1f00 {
-			compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb";
+			compatible = "fsl,mpc5200-xlb";
 			reg = <0x1f00 0x100>;
 		};
 
 		serial@2000 {		// PSC1
 			device_type = "serial";
-			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
+			compatible = "fsl,mpc5200-psc-uart";
 			port-number = <0>;  // Logical port assignment
 			reg = <0x2000 0x100>;
 			interrupts = <2 1 0>;
@@ -198,7 +198,7 @@
 
 		serial@2c00 {		// PSC6
 			device_type = "serial";
-			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
+			compatible = "fsl,mpc5200-psc-uart";
 			port-number = <5>;  // Logical port assignment
 			reg = <0x2c00 0x100>;
 			interrupts = <2 4 0>;
@@ -207,7 +207,7 @@
 
 		ethernet@3000 {
 			device_type = "network";
-			compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
+			compatible = "fsl,mpc5200-fec";
 			reg = <0x3000 0x400>;
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <2 5 0>;
@@ -218,7 +218,7 @@
 		mdio@3000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-			compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
+			compatible = "fsl,mpc5200-mdio";
 			reg = <0x3000 0x400>;       // 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>;
@@ -232,7 +232,7 @@
 		i2c@3d40 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-			compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
+			compatible = "fsl,mpc5200-i2c","fsl-i2c";
 			reg = <0x3d40 0x40>;
 			interrupts = <2 16 0>;
 			interrupt-parent = <&mpc5200_pic>;
@@ -240,7 +240,7 @@
 		};
 
 		sram@8000 {
-			compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
+			compatible = "fsl,mpc5200-sram";
 			reg = <0x8000 0x4000>;
 		};
 	};
arch/powerpc/boot/dts/lite5200b.dts +33 -33

261 lines not on this page · raw message

arch/powerpc/boot/dts/motionpro.dts +25 -25

197 lines not on this page · raw message

arch/powerpc/kernel/prom_init.c +1 -1
index 6d6df1e..af837b2 100644
@@ -2179,7 +2179,7 @@ static void __init fixup_device_tree_efika_add_phy(void)
 				" 1 encode-int s\" #address-cells\" property"
 				" 0 encode-int s\" #size-cells\" property"
 				" s\" mdio\" device-name"
-				" s\" fsl,mpc5200b-mdio\" encode-string"
+				" s\" fsl,mpc5200-mdio\" encode-string"
 				" s\" compatible\" property"
 				" 0xf0003000 0x400 reg"
 				" 0x2 encode-int"
drivers/net/fec_mpc52xx_phy.c +1 -1
index 1d0cd1d..cdca6fe 100644
@@ -185,7 +185,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
 };
 
 struct of_platform_driver mpc52xx_fec_mdio_driver = {
-	.name = "mpc5200b-fec-phy",
+	.name = "mpc5200-fec-phy",
 	.probe = mpc52xx_fec_mdio_probe,
 	.remove = mpc52xx_fec_mdio_remove,
 	.match_table = mpc52xx_fec_mdio_match,
#1 lore raw
Quoted 6 lines

The mpc5200b is a bug fix of the mpc5200 with a few incompatible changes. By rights, the current dts trees are the most "correct", but in practical purposes there is no value in the 5200b devices having 2 compatible entries for each internal peripheral node. Freescale has done a good job of documenting exactly where the incompatibilities lie, so it restrict the extra compatible properties to devices with *documented* changes.

And what happens when later an "undocumented change" is found? The device tree should always list the exact version of device used, even if all clients (i.e., the Linux kernel) only use the less-specific "compatible" value; that way, if a need to distinguish arises later (e.g., a model-specific bug workaround), a client can detect the exact model of device without needing a new device tree (that the client in general has no control over).

Quoted 1 line

Removing the extra 'b' fields makes the device trees smaller

That's nice in general, but it hardly overrides more serious concerns.

Segher

#2 lore raw
Quoted 9 lines · Segher Boessenkool
Quoted 8 lines

The mpc5200b is a bug fix of the mpc5200 with a few incompatible changes. By rights, the current dts trees are the most "correct", but in practical purposes there is no value in the 5200b devices having 2 compatible entries for each internal peripheral node. Freescale has done a good job of documenting exactly where the incompatibilities lie, so it restrict the extra compatible properties to devices with *documented* changes.

Quoted 7 lines

And what happens when later an "undocumented change" is found? The device tree should always list the exact version of device used, even if all clients (i.e., the Linux kernel) only use the less-specific "compatible" value; that way, if a need to distinguish arises later (e.g., a model-specific bug workaround), a client can detect the exact model of device without needing a new device tree (that the client in general has no control over).

Yes, I fully agree and understand that. However, even that doesn't fully solve the problem. At what level do you stop trying to describe the device versions in the device tree? What about the case where an earlier silicon version has an undocumented errata? At some point, compatible doesn't help us and we need to resort to looking at other factors (like PVR/SVR) to determine what the device really is.

Early on I decided to differentiate between the 5200 and the 5200b; however, from a practical sense they really are the same part and there is no practical advantage to differentiating between them.

Cheers,
g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.