]> err.no Git - linux-2.6/commitdiff
[POWERPC] Start removing linux,network-index in favour of aliases
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 26 Feb 2008 00:43:20 +0000 (11:43 +1100)
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>
Wed, 26 Mar 2008 12:19:16 +0000 (07:19 -0500)
This patch alters the bootwrapper for a number of machines (roubhly
all 4xx based cuboot or treeboot platforms) to use aliases instead of
the linux,network-index hack to work out which MAC address to attach
to which ethernet device node.

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

The references to linux,network-index are removed from
booting-without-of.txt.  Not only is it now deprecated, but as a hack
applicable only when the device tree blob and fixup code were in the
same image, this property never belonged in booting-without-of.txt
which describes the interface between the kernel and firmware or
bootloaders which produce a device tree.  By the time the device tree
reaches the kernel, all the MAC addresses must be fully filled in.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
15 files changed:
Documentation/powerpc/booting-without-of.txt
arch/powerpc/boot/bamboo.c
arch/powerpc/boot/cuboot-rainier.c
arch/powerpc/boot/cuboot-sequoia.c
arch/powerpc/boot/cuboot-taishan.c
arch/powerpc/boot/cuboot-warp.c
arch/powerpc/boot/dts/bamboo.dts
arch/powerpc/boot/dts/ebony.dts
arch/powerpc/boot/dts/rainier.dts
arch/powerpc/boot/dts/sequoia.dts
arch/powerpc/boot/dts/taishan.dts
arch/powerpc/boot/dts/walnut.dts
arch/powerpc/boot/dts/warp.dts
arch/powerpc/boot/ebony.c
arch/powerpc/boot/treeboot-walnut.c

index 7b4e8a70882c2ff4fb4d61e4bc12a4987a7d06eb..1df9d4cfc0e66304216548111a3eeb1474121192 100644 (file)
@@ -1269,10 +1269,6 @@ platforms are moved over to use the flattened-device-tree model.
 
   Recommended properties:
 
-    - linux,network-index : This is the intended "index" of this
-      network device.  This is used by the bootwrapper to interpret
-      MAC addresses passed by the firmware when no information other
-      than indices is available to associate an address with a device.
     - phy-connection-type : a string naming the controller/PHY interface type,
       i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
       "tbi", or "rtbi".  This property is only really needed if the connection
@@ -1667,10 +1663,6 @@ platforms are moved over to use the flattened-device-tree model.
    - phy-handle : The phandle for the PHY connected to this controller.
 
    Recommended properties:
-   - linux,network-index : This is the intended "index" of this
-     network device.  This is used by the bootwrapper to interpret
-     MAC addresses passed by the firmware when no information other
-     than indices is available to associate an address with a device.
    - phy-connection-type : a string naming the controller/PHY interface type,
      i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
      Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
@@ -1995,7 +1987,6 @@ platforms are moved over to use the flattened-device-tree model.
                interrupts = <20 8>;
                interrupt-parent = <&PIC>;
                phy-handle = <&PHY0>;
-               linux,network-index = <0>;
                fsl,cpm-command = <12000300>;
        };
 
@@ -2217,12 +2208,6 @@ platforms are moved over to use the flattened-device-tree model.
                          EMAC, that is the content of the current (bogus) "phy-port"
                          property.
 
-    Recommended properties:
-    - linux,network-index : This is the intended "index" of this
-      network device.  This is used by the bootwrapper to interpret
-      MAC addresses passed by the firmware when no information other
-      than indices is available to associate an address with a device.
-
     Optional properties:
     - phy-address       : 1 cell, optional, MDIO address of the PHY. If absent,
                          a search is performed.
@@ -2246,7 +2231,6 @@ platforms are moved over to use the flattened-device-tree model.
     Example:
 
        EMAC0: ethernet@40000800 {
-               linux,network-index = <0>;
                device_type = "network";
                compatible = "ibm,emac-440gp", "ibm,emac";
                interrupt-parent = <&UIC1>;
index 54b33f1500e24dcf9ae87ce597013f31216e8a84..b82cacbc60dbc5962b27392e7f804ec5a22e235e 100644 (file)
@@ -33,7 +33,8 @@ static void bamboo_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
        ibm4xx_sdram_fixup_memsize();
        ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
-       dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
+       dt_fixup_mac_address_by_alias("ethernet0", bamboo_mac0);
+       dt_fixup_mac_address_by_alias("ethernet1", bamboo_mac1);
 }
 
 void bamboo_init(void *mac0, void *mac1)
index cf452b66dce8235671aaae32510cc506204d68cb..0a3fddee54dfab38eecb2d6f779026525eda31c5 100644 (file)
@@ -42,7 +42,8 @@ static void rainier_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
        ibm4xx_denali_fixup_memsize();
-       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 }
 
 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
index f555575a44ded1e2bf0adfd23856d9edebb3fd48..caf8f2e842ea459f28ee7f02e85df08bfad9649e 100644 (file)
@@ -42,7 +42,8 @@ static void sequoia_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
        ibm4xx_denali_fixup_memsize();
-       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 }
 
 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
index b55b80467eed9b23e70d7347e134745723116af1..9bc906a754dd53dbdbab24f6d5721fcf4f6835ff 100644 (file)
@@ -40,7 +40,8 @@ static void taishan_fixups(void)
 
        ibm4xx_sdram_fixup_memsize();
 
-       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
 }
index 3db93e85e9eaa65cc954bfdf0384d3e273b761f0..eb108a877492adad8771416e749655999111f7f4 100644 (file)
@@ -24,7 +24,7 @@ static void warp_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_sdram_fixup_memsize();
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
-       dt_fixup_mac_addresses(&bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
 }
 
 
index 7dc37c9a7446b28d58af7a1d5134bfb43f89b21f..ba2521bdaab1ccdb7423acaa97ec9ea47985934d 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
index 0b000cb7ed8b3983fe1e2e659210c8b54f3b7ed4..5079dc890e0e47915f9c5dfce531093f0f26e618 100644 (file)
                        };
 
                        EMAC0: ethernet@40000800 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
                                zmii-channel = <0>;
                        };
                        EMAC1: ethernet@40000900 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
index f947c75a2e94b724166700306eda2067fa9d726a..9f6f58b2e077bf82c4f293d7f017a1f8d432d591 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC0>;
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC1>;
index 8db9515d7dc3dab3ff486c4357c26a5bbda91ceb..675026bf1fb0103a2fd4c0399051c6d44dc9d717 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC0>;
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC1>;
index 8278068c802c8c0926377a9adfaefdfc401e1937..466c3f35ce132871a3b7c168baac682c53125fa8 100644 (file)
 
                        EMAC0: ethernet@40000800 {
                                unused = <1>;
-                               linux,network-index = <2>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC1>;
                        };
                        EMAC1: ethernet@40000900 {
                                unused = <1>;
-                               linux,network-index = <3>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC1>;
                        };
 
                        EMAC2: ethernet@40000c00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC2>;
                        };
 
                        EMAC3: ethernet@40000e00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC2>;
index dcc21b0438e5f4e56d3761f1e2053a5c02ca5554..a328607c8f84d40389776088bc830a27d933498e 100644 (file)
                        };
 
                        EMAC: ethernet@ef600800 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-405gp", "ibm,emac";
                                interrupt-parent = <&UIC0>;
index dc1499d30f43ce3bbfa57cdf7aff76b7335e55a4..b04a52e22bf5b3b6607fbe274fe05b19c044d4cc 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
index f61364c47a763ffe05306c45a7ad24f05570e8d7..5532ab3221dde712c33c58412c601263e2e657f0 100644 (file)
@@ -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 472e36605a52672f5ccd03ce4744ef720e276b4d..097974e59faced80a623d24a8eadd001e81c062a 100644 (file)
@@ -68,7 +68,7 @@ static void walnut_fixups(void)
        ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
        ibm4xx_fixup_ebc_ranges("/plb/ebc");
        walnut_flashsel_fixup();
-       dt_fixup_mac_addresses((u8 *) WALNUT_OPENBIOS_MAC_OFF);
+       dt_fixup_mac_address_by_alias("ethernet0", (u8 *) WALNUT_OPENBIOS_MAC_OFF);
 }
 
 void platform_init(void)