aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/devtree.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-01-15 10:30:32 -0500
committerKumar Gala <galak@kernel.crashing.org>2008-01-23 20:32:44 -0500
commitad160681c8caa0a73e6abd3ac606cd857608f94a (patch)
treeb3e1a48096c03ff83fdf5b0dfccd2434c57c9621 /arch/powerpc/boot/devtree.c
parent6392f1845b54eefbfa5f3569155451949d250b6d (diff)
[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>
Diffstat (limited to 'arch/powerpc/boot/devtree.c')
-rw-r--r--arch/powerpc/boot/devtree.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index e5dfe4497313..60f561e307a9 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -88,6 +88,20 @@ void dt_fixup_clock(const char *path, u32 freq)
88 } 88 }
89} 89}
90 90
91void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
92{
93 void *devp = find_node_by_alias(alias);
94
95 if (devp) {
96 printf("%s: local-mac-address <-"
97 " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
98 addr[0], addr[1], addr[2],
99 addr[3], addr[4], addr[5]);
100
101 setprop(devp, "local-mac-address", addr, 6);
102 }
103}
104
91void dt_fixup_mac_address(u32 index, const u8 *addr) 105void dt_fixup_mac_address(u32 index, const u8 *addr)
92{ 106{
93 void *devp = find_node_by_prop_value(NULL, "linux,network-index", 107 void *devp = find_node_by_prop_value(NULL, "linux,network-index",