From: Jason Liu <jason.hui@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] i.mx6:imx6q: allign MAC address with burned-in ordering
Date: Mon, 19 Dec 2011 20:38:13 +0800 [thread overview]
Message-ID: <1324298293-14900-1-git-send-email-jason.hui@linaro.org> (raw)
For the i.mx6q, the burned-in MAC address will be the following odering,
fuse: 0x620[7:0] MAC_ADDR[7:0] ---> mac[5]
fuse: 0x620[15:8] MAC_ADDR[15:8] ---> mac[4]
fuse: 0x620[23:16] MAC_ADDR[23:16] ---> mac[3]
fuse: 0x620[31:24] MAC_ADDR[31:24] ---> mac[2]
fuse: 0x630[7:0] MAC_ADDR[39:32] ---> mac[1]
fuse: 0x630[15:8] MAC_ADDR[47:40] ---> mac[0]
This patch also fix the error caculation for the fuse bank[0] address
Signed-off-by: Jason Liu <jason.hui@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
---
arch/arm/cpu/armv7/mx6/soc.c | 14 ++++++++------
arch/arm/include/asm/arch-mx6/imx-regs.h | 2 +-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index dff5e4e..bd59cf5 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -70,13 +70,15 @@ void imx_get_mac_from_fuse(unsigned char *mac)
struct fuse_bank4_regs *fuse =
(struct fuse_bank4_regs *)bank->fuse_regs;
- u32 mac_lo = readl(&fuse->mac_addr_low);
- u32 mac_hi = readl(&fuse->mac_addr_high);
+ u32 value = readl(&fuse->mac_addr_high);
+ mac[0] = (value >> 8);
+ mac[1] = value ;
- *(u32 *)mac = mac_lo;
-
- mac[4] = mac_hi & 0xff;
- mac[5] = (mac_hi >> 8) & 0xff;
+ value = readl(&fuse->mac_addr_low);
+ mac[2] = value >> 24 ;
+ mac[3] = value >> 16 ;
+ mac[4] = value >> 8 ;
+ mac[5] = value ;
}
#endif
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 85d55b7..5fe9748 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -214,7 +214,7 @@ struct iim_regs {
u32 crc_value;
u32 rsvd6[3];
u32 version;
- u32 rsvd7[0xd8];
+ u32 rsvd7[0xdb];
struct fuse_bank {
u32 fuse_regs[0x20];
--
1.7.4.1
next reply other threads:[~2011-12-19 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 12:38 Jason Liu [this message]
2011-12-29 8:38 ` [U-Boot] [PATCH] i.mx6:imx6q: allign MAC address with burned-in ordering Jason Liu
2011-12-29 9:40 ` Stefano Babic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324298293-14900-1-git-send-email-jason.hui@linaro.org \
--to=jason.hui@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.