Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81282
b: refs/heads/master
c: ad16068
h: refs/heads/master
v: v3
  • Loading branch information
Kumar Gala committed Jan 24, 2008
1 parent 61d5b83 commit d0f5b9b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6392f1845b54eefbfa5f3569155451949d250b6d
refs/heads/master: ad160681c8caa0a73e6abd3ac606cd857608f94a
14 changes: 14 additions & 0 deletions trunk/arch/powerpc/boot/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ void dt_fixup_clock(const char *path, u32 freq)
}
}

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",
Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/powerpc/boot/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,23 @@ static inline void *find_node_by_devtype(const void *prev,
return find_node_by_prop_value_str(prev, "device_type", type);
}

static inline void *find_node_by_alias(const char *alias)
{
void *devp = finddevice("/aliases");

if (devp) {
char path[MAX_PATH_LEN];
if (getprop(devp, alias, path, MAX_PATH_LEN) > 0)
return finddevice(path);
}

return NULL;
}

void dt_fixup_memory(u64 start, u64 size);
void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
void dt_fixup_clock(const char *path, u32 freq);
void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr);
void dt_fixup_mac_address(u32 index, const u8 *addr);
void __dt_fixup_mac_addresses(u32 startindex, ...);
#define dt_fixup_mac_addresses(...) \
Expand Down

0 comments on commit d0f5b9b

Please sign in to comment.