From 565e39c57769a45a5eaed5e4c86357e817cf64e1 Mon Sep 17 00:00:00 2001 From: Liu Hui-R64343 Date: Thu, 18 Nov 2010 23:45:55 +0000 Subject: imx: Get fec mac address from fuse The patch is to support getting FEC MAC address from fuse bank. Signed-off-by: Jason Liu Tested-by: Stefano Babic --- arch/arm/cpu/arm926ejs/mx25/generic.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm/cpu/arm926ejs/mx25/generic.c') diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c index b80a389ed9..c6e114634a 100644 --- a/arch/arm/cpu/arm926ejs/mx25/generic.c +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c @@ -260,4 +260,16 @@ void mx25_fec_init_pins (void) writel (outpadctl, &padctl->pad_fec_tdata1); } + +void imx_get_mac_from_fuse(unsigned char *mac) +{ + int i; + struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; + struct fuse_bank *bank = &iim->bank[0]; + struct fuse_bank0_regs *fuse = + (struct fuse_bank0_regs *)bank->fuse_regs; + + for (i = 0; i < 6; i++) + mac[i] = readl(&fuse->mac_addr[i]) & 0xff; +} #endif /* CONFIG_FEC_MXC */ -- cgit v1.2.3