aboutsummaryrefslogtreecommitdiff
path: root/board/ti/beagle/beagle.c
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-10-23 22:55:22 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-05-02 19:44:11 -0600
commit92b869739c7cd51e319fb2cea1bb2e5d4c6b25ea (patch)
tree8c21550960bb2fac42d18f35b70b98878b88fdc7 /board/ti/beagle/beagle.c
parentd2f5fac206c1653411ddab58a02433a29c4df41f (diff)
OMAP3: Beagle: set mac addr from dieid
TODO: share dieid<-->mac addr code between OMAP3 and OMAP4 Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'board/ti/beagle/beagle.c')
-rw-r--r--board/ti/beagle/beagle.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index e26b38793..f108b06da 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -101,6 +101,29 @@ int board_init(void)
}
/*
+ * Beagle-xM 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.
+ */
+ omap3_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;
+}
+
+/*
* Routine: get_board_revision
* Description: Detect if we are running on a Beagle revision Ax/Bx,
* C1/2/3, C4 or xM. This can be done by reading