Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] Start removing linux,network-index in favour of aliases

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>

authored by

David Gibson and committed by
Josh Boyer
ecc6cd73 54f53f2b

+12 -37
-16
Documentation/powerpc/booting-without-of.txt
··· 1269 1269 1270 1270 Recommended properties: 1271 1271 1272 - - linux,network-index : This is the intended "index" of this 1273 - network device. This is used by the bootwrapper to interpret 1274 - MAC addresses passed by the firmware when no information other 1275 - than indices is available to associate an address with a device. 1276 1272 - phy-connection-type : a string naming the controller/PHY interface type, 1277 1273 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", 1278 1274 "tbi", or "rtbi". This property is only really needed if the connection ··· 1663 1667 - phy-handle : The phandle for the PHY connected to this controller. 1664 1668 1665 1669 Recommended properties: 1666 - - linux,network-index : This is the intended "index" of this 1667 - network device. This is used by the bootwrapper to interpret 1668 - MAC addresses passed by the firmware when no information other 1669 - than indices is available to associate an address with a device. 1670 1670 - phy-connection-type : a string naming the controller/PHY interface type, 1671 1671 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal 1672 1672 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only), ··· 1987 1995 interrupts = <20 8>; 1988 1996 interrupt-parent = <&PIC>; 1989 1997 phy-handle = <&PHY0>; 1990 - linux,network-index = <0>; 1991 1998 fsl,cpm-command = <12000300>; 1992 1999 }; 1993 2000 ··· 2208 2217 EMAC, that is the content of the current (bogus) "phy-port" 2209 2218 property. 2210 2219 2211 - Recommended properties: 2212 - - linux,network-index : This is the intended "index" of this 2213 - network device. This is used by the bootwrapper to interpret 2214 - MAC addresses passed by the firmware when no information other 2215 - than indices is available to associate an address with a device. 2216 - 2217 2220 Optional properties: 2218 2221 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent, 2219 2222 a search is performed. ··· 2231 2246 Example: 2232 2247 2233 2248 EMAC0: ethernet@40000800 { 2234 - linux,network-index = <0>; 2235 2249 device_type = "network"; 2236 2250 compatible = "ibm,emac-440gp", "ibm,emac"; 2237 2251 interrupt-parent = <&UIC1>;
+2 -1
arch/powerpc/boot/bamboo.c
··· 33 33 ibm440ep_fixup_clocks(sysclk, 11059200, 25000000); 34 34 ibm4xx_sdram_fixup_memsize(); 35 35 ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00); 36 - dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1); 36 + dt_fixup_mac_address_by_alias("ethernet0", bamboo_mac0); 37 + dt_fixup_mac_address_by_alias("ethernet1", bamboo_mac1); 37 38 } 38 39 39 40 void bamboo_init(void *mac0, void *mac1)
+2 -1
arch/powerpc/boot/cuboot-rainier.c
··· 42 42 ibm440ep_fixup_clocks(sysclk, 11059200, 50000000); 43 43 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 44 44 ibm4xx_denali_fixup_memsize(); 45 - dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr); 45 + dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 46 + dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); 46 47 } 47 48 48 49 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+2 -1
arch/powerpc/boot/cuboot-sequoia.c
··· 42 42 ibm440ep_fixup_clocks(sysclk, 11059200, 50000000); 43 43 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 44 44 ibm4xx_denali_fixup_memsize(); 45 - dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr); 45 + dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 46 + dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); 46 47 } 47 48 48 49 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+2 -1
arch/powerpc/boot/cuboot-taishan.c
··· 40 40 41 41 ibm4xx_sdram_fixup_memsize(); 42 42 43 - dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr); 43 + dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 44 + dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); 44 45 45 46 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 46 47 }
+1 -1
arch/powerpc/boot/cuboot-warp.c
··· 24 24 ibm440ep_fixup_clocks(sysclk, 11059200, 50000000); 25 25 ibm4xx_sdram_fixup_memsize(); 26 26 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 27 - dt_fixup_mac_addresses(&bd.bi_enetaddr); 27 + dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 28 28 } 29 29 30 30
-2
arch/powerpc/boot/dts/bamboo.dts
··· 204 204 }; 205 205 206 206 EMAC0: ethernet@ef600e00 { 207 - linux,network-index = <0>; 208 207 device_type = "network"; 209 208 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac"; 210 209 interrupt-parent = <&UIC1>; ··· 224 225 }; 225 226 226 227 EMAC1: ethernet@ef600f00 { 227 - linux,network-index = <1>; 228 228 device_type = "network"; 229 229 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac"; 230 230 interrupt-parent = <&UIC1>;
-2
arch/powerpc/boot/dts/ebony.dts
··· 241 241 }; 242 242 243 243 EMAC0: ethernet@40000800 { 244 - linux,network-index = <0>; 245 244 device_type = "network"; 246 245 compatible = "ibm,emac-440gp", "ibm,emac"; 247 246 interrupt-parent = <&UIC1>; ··· 260 261 zmii-channel = <0>; 261 262 }; 262 263 EMAC1: ethernet@40000900 { 263 - linux,network-index = <1>; 264 264 device_type = "network"; 265 265 compatible = "ibm,emac-440gp", "ibm,emac"; 266 266 interrupt-parent = <&UIC1>;
-2
arch/powerpc/boot/dts/rainier.dts
··· 254 254 }; 255 255 256 256 EMAC0: ethernet@ef600e00 { 257 - linux,network-index = <0>; 258 257 device_type = "network"; 259 258 compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4"; 260 259 interrupt-parent = <&EMAC0>; ··· 283 284 }; 284 285 285 286 EMAC1: ethernet@ef600f00 { 286 - linux,network-index = <1>; 287 287 device_type = "network"; 288 288 compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4"; 289 289 interrupt-parent = <&EMAC1>;
-2
arch/powerpc/boot/dts/sequoia.dts
··· 269 269 }; 270 270 271 271 EMAC0: ethernet@ef600e00 { 272 - linux,network-index = <0>; 273 272 device_type = "network"; 274 273 compatible = "ibm,emac-440epx", "ibm,emac4"; 275 274 interrupt-parent = <&EMAC0>; ··· 298 299 }; 299 300 300 301 EMAC1: ethernet@ef600f00 { 301 - linux,network-index = <1>; 302 302 device_type = "network"; 303 303 compatible = "ibm,emac-440epx", "ibm,emac4"; 304 304 interrupt-parent = <&EMAC1>;
-4
arch/powerpc/boot/dts/taishan.dts
··· 235 235 236 236 EMAC0: ethernet@40000800 { 237 237 unused = <1>; 238 - linux,network-index = <2>; 239 238 device_type = "network"; 240 239 compatible = "ibm,emac-440gx", "ibm,emac4"; 241 240 interrupt-parent = <&UIC1>; ··· 255 256 }; 256 257 EMAC1: ethernet@40000900 { 257 258 unused = <1>; 258 - linux,network-index = <3>; 259 259 device_type = "network"; 260 260 compatible = "ibm,emac-440gx", "ibm,emac4"; 261 261 interrupt-parent = <&UIC1>; ··· 275 277 }; 276 278 277 279 EMAC2: ethernet@40000c00 { 278 - linux,network-index = <0>; 279 280 device_type = "network"; 280 281 compatible = "ibm,emac-440gx", "ibm,emac4"; 281 282 interrupt-parent = <&UIC2>; ··· 297 300 }; 298 301 299 302 EMAC3: ethernet@40000e00 { 300 - linux,network-index = <1>; 301 303 device_type = "network"; 302 304 compatible = "ibm,emac-440gx", "ibm,emac4"; 303 305 interrupt-parent = <&UIC2>;
-1
arch/powerpc/boot/dts/walnut.dts
··· 125 125 }; 126 126 127 127 EMAC: ethernet@ef600800 { 128 - linux,network-index = <0>; 129 128 device_type = "network"; 130 129 compatible = "ibm,emac-405gp", "ibm,emac"; 131 130 interrupt-parent = <&UIC0>;
-1
arch/powerpc/boot/dts/warp.dts
··· 204 204 }; 205 205 206 206 EMAC0: ethernet@ef600e00 { 207 - linux,network-index = <0>; 208 207 device_type = "network"; 209 208 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac"; 210 209 interrupt-parent = <&UIC1>;
+2 -1
arch/powerpc/boot/ebony.c
··· 75 75 76 76 ibm440gp_fixup_clocks(sysclk, 6 * 1843200); 77 77 ibm4xx_sdram_fixup_memsize(); 78 - dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); 78 + dt_fixup_mac_address_by_alias("ethernet0", ebony_mac0); 79 + dt_fixup_mac_address_by_alias("ethernet1", ebony_mac1); 79 80 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 80 81 ebony_flashsel_fixup(); 81 82 }
+1 -1
arch/powerpc/boot/treeboot-walnut.c
··· 68 68 ibm4xx_quiesce_eth((u32 *)0xef600800, NULL); 69 69 ibm4xx_fixup_ebc_ranges("/plb/ebc"); 70 70 walnut_flashsel_fixup(); 71 - dt_fixup_mac_addresses((u8 *) WALNUT_OPENBIOS_MAC_OFF); 71 + dt_fixup_mac_address_by_alias("ethernet0", (u8 *) WALNUT_OPENBIOS_MAC_OFF); 72 72 } 73 73 74 74 void platform_init(void)