powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
Subsystems (2)
PATCH 1/1 powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
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.
---
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(-)
arch/powerpc/boot/dts/mpc832x_mds.dts +14 -2
@@ -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 >;
arch/powerpc/boot/dts/mpc832x_rdb.dts +14 -2
@@ -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>;
arch/powerpc/boot/dts/mpc8349emitx.dts +10 -0
@@ -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>;
arch/powerpc/boot/dts/mpc834x_mds.dts +10 -0
@@ -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>;
arch/powerpc/boot/dts/mpc836x_mds.dts +14 -2
@@ -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 >;
arch/powerpc/boot/dts/mpc8540ads.dts +21 -6
@@ -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>;
arch/powerpc/boot/dts/mpc8541cds.dts +2 -2
@@ -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>;
arch/powerpc/boot/dts/mpc8548cds.dts +4 -4
@@ -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>;
arch/powerpc/boot/dts/mpc8555cds.dts +2 -2
@@ -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>;
arch/powerpc/boot/dts/mpc8560ads.dts +28 -4
@@ -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>;
arch/powerpc/boot/dts/mpc8568mds.dts +27 -3
@@ -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>;
arch/powerpc/boot/dts/mpc8641_hpcn.dts +28 -4
@@ -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>;
Signature · 1 line
1.5.0.2.260.g2eb065
Quoted 5 lines
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
Quoted 10 lines · Segher Boessenkool
Quoted 9 lines
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.
Quoted 2 lines
Shouldn't you use the "??" notation instead, or is that still not implemented?
Not implemented.
josh
Quoted 2 lines · Segher Boessenkool
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 ??.
Quoted 3 lines
[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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 4 lines
Quoted 2 lines
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.
Quoted 5 lines
Quoted 3 lines
[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
Quoted 2 lines · Segher Boessenkool
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.
Quoted 2 lines
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 4 lines
Quoted 2 lines
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.
Quoted 6 lines
Quoted 2 lines
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 ;-)
Quoted 1 line
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.
Quoted 1 line
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.
Quoted 2 lines
That property is definitely wrong and should never be in the DTS or
any device tree passed to the kernel.
Segher
Quoted 4 lines · Segher Boessenkool
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.
Quoted 3 lines
Quoted 1 line
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.
Quoted 3 lines
Quoted 1 line
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 6 lines
Quoted 4 lines
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 :-)
Quoted 1 line
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.
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
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 :-)
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
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
Quoted 8 lines · Segher Boessenkool
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 10 lines · Segher Boessenkool
Quoted 9 lines
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.
Quoted 2 lines
Shouldn't you use the "??" notation instead, or is that still not implemented?
That is correct. It is still not implemented.
jdl