linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Use aliases instead of linux,network-index on Ebony
@ 2008-02-25  0:33 David Gibson
  2008-02-25  4:34 ` Josh Boyer
  0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2008-02-25  0:33 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This patch alters the Ebony bootwrapper to use the new preferred
method of using aliases to work out which MAC address to attach to
which ethernet device node, rather than the old method based on the
linux,network-index property.

The now obsolete linux,network-index properties are removed from the
ebony device tree as well.  This won't break backwards compatiblity,
because in cases where this fixup code is relevant, the device tree is
part of the kernel image.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

For 2.6.26, tested on an Ebony board with treeboot.

Index: working-2.6/arch/powerpc/boot/ebony.c
===================================================================
--- working-2.6.orig/arch/powerpc/boot/ebony.c	2008-02-25 11:22:31.000000000 +1100
+++ working-2.6/arch/powerpc/boot/ebony.c	2008-02-25 11:23:20.000000000 +1100
@@ -75,7 +75,8 @@ static void ebony_fixups(void)
 
 	ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
 	ibm4xx_sdram_fixup_memsize();
-	dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
+	dt_fixup_mac_address_by_alias("ethernet0", ebony_mac0);
+	dt_fixup_mac_address_by_alias("ethernet1", ebony_mac1);
 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
 	ebony_flashsel_fixup();
 }
Index: working-2.6/arch/powerpc/boot/dts/ebony.dts
===================================================================
--- working-2.6.orig/arch/powerpc/boot/dts/ebony.dts	2008-02-25 11:25:28.000000000 +1100
+++ working-2.6/arch/powerpc/boot/dts/ebony.dts	2008-02-25 11:25:37.000000000 +1100
@@ -243,7 +243,6 @@
 			};
 
 			EMAC0: ethernet@40000800 {
-				linux,network-index = <0>;
 				device_type = "network";
 				compatible = "ibm,emac-440gp", "ibm,emac";
 				interrupt-parent = <&UIC1>;
@@ -263,7 +262,6 @@
 				zmii-channel = <0>;
 			};
 			EMAC1: ethernet@40000900 {
-				linux,network-index = <1>;
 				device_type = "network";
 				compatible = "ibm,emac-440gp", "ibm,emac";
 				interrupt-parent = <&UIC1>;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: Use aliases instead of linux,network-index on Ebony
  2008-02-25  0:33 Use aliases instead of linux,network-index on Ebony David Gibson
@ 2008-02-25  4:34 ` Josh Boyer
  2008-02-25  6:49   ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Boyer @ 2008-02-25  4:34 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras

On Mon, 25 Feb 2008 11:33:39 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> This patch alters the Ebony bootwrapper to use the new preferred
> method of using aliases to work out which MAC address to attach to
> which ethernet device node, rather than the old method based on the
> linux,network-index property.

I like it.  But do we have this new preferred method documented
somewhere?  Doesn't seem to be in booting-without-of.txt.  It probably
should be added there, and reference to the linux,network-index
property removed if this is really preferred now.  Can you add
something to this patch for that?

josh

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

* Re: Use aliases instead of linux,network-index on Ebony
  2008-02-25  4:34 ` Josh Boyer
@ 2008-02-25  6:49   ` David Gibson
  2008-02-25 11:56     ` Josh Boyer
  0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2008-02-25  6:49 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Paul Mackerras

On Sun, Feb 24, 2008 at 10:34:43PM -0600, Josh Boyer wrote:
> On Mon, 25 Feb 2008 11:33:39 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > This patch alters the Ebony bootwrapper to use the new preferred
> > method of using aliases to work out which MAC address to attach to
> > which ethernet device node, rather than the old method based on the
> > linux,network-index property.
> 
> I like it.  But do we have this new preferred method documented
> somewhere?  Doesn't seem to be in booting-without-of.txt.  It probably
> should be added there, and reference to the linux,network-index
> property removed if this is really preferred now.  Can you add
> something to this patch for that?

Hrm.  linux,network-index was mentioned in b-w-o.txt, but to be honest
I don't think it ever belonged there.  It describes a bootloader to
kernel interface, whereas network-index was always a bootwrapper
internal hack, applicable only when the device tree and the fixup code
were built into the one image.

aliases, on the other hand do warrent wider mention, and aren't
mentioned at all in b-w-o.txt, but that's a matter of larger scope
than just getting rid of the network-index hack.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: Use aliases instead of linux,network-index on Ebony
  2008-02-25  6:49   ` David Gibson
@ 2008-02-25 11:56     ` Josh Boyer
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Boyer @ 2008-02-25 11:56 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras

On Mon, 25 Feb 2008 17:49:25 +1100
David Gibson <dwg@au1.ibm.com> wrote:

> On Sun, Feb 24, 2008 at 10:34:43PM -0600, Josh Boyer wrote:
> > On Mon, 25 Feb 2008 11:33:39 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> > 
> > > This patch alters the Ebony bootwrapper to use the new preferred
> > > method of using aliases to work out which MAC address to attach to
> > > which ethernet device node, rather than the old method based on the
> > > linux,network-index property.
> > 
> > I like it.  But do we have this new preferred method documented
> > somewhere?  Doesn't seem to be in booting-without-of.txt.  It probably
> > should be added there, and reference to the linux,network-index
> > property removed if this is really preferred now.  Can you add
> > something to this patch for that?
> 
> Hrm.  linux,network-index was mentioned in b-w-o.txt, but to be honest
> I don't think it ever belonged there.  It describes a bootloader to
> kernel interface, whereas network-index was always a bootwrapper
> internal hack, applicable only when the device tree and the fixup code
> were built into the one image.

That's fine.  But can it you remove reference to it then?

> aliases, on the other hand do warrent wider mention, and aren't
> mentioned at all in b-w-o.txt, but that's a matter of larger scope
> than just getting rid of the network-index hack.

My concern is that people writing new ports will continue to copy DTS
files with linux,network-index in it.  Particularly since it's
recommended in b-w-of.txt, and there is no mentioned alternative.

josh

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

end of thread, other threads:[~2008-02-25 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-25  0:33 Use aliases instead of linux,network-index on Ebony David Gibson
2008-02-25  4:34 ` Josh Boyer
2008-02-25  6:49   ` David Gibson
2008-02-25 11:56     ` Josh Boyer

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).