summaryrefslogtreecommitdiff
path: root/board/freescale/mx28_evk
diff options
context:
space:
mode:
authorFrank Li <frank.li@freescale.com>2010-07-30 12:57:07 +0800
committerFrank Li <frank.li@freescale.com>2010-07-30 12:59:27 +0800
commit9fb5acfda21d655864072d0bf8fbf8602bda543a (patch)
treedc18f4793777648bfe92c701e6424c26360ecab5 /board/freescale/mx28_evk
parent1c93b155346d863cec674e92c82eb5e1a590779a (diff)
downloadu-boot-imx-9fb5acfda21d655864072d0bf8fbf8602bda543a.zip
u-boot-imx-9fb5acfda21d655864072d0bf8fbf8602bda543a.tar.gz
u-boot-imx-9fb5acfda21d655864072d0bf8fbf8602bda543a.tar.bz2
ENGR00125735 iMX28 read mac address from fuse
Read mac address from fuse Signed-off-by: Frank Li <frank.li@freescale.com>
Diffstat (limited to 'board/freescale/mx28_evk')
-rw-r--r--board/freescale/mx28_evk/mx28_evk.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/freescale/mx28_evk/mx28_evk.c b/board/freescale/mx28_evk/mx28_evk.c
index 714cb67..814c5b0 100644
--- a/board/freescale/mx28_evk/mx28_evk.c
+++ b/board/freescale/mx28_evk/mx28_evk.c
@@ -24,6 +24,8 @@
#include <asm/arch/regs-pinctrl.h>
#include <asm/arch/pinctrl.h>
#include <asm/arch/regs-clkctrl.h>
+#include <asm/arch/regs-ocotp.h>
+
#include <mmc.h>
#include <imx_ssp_mmc.h>
@@ -206,6 +208,32 @@ int board_mmc_init(bd_t *bis)
#endif
+#ifdef CONFIG_MXC_FEC
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+int fec_get_mac_addr(unsigned char *mac)
+{
+ u32 val;
+
+ /*set this bit to open the OTP banks for reading*/
+ REG_WR(REGS_OCOTP_BASE, HW_OCOTP_CTRL_SET,
+ BM_OCOTP_CTRL_RD_BANK_OPEN);
+
+ /*wait until OTP contents are readable*/
+ while (BM_OCOTP_CTRL_BUSY & REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CTRL))
+ udelay(100);
+
+ mac[0] = 0x00;
+ mac[1] = 0x04;
+ val = REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CUSTn(0));
+ mac[2] = (val >> 24) & 0xFF;
+ mac[3] = (val >> 16) & 0xFF;
+ mac[4] = (val >> 8) & 0xFF;
+ mac[5] = (val >> 0) & 0xFF;
+ return 0;
+}
+#endif
+#endif
+
void enet_board_init(void)
{
/* Set up ENET pins */