linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
@ 2007-06-22 19:33 Timur Tabi
  2007-06-23 15:50 ` Segher Boessenkool
  0 siblings, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-22 19:33 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Timur Tabi

For the 83xx, 85xx, and 86xx device trees, add a "local-mac-address" property
to every Ethernet node that didn't have one.  Add a comment indicating that
the "address" and/or "mac-address" properties are deprecated in DTS files
and will be removed at a later time.  Change all MAC address properties to
have a zero MAC address value.

Signed-off-by: Timur Tabi <timur@freescale.com>
---

This patch is the second-to-last step of a series of changes to U-Boot and the
kernel for cleaning up the MAC address entries in the device trees.  U-Boot was
updated (see U-Boot commits 85e7c7a45e3dd9c7ce3e722352ba60f8df1a7a4b,
bd7851ce1e1f140665b520026abf1042968b1102, and
61f4f912acbe60776c5e00df1ec94094ce672957) to write the MAC address to both
"mac-address" and "local-mac-address".  This provides compatibility with all
DTS files, even ones that are wrong.  The kernel was updated to check
"mac-address" first, and if NULL or non-existant, "local-mac-address" (see
Linux commits e9eb70c92143c8f03e456aa60d89204b3311e554 and
29cfe6f4fb7d187f65564764a0ecf2caf9d8ed58).

This patch only adds the missing "local-mac-address" property to the device
trees.  A later patch, will be named something like "remove deprecated MAC
address properties from device trees" will remove the deprecate properties.
At that time, the device trees will require a recent version of U-Boot to
function.

This patch limits it changes to the 83xx, 85xx, and 86xx trees because those
are the only ones where the code has already been fixed to use the right
entries.  All DTS files should be changed in the same way, but someone else
will have to verify the U-Boot code.

 arch/powerpc/boot/dts/mpc832x_mds.dts  |   16 ++++++++++++++--
 arch/powerpc/boot/dts/mpc832x_rdb.dts  |   16 ++++++++++++++--
 arch/powerpc/boot/dts/mpc8349emitx.dts |   10 ++++++++++
 arch/powerpc/boot/dts/mpc834x_mds.dts  |   10 ++++++++++
 arch/powerpc/boot/dts/mpc836x_mds.dts  |   16 ++++++++++++++--
 arch/powerpc/boot/dts/mpc8540ads.dts   |   27 +++++++++++++++++++++------
 arch/powerpc/boot/dts/mpc8541cds.dts   |    4 ++--
 arch/powerpc/boot/dts/mpc8548cds.dts   |    8 ++++----
 arch/powerpc/boot/dts/mpc8555cds.dts   |    4 ++--
 arch/powerpc/boot/dts/mpc8560ads.dts   |   32 ++++++++++++++++++++++++++++----
 arch/powerpc/boot/dts/mpc8568mds.dts   |   30 +++++++++++++++++++++++++++---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   32 ++++++++++++++++++++++++++++----
 12 files changed, 174 insertions(+), 31 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 112dd51..16a2c3e 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -272,7 +272,13 @@
 			reg = <2200 200>;
 			interrupts = <22>;
 			interrupt-parent = < &qeic >;
-			mac-address = [ 00 04 9f 00 23 23 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <19>;
 			tx-clock = <1a>;
 			phy-handle = < &phy3 >;
@@ -287,7 +293,13 @@
 			reg = <3000 200>;
 			interrupts = <23>;
 			interrupt-parent = < &qeic >;
-			mac-address = [ 00 11 22 33 44 55 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <17>;
 			tx-clock = <18>;
 			phy-handle = < &phy4 >;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index be4c357..447c03f 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -231,7 +231,13 @@
 			reg = <3000 200>;
 			interrupts = <21>;
 			interrupt-parent = <&qeic>;
-			mac-address = [ 00 04 9f ef 03 02 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <20>;
 			tx-clock = <13>;
 			phy-handle = <&phy00>;
@@ -246,7 +252,13 @@
 			reg = <2200 200>;
 			interrupts = <22>;
 			interrupt-parent = <&qeic>;
-			mac-address = [ 00 04 9f ef 03 01 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <19>;
 			tx-clock = <1a>;
 			phy-handle = <&phy04>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index db0d003..ae9bca5 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -131,6 +131,11 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
 			address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <20 8 21 8 22 8>;
@@ -145,6 +150,11 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
 			address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <23 8 24 8 25 8>;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index df773fa..310e877 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -136,6 +136,11 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
 			address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <20 8 21 8 22 8>;
@@ -150,6 +155,11 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
 			address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <23 8 24 8 25 8>;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 38c8594..1e914f3 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -301,7 +301,13 @@
 			reg = <2000 200>;
 			interrupts = <20>;
 			interrupt-parent = < &qeic >;
-			mac-address = [ 00 04 9f 00 23 23 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <0>;
 			tx-clock = <19>;
 			phy-handle = < &phy0 >;
@@ -317,7 +323,13 @@
 			reg = <3000 200>;
 			interrupts = <21>;
 			interrupt-parent = < &qeic >;
-			mac-address = [ 00 11 22 33 44 55 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <0>;
 			tx-clock = <14>;
 			phy-handle = < &phy1 >;
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index d91e81c..78828b2 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -106,8 +106,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			address = [ 00 E0 0C 00 73 00 ];
-			local-mac-address = [ 00 E0 0C 00 73 00 ];
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <d 2 e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -120,8 +125,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			address = [ 00 E0 0C 00 73 01 ];
-			local-mac-address = [ 00 E0 0C 00 73 01 ];
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
@@ -134,8 +144,13 @@
 			model = "FEC";
 			compatible = "gianfar";
 			reg = <26000 1000>;
-			address = [ 00 E0 0C 00 73 02 ];
-			local-mac-address = [ 00 E0 0C 00 73 02 ];
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <19 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy3>;
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 4f2c3af..2a0afbc 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -100,7 +100,7 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <d 2 e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -113,7 +113,7 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 01 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index ad96381..54b4e19 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -112,7 +112,7 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <d 2 e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -125,7 +125,7 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 01 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
@@ -139,7 +139,7 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <26000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 02 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <f 2 10 2 11 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy2>;
@@ -152,7 +152,7 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <27000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 03 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <15 2 16 2 17 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy3>;
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 951ed92..c41ee61 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -100,7 +100,7 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0d 2 0e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -113,7 +113,7 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			local-mac-address = [ 00 E0 0C 00 73 01 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 8068215..205ee32 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -101,7 +101,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			address = [ 00 00 0C 00 00 FD ];
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <d 2 e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -114,7 +120,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			address = [ 00 00 0C 00 01 FD ];
+			/*
+			 * address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
@@ -275,7 +287,13 @@
 				model = "FCC";
 				device-id = <2>;
 				reg = <91320 20 88500 100 913a0 30>;
-				mac-address = [ 00 00 0C 00 02 FD ];
+				/*
+				 * mac-address is deprecated and will be removed
+				 * in 2.6.25.  Only recent versions of
+				 * U-Boot support local-mac-address, however.
+				 */
+				mac-address = [ 00 00 00 00 00 00 ];
+				local-mac-address = [ 00 00 00 00 00 00 ];
 				clock-setup = <ff00ffff 250000>;
 				rx-clock = <15>;
 				tx-clock = <16>;
@@ -290,7 +308,13 @@
 				model = "FCC";
 				device-id = <3>;
 				reg = <91340 20 88600 100 913d0 30>;
-				mac-address = [ 00 00 0C 00 03 FD ];
+				/*
+				 * mac-address is deprecated and will be removed
+				 * in 2.6.25.  Only recent versions of
+				 * U-Boot support local-mac-address, however.
+				 */
+				mac-address = [ 00 00 00 00 00 00 ];
+				local-mac-address = [ 00 00 00 00 00 00 ];
 				clock-setup = <ffff00ff 3700>;
 				rx-clock = <17>;
 				tx-clock = <18>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index a123ec9..479a7a5 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -130,7 +130,13 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
 			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <d 2 e 2 12 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy2>;
@@ -143,7 +149,13 @@
 			model = "eTSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			mac-address = [ 00 00 00 00 00 00];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <13 2 14 2 18 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy3>;
@@ -300,7 +312,13 @@
 			reg = <2000 200>;
 			interrupts = <20>;
 			interrupt-parent = <&qeic>;
-			mac-address = [ 00 04 9f 00 23 23 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <0>;
 			tx-clock = <19>;
 			phy-handle = <&qe_phy0>;
@@ -316,7 +334,13 @@
 			reg = <3000 200>;
 			interrupts = <21>;
 			interrupt-parent = <&qeic>;
-			mac-address = [ 00 11 22 33 44 55 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			rx-clock = <0>;
 			tx-clock = <14>;
 			phy-handle = <&qe_phy1>;
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 260b264..4a99af1 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -117,7 +117,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <24000 1000>;
-			mac-address = [ 00 E0 0C 00 73 00 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <1d 2 1e 2 22 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
@@ -130,7 +136,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <25000 1000>;
-			mac-address = [ 00 E0 0C 00 73 01 ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <23 2 24 2 28 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
@@ -143,7 +155,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <26000 1000>;
-			mac-address = [ 00 E0 0C 00 02 FD ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <1F 2 20 2 21 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy2>;
@@ -156,7 +174,13 @@
 			model = "TSEC";
 			compatible = "gianfar";
 			reg = <27000 1000>;
-			mac-address = [ 00 E0 0C 00 03 FD ];
+			/*
+			 * mac-address is deprecated and will be removed
+			 * in 2.6.25.  Only recent versions of
+			 * U-Boot support local-mac-address, however.
+			 */
+			mac-address = [ 00 00 00 00 00 00 ];
+			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <25 2 26 2 27 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy3>;
-- 
1.5.0.2.260.g2eb065

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-22 19:33 [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees Timur Tabi
@ 2007-06-23 15:50 ` Segher Boessenkool
  2007-06-25 12:50   ` Josh Boyer
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Segher Boessenkool @ 2007-06-23 15:50 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

> For the 83xx, 85xx, and 86xx device trees, add a "local-mac-address" 
> property
> to every Ethernet node that didn't have one.  Add a comment indicating 
> that
> the "address" and/or "mac-address" properties are deprecated in DTS 
> files
> and will be removed at a later time.  Change all MAC address 
> properties to
> have a zero MAC address value.

Shouldn't you use the "??" notation instead, or is that
still not implemented?

Otherwise, looks good, ACK.

[I would have preferred if you had removed "address" right
away (replaced by "mac-address"), but since it is marked
for removal anyway, that's fine with me].


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-23 15:50 ` Segher Boessenkool
@ 2007-06-25 12:50   ` Josh Boyer
  2007-06-25 15:07   ` Timur Tabi
  2007-06-25 16:19   ` Jon Loeliger
  2 siblings, 0 replies; 11+ messages in thread
From: Josh Boyer @ 2007-06-25 12:50 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Timur Tabi

On Sat, 2007-06-23 at 17:50 +0200, Segher Boessenkool wrote:
> > For the 83xx, 85xx, and 86xx device trees, add a "local-mac-address" 
> > property
> > to every Ethernet node that didn't have one.  Add a comment indicating 
> > that
> > the "address" and/or "mac-address" properties are deprecated in DTS 
> > files
> > and will be removed at a later time.  Change all MAC address 
> > properties to
> > have a zero MAC address value.
> 
> Shouldn't you use the "??" notation instead, or is that
> still not implemented?

Not implemented.

josh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-23 15:50 ` Segher Boessenkool
  2007-06-25 12:50   ` Josh Boyer
@ 2007-06-25 15:07   ` Timur Tabi
  2007-06-25 15:46     ` Segher Boessenkool
  2007-06-25 16:19   ` Jon Loeliger
  2 siblings, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-25 15:07 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev

Segher Boessenkool wrote:

> Shouldn't you use the "??" notation instead, or is that
> still not implemented?

I just tested the very latest dtc, and it does not support ??.

> [I would have preferred if you had removed "address" right
> away (replaced by "mac-address"), but since it is marked
> for removal anyway, that's fine with me].

My initial patch removed address and mac-address, but Kumar reminded me that we don't want 
to break things so quickly.  I didn't want to run any regression tests on all these 
platforms and versions to see which obsolete properties could be removed from which DTS.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-25 15:07   ` Timur Tabi
@ 2007-06-25 15:46     ` Segher Boessenkool
  2007-06-25 16:01       ` Timur Tabi
  0 siblings, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2007-06-25 15:46 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

>> Shouldn't you use the "??" notation instead, or is that
>> still not implemented?
>
> I just tested the very latest dtc, and it does not support ??.

Yeah too bad.

>> [I would have preferred if you had removed "address" right
>> away (replaced by "mac-address"), but since it is marked
>> for removal anyway, that's fine with me].
>
> My initial patch removed address and mac-address, but Kumar reminded 
> me that we don't want to break things so quickly.  I didn't want to 
> run any regression tests on all these platforms and versions to see 
> which obsolete properties could be removed from which DTS.

Yup, they're both marked for removal so let's just remove them
at the same time.

Does the kernel provide a warning to users of too-old firmware^Wuboot
telling them to update btw?


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-25 15:46     ` Segher Boessenkool
@ 2007-06-25 16:01       ` Timur Tabi
  2007-06-26  7:40         ` Segher Boessenkool
  0 siblings, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-25 16:01 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev

Segher Boessenkool wrote:

> Yup, they're both marked for removal so let's just remove them
> at the same time.

As soon as Paul creates a "for-2.6.25" branch, that's when I was planning on doing it.

> Does the kernel provide a warning to users of too-old firmware^Wuboot
> telling them to update btw?

Nope.  The current U-Boot code updates mac-address and/or local-mac-address, whichever 
ones exist.  If neither exists, it doesn't do anything.  If both exists, it updates both 
with the same value.  This makes it DTS-agnostic, so to speak.

The kernel looks at each of the properties and uses the first one that has a valid MAC 
address.  Again, this is U-Boot- and DTS-agnostic.

Some older U-Boots would panic if the property it looks for didn't exist.  Some Linux 
drivers would simply not find a MAC address and then fail to load.

In other words, the current U-Boot and Linux code is written to not care what the other 
one does.  I have no plans to remove the code in the kernel that looks for obsolete 
entries (I'm talking about function of_get_mac_address), because it's "safe".

However, now that you mention it, I could update function of_get_mac_address() to display 
a warning if it only finds the 'address' property.  That property is definitely wrong and 
should never be in the DTS or any device tree passed to the kernel.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-23 15:50 ` Segher Boessenkool
  2007-06-25 12:50   ` Josh Boyer
  2007-06-25 15:07   ` Timur Tabi
@ 2007-06-25 16:19   ` Jon Loeliger
  2 siblings, 0 replies; 11+ messages in thread
From: Jon Loeliger @ 2007-06-25 16:19 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev@ozlabs.org, Timur Tabi

On Sat, 2007-06-23 at 10:50, Segher Boessenkool wrote:
> > For the 83xx, 85xx, and 86xx device trees, add a "local-mac-address" 
> > property
> > to every Ethernet node that didn't have one.  Add a comment indicating 
> > that
> > the "address" and/or "mac-address" properties are deprecated in DTS 
> > files
> > and will be removed at a later time.  Change all MAC address 
> > properties to
> > have a zero MAC address value.
> 
> Shouldn't you use the "??" notation instead, or is that
> still not implemented?

That is correct.  It is still not implemented.

jdl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-25 16:01       ` Timur Tabi
@ 2007-06-26  7:40         ` Segher Boessenkool
  2007-06-26 15:22           ` Timur Tabi
  0 siblings, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2007-06-26  7:40 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

>> Yup, they're both marked for removal so let's just remove them
>> at the same time.
>
> As soon as Paul creates a "for-2.6.25" branch, that's when I was 
> planning on doing it.

Sounds like as good a time as any.

>> Does the kernel provide a warning to users of too-old firmware^Wuboot
>> telling them to update btw?
>
> Nope.  The current U-Boot code updates mac-address and/or 
> local-mac-address, whichever ones exist.  If neither exists, it 
> doesn't do anything.  If both exists, it updates both with the same 
> value.  This makes it DTS-agnostic, so to speak.
>
> The kernel looks at each of the properties and uses the first one that 
> has a valid MAC address.  Again, this is U-Boot- and DTS-agnostic.

Yeah, that's fine.   I just meant the current kernel (before
.25) could detect you are using a uboot that won't work after
.25 anymore, and shout at the user.  Would save you some bug
reports ;-)

> In other words, the current U-Boot and Linux code is written to not 
> care what the other one does.  I have no plans to remove the code in 
> the kernel that looks for obsolete entries (I'm talking about function 
> of_get_mac_address), because it's "safe".

Well you should remove the "address" thing, it is _not_ safe.

> However, now that you mention it, I could update function 
> of_get_mac_address() to display a warning if it only finds the 
> 'address' property.

Yeah exactly.

>   That property is definitely wrong and should never be in the DTS or 
> any device tree passed to the kernel.


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-26  7:40         ` Segher Boessenkool
@ 2007-06-26 15:22           ` Timur Tabi
  2007-06-26 15:42             ` Segher Boessenkool
  0 siblings, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-26 15:22 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev

Segher Boessenkool wrote:

> Yeah, that's fine.   I just meant the current kernel (before
> .25) could detect you are using a uboot that won't work after
> .25 anymore, and shout at the user.  Would save you some bug
> reports ;-)

I don't think that's possible.  I'm only updating the DTS files, not the kernel, because 
the kernel has already been updated.  Any 2.6.21 or later kernel will work with any U-Boot 
and any DTS.  The only time we're going to run into a problem is if someone updates the 
DTS but does *not* update U-Boot.  In this case, U-Boot won't find what it's looking for. 
  Some U-Boots will even panic in these cases.  Not only that, but older U-Boots don't 
even check the version number of the device tree they're parsing, and they'll just fail 
silently when they get a version they don't understand.  Unfortunately, I don't see how I 
can fix these problems.

>> In other words, the current U-Boot and Linux code is written to not 
>> care what the other one does.  I have no plans to remove the code in 
>> the kernel that looks for obsolete entries (I'm talking about function 
>> of_get_mac_address), because it's "safe".
> 
> Well you should remove the "address" thing, it is _not_ safe.

Checking for 'address' after finding no match on 'mac-address' and 'local-mac-address' is 
safe, because if that's the only property that has a valid MAC address, I want to use it. 
  As long as there are people out there using U-Boot 1.1.x, we'll need to keep that code 
around.

>> However, now that you mention it, I could update function 
>> of_get_mac_address() to display a warning if it only finds the 
>> 'address' property.
> 
> Yeah exactly.

Ok, I will submit a patch to do that.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-26 15:22           ` Timur Tabi
@ 2007-06-26 15:42             ` Segher Boessenkool
  2007-06-26 15:58               ` Timur Tabi
  0 siblings, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2007-06-26 15:42 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

>> Yeah, that's fine.   I just meant the current kernel (before
>> .25) could detect you are using a uboot that won't work after
>> .25 anymore, and shout at the user.  Would save you some bug
>> reports ;-)
>
> I don't think that's possible.

Hrm I phrased it incorrectly I suppose, I meant something just
like the patch you propose below :-)

> Unfortunately, I don't see how I can fix these problems.

You cannot fix it but you can sometimes detect it.  Not all
that important anyway.

>>> In other words, the current U-Boot and Linux code is written to not 
>>> care what the other one does.  I have no plans to remove the code in 
>>> the kernel that looks for obsolete entries (I'm talking about 
>>> function of_get_mac_address), because it's "safe".
>> Well you should remove the "address" thing, it is _not_ safe.
>
> Checking for 'address' after finding no match on 'mac-address' and 
> 'local-mac-address' is safe, because if that's the only property that 
> has a valid MAC address, I want to use it.  As long as there are 
> people out there using U-Boot 1.1.x, we'll need to keep that code 
> around.

It is not safe since you might happen upon a network device without
"mac-address" property (since the device hasn't been used at boot in
a real OF, or the firmware knows no mac address at all, etc.) and no
"local-mac-address" either -- but it _does_ have an "address", and
it can have an "address" with the correct semantics, not the broken
stuff.

It's not very likely for this happens, sure :-)

>>> However, now that you mention it, I could update function 
>>> of_get_mac_address() to display a warning if it only finds the 
>>> 'address' property.
>> Yeah exactly.
>
> Ok, I will submit a patch to do that.

Thanks!


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
  2007-06-26 15:42             ` Segher Boessenkool
@ 2007-06-26 15:58               ` Timur Tabi
  0 siblings, 0 replies; 11+ messages in thread
From: Timur Tabi @ 2007-06-26 15:58 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev

Segher Boessenkool wrote:

> It is not safe since you might happen upon a network device without
> "mac-address" property (since the device hasn't been used at boot in
> a real OF, or the firmware knows no mac address at all, etc.) and no
> "local-mac-address" either -- but it _does_ have an "address", and
> it can have an "address" with the correct semantics, not the broken
> stuff.
> 
> It's not very likely for this happens, sure :-)

Maybe we're using different definitions of "safe" here.  When I said the code was "safe", 
I meant that it if U-Boot puts the MAC address into the 'address' property only, 
of_get_mac_address() will safely detect that and use the address:

	pp = of_find_property(np, "address", NULL);
	if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
		return pp->value;

It checks if the property exists, that it's 6 bytes long, and that it is a valid MAC 
address.  AFAIK, no version of U-Boot and no DTS file, past or present, will confuse this 
code.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-26 15:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-22 19:33 [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees Timur Tabi
2007-06-23 15:50 ` Segher Boessenkool
2007-06-25 12:50   ` Josh Boyer
2007-06-25 15:07   ` Timur Tabi
2007-06-25 15:46     ` Segher Boessenkool
2007-06-25 16:01       ` Timur Tabi
2007-06-26  7:40         ` Segher Boessenkool
2007-06-26 15:22           ` Timur Tabi
2007-06-26 15:42             ` Segher Boessenkool
2007-06-26 15:58               ` Timur Tabi
2007-06-25 16:19   ` Jon Loeliger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).