[POWERPC] bootwrapper: Add find_node_by_alias and dt_fixup_mac_address_by_alias
Add the ability to set the mac address given the alias for the device.
Removes the need for having a linux,network-index property.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index e5dfe44..60f561e 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -88,6 +88,20 @@
}
}
+void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
+{
+ void *devp = find_node_by_alias(alias);
+
+ if (devp) {
+ printf("%s: local-mac-address <-"
+ " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
+ addr[0], addr[1], addr[2],
+ addr[3], addr[4], addr[5]);
+
+ setprop(devp, "local-mac-address", addr, 6);
+ }
+}
+
void dt_fixup_mac_address(u32 index, const u8 *addr)
{
void *devp = find_node_by_prop_value(NULL, "linux,network-index",