summaryrefslogtreecommitdiff
path: root/board/ti
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2013-10-11 12:28:19 -0500
committerMarek Vasut <marex@denx.de>2013-10-20 23:42:42 +0200
commitea02b653c20413b41170ebaca141bd3ffbb200c8 (patch)
treeca998fc16f62717d4da7fea37f4fa2d1ee6e64df /board/ti
parent3d799c7f5e0dd2bea3f4ec839ad7692f7122d992 (diff)
downloadu-boot-imx-ea02b653c20413b41170ebaca141bd3ffbb200c8.zip
u-boot-imx-ea02b653c20413b41170ebaca141bd3ffbb200c8.tar.gz
u-boot-imx-ea02b653c20413b41170ebaca141bd3ffbb200c8.tar.bz2
ARM: omap5-evm: Move MAC creation to misc_init
Move the MAC creation from the USB init to an function that is called on every boot. This will then populate the usbethaddr mac that kernel driver can pick up from the device tree blob. Signed-off-by: Dan Murphy <dmurphy@ti.com>
Diffstat (limited to 'board/ti')
-rw-r--r--board/ti/omap5_uevm/evm.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 6a01200..0044c22 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -110,10 +110,30 @@ static void enable_host_clocks(void)
*/
int misc_init_r(void)
{
+ int reg;
+ uint8_t device_mac[6];
+
#ifdef CONFIG_PALMAS_POWER
palmas_init_settings();
#endif
+ if (!getenv("usbethaddr")) {
+ reg = DIE_ID_REG_BASE + DIE_ID_REG_OFFSET;
+
+ /*
+ * create a fake MAC address from the processor ID code.
+ * first byte is 0x02 to signify locally administered.
+ */
+ device_mac[0] = 0x02;
+ device_mac[1] = readl(reg + 0x10) & 0xff;
+ device_mac[2] = readl(reg + 0xC) & 0xff;
+ device_mac[3] = readl(reg + 0x8) & 0xff;
+ device_mac[4] = readl(reg) & 0xff;
+ device_mac[5] = (readl(reg) >> 8) & 0xff;
+
+ eth_setenv_enetaddr("usbethaddr", device_mac);
+ }
+
return 0;
}
@@ -162,28 +182,9 @@ static struct omap_usbhs_board_data usbhs_bdata = {
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
{
int ret;
- int reg;
- uint8_t device_mac[6];
enable_host_clocks();
- if (!getenv("usbethaddr")) {
- reg = DIE_ID_REG_BASE + DIE_ID_REG_OFFSET;
-
- /*
- * create a fake MAC address from the processor ID code.
- * first byte is 0x02 to signify locally administered.
- */
- device_mac[0] = 0x02;
- device_mac[1] = readl(reg + 0x10) & 0xff;
- device_mac[2] = readl(reg + 0xC) & 0xff;
- device_mac[3] = readl(reg + 0x8) & 0xff;
- device_mac[4] = readl(reg) & 0xff;
- device_mac[5] = (readl(reg) >> 8) & 0xff;
-
- eth_setenv_enetaddr("usbethaddr", device_mac);
- }
-
ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
if (ret < 0) {
puts("Failed to initialize ehci\n");