* [PATCH] Convert to mac-address for ethernet MAC address data.
@ 2006-08-03 21:25 Jon Loeliger
2006-08-03 21:49 ` Kumar Gala
0 siblings, 1 reply; 4+ messages in thread
From: Jon Loeliger @ 2006-08-03 21:25 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
onvert to mac-address for ethernet MAC address data.
Also accept "local-mac-address". However the old "address"
is now obsolete, but accepted for backwards compatibility.
It should be removed after all device trees have been
converted to use "mac-address".
Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
Documentation/powerpc/booting-without-of.txt | 10 +++++-----
arch/powerpc/sysdev/fsl_soc.c | 12 ++++++++++--
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 3c62e66..8c48b8a 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1196,7 +1196,7 @@ platforms are moved over to use the flat
- model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
- compatible : Should be "gianfar"
- reg : Offset and length of the register set for the device
- - address : List of bytes representing the ethernet address of
+ - mac-address : List of bytes representing the ethernet address of
this controller
- interrupts : <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
@@ -1216,7 +1216,7 @@ platforms are moved over to use the flat
model = "TSEC";
compatible = "gianfar";
reg = <24000 1000>;
- address = [ 00 E0 0C 00 73 00 ];
+ mac-address = [ 00 E0 0C 00 73 00 ];
interrupts = <d 3 e 3 12 3>;
interrupt-parent = <40000>;
phy-handle = <2452000>
@@ -1498,7 +1498,7 @@ not necessary as they are usually the sa
model = "TSEC";
compatible = "gianfar";
reg = <24000 1000>;
- address = [ 00 E0 0C 00 73 00 ];
+ mac-address = [ 00 E0 0C 00 73 00 ];
interrupts = <d 3 e 3 12 3>;
interrupt-parent = <40000>;
phy-handle = <2452000>;
@@ -1511,7 +1511,7 @@ not necessary as they are usually the sa
model = "TSEC";
compatible = "gianfar";
reg = <25000 1000>;
- address = [ 00 E0 0C 00 73 01 ];
+ mac-address = [ 00 E0 0C 00 73 01 ];
interrupts = <13 3 14 3 18 3>;
interrupt-parent = <40000>;
phy-handle = <2452001>;
@@ -1524,7 +1524,7 @@ not necessary as they are usually the sa
model = "FEC";
compatible = "gianfar";
reg = <26000 1000>;
- address = [ 00 E0 0C 00 73 02 ];
+ mac-address = [ 00 E0 0C 00 73 02 ];
interrupts = <19 3>;
interrupt-parent = <40000>;
phy-handle = <2452002>;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 4a6aa64..92ba378 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -166,8 +166,16 @@ static int __init gfar_of_init(void)
goto err;
}
- mac_addr = get_property(np, "address", NULL);
- memcpy(gfar_data.mac_addr, mac_addr, 6);
+ mac_addr = get_property(np, "local-mac-address", NULL);
+ if (mac_addr == NULL)
+ mac_addr = get_property(np, "mac-address", NULL);
+ if (mac_addr == NULL) {
+ /* Obsolete */
+ mac_addr = get_property(np, "address", NULL);
+ }
+
+ if (mac_addr)
+ memcpy(gfar_data.mac_addr, mac_addr, 6);
if (model && !strcasecmp(model, "TSEC"))
gfar_data.device_flags =
--
2006_06_07.01.gittree_pull-dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Convert to mac-address for ethernet MAC address data.
2006-08-03 21:25 [PATCH] Convert to mac-address for ethernet MAC address data Jon Loeliger
@ 2006-08-03 21:49 ` Kumar Gala
2006-08-03 21:55 ` Jon Loeliger
2006-08-16 23:15 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 4+ messages in thread
From: Kumar Gala @ 2006-08-03 21:49 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
On Aug 3, 2006, at 4:25 PM, Jon Loeliger wrote:
> onvert to mac-address for ethernet MAC address data.
>
> Also accept "local-mac-address". However the old "address"
> is now obsolete, but accepted for backwards compatibility.
> It should be removed after all device trees have been
> converted to use "mac-address".
>
> Signed-off-by: Jon Loeliger <jdl@freescale.com>
> ---
> Documentation/powerpc/booting-without-of.txt | 10 +++++-----
> arch/powerpc/sysdev/fsl_soc.c | 12 ++++++++++--
> 2 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/powerpc/booting-without-of.txt b/
> Documentation/powerpc/booting-without-of.txt
> index 3c62e66..8c48b8a 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
> @@ -1196,7 +1196,7 @@ platforms are moved over to use the flat
> - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
> - compatible : Should be "gianfar"
> - reg : Offset and length of the register set for the device
> - - address : List of bytes representing the ethernet address of
> + - mac-address : List of bytes representing the ethernet
> address of
> this controller
> - interrupts : <a b> where a is the interrupt number and b is a
> field that represents an encoding of the sense and level
> @@ -1216,7 +1216,7 @@ platforms are moved over to use the flat
> model = "TSEC";
> compatible = "gianfar";
> reg = <24000 1000>;
> - address = [ 00 E0 0C 00 73 00 ];
> + mac-address = [ 00 E0 0C 00 73 00 ];
> interrupts = <d 3 e 3 12 3>;
> interrupt-parent = <40000>;
> phy-handle = <2452000>
> @@ -1498,7 +1498,7 @@ not necessary as they are usually the sa
> model = "TSEC";
> compatible = "gianfar";
> reg = <24000 1000>;
> - address = [ 00 E0 0C 00 73 00 ];
> + mac-address = [ 00 E0 0C 00 73 00 ];
> interrupts = <d 3 e 3 12 3>;
> interrupt-parent = <40000>;
> phy-handle = <2452000>;
> @@ -1511,7 +1511,7 @@ not necessary as they are usually the sa
> model = "TSEC";
> compatible = "gianfar";
> reg = <25000 1000>;
> - address = [ 00 E0 0C 00 73 01 ];
> + mac-address = [ 00 E0 0C 00 73 01 ];
> interrupts = <13 3 14 3 18 3>;
> interrupt-parent = <40000>;
> phy-handle = <2452001>;
> @@ -1524,7 +1524,7 @@ not necessary as they are usually the sa
> model = "FEC";
> compatible = "gianfar";
> reg = <26000 1000>;
> - address = [ 00 E0 0C 00 73 02 ];
> + mac-address = [ 00 E0 0C 00 73 02 ];
> interrupts = <19 3>;
> interrupt-parent = <40000>;
> phy-handle = <2452002>;
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/
> fsl_soc.c
> index 4a6aa64..92ba378 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -166,8 +166,16 @@ static int __init gfar_of_init(void)
> goto err;
> }
>
> - mac_addr = get_property(np, "address", NULL);
> - memcpy(gfar_data.mac_addr, mac_addr, 6);
> + mac_addr = get_property(np, "local-mac-address", NULL);
If "mac-address" the preferred mechanism, why dont we check for it
first?
> + if (mac_addr == NULL)
> + mac_addr = get_property(np, "mac-address", NULL);
> + if (mac_addr == NULL) {
> + /* Obsolete */
> + mac_addr = get_property(np, "address", NULL);
> + }
> +
> + if (mac_addr)
> + memcpy(gfar_data.mac_addr, mac_addr, 6);
>
> if (model && !strcasecmp(model, "TSEC"))
> gfar_data.device_flags =
> --
> 2006_06_07.01.gittree_pull-dirty
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Convert to mac-address for ethernet MAC address data.
2006-08-03 21:49 ` Kumar Gala
@ 2006-08-03 21:55 ` Jon Loeliger
2006-08-16 23:15 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 4+ messages in thread
From: Jon Loeliger @ 2006-08-03 21:55 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org
On Thu, 2006-08-03 at 16:49, Kumar Gala wrote:
> >
> > - mac_addr = get_property(np, "address", NULL);
> > - memcpy(gfar_data.mac_addr, mac_addr, 6);
> > + mac_addr = get_property(np, "local-mac-address", NULL);
>
> If "mac-address" the preferred mechanism, why dont we check for it
> first?
It's not. "local-mac-address" is. But that is HW specific.
SW version comes in as "mac-address". Here's what was said
earlier by Paul Nasrat:
Well I'm biased and say we shouldn't reinvent the wheel
with dtc if we don't need to. I've sent Jon a patch to
start validating this for dtc and am waiting feedback
before I add additional device_types. So we should have
local-mac-address be preassiged hwaddr and mac-address last
used. For some setups this would be the same persistently,
but I can envisage some non OF setups populating mac-address
from the card.
Paul
Which I interpreted to mean the order: local-mac-address first,
mac-address next, and the obsolete one, "address" last.
jdl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Convert to mac-address for ethernet MAC address data.
2006-08-03 21:49 ` Kumar Gala
2006-08-03 21:55 ` Jon Loeliger
@ 2006-08-16 23:15 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-08-16 23:15 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org
On Thu, 2006-08-03 at 16:49 -0500, Kumar Gala wrote:
> On Aug 3, 2006, at 4:25 PM, Jon Loeliger wrote:
>
> > onvert to mac-address for ethernet MAC address data.
> >
> > Also accept "local-mac-address". However the old "address"
> > is now obsolete, but accepted for backwards compatibility.
> > It should be removed after all device trees have been
> > converted to use "mac-address".
Why not stick to local-mac-address as this is the OF standard ?
Cheers,
Ben.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-16 23:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 21:25 [PATCH] Convert to mac-address for ethernet MAC address data Jon Loeliger
2006-08-03 21:49 ` Kumar Gala
2006-08-03 21:55 ` Jon Loeliger
2006-08-16 23:15 ` Benjamin Herrenschmidt
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).