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-08-16 10:09:58 -0600
commitdb1d3d55cc02cd63f42e023490c5027b25d2334c (patch)
tree7fb5ee1c7e6ea33f8f9fa81fd83344b4b5a8ed2f /board/ti/beagle/beagle.c
parent9b1eb6e7c04afd3763db35b6f661415d292b7a52 (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 2ef22900d..7d4710fcd 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -102,6 +102,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