diff options
author | John Rigby <john.rigby@linaro.org> | 2011-12-16 15:50:05 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-05-04 16:28:41 -0600 |
commit | 0c3d57799f2da5bf80f3827b8f15ee2c1d31ca64 (patch) | |
tree | b2a3d84d7940e4908b1582c6d4560d4902b56425 /board | |
parent | be99b9e62429f9580deb9388494f2835ec6b7f66 (diff) |
OMAP4 Panda: Generate a unique usbethaddr
The panda board has a usb nic but the nic has no
rom. Use the die-id to generate a unique address.
This is derived from an RFC kernel patch by Andy Green
that does the same thing:
https://patchwork.kernel.org/patch/660541/
[RFC PATCH 1/2] OMAP2+: add cpu id register to MAC address helper
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/ti/panda/panda.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index ca4b8b35e..2486191a4 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -61,8 +61,27 @@ int board_init(void) return 0; } +/* + * Panda has a usb nic with no ethernet rom so generate a macaddr + * from the SOC die-id and set the usbethaddr env var to that + * value. + */ int board_eth_init(bd_t *bis) { + u8 macaddr[6]; + char usbethaddr[20]; + + /* + * NB: The 1 here has been found to generate an address + * consistent with the kernel. + */ + omap4_die_id_to_ethernet_mac(macaddr, 1); + sprintf (usbethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", + macaddr[0], macaddr[1], + macaddr[2], macaddr[3], + macaddr[4], macaddr[5]) ; + setenv ("usbethaddr", usbethaddr); + return 0; } |