diff options
author | Peng Fan <peng.fan@nxp.com> | 2018-01-10 08:20:31 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2018-02-04 14:00:58 +0300 |
commit | 6ce8b10b873e2c9812e2a82ca534396b9ae4f08b (patch) | |
tree | c9045994b86e07e8fa559051b4e4e67cae035f53 /arch/arm/mach-imx/mx7/soc.c | |
parent | e56d9d79e587e945f219e5a98e5ab33680546215 (diff) | |
download | u-boot-6ce8b10b873e2c9812e2a82ca534396b9ae4f08b.tar.xz |
imx: refactor imx_get_mac_from_fuse
Move imx_get_mac_from_fuse to a new mac.c for i.MX6/7.
Since fuse regs structure are different for i.MX6/7, use mac
address offset in code and define a new local struture
imx_mac_fuse.
Also sort the config order.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/mach-imx/mx7/soc.c')
-rw-r--r-- | arch/arm/mach-imx/mx7/soc.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index 032dfcf2ce..10dec8bdf4 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -208,38 +208,6 @@ void get_board_serial(struct tag_serialnr *serialnr) } #endif -#if defined(CONFIG_FEC_MXC) -void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) -{ - struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; - struct fuse_bank *bank = &ocotp->bank[9]; - struct fuse_bank9_regs *fuse = - (struct fuse_bank9_regs *)bank->fuse_regs; - - if (0 == dev_id) { - u32 value = readl(&fuse->mac_addr1); - mac[0] = (value >> 8); - mac[1] = value; - - value = readl(&fuse->mac_addr0); - mac[2] = value >> 24; - mac[3] = value >> 16; - mac[4] = value >> 8; - mac[5] = value; - } else { - u32 value = readl(&fuse->mac_addr2); - mac[0] = value >> 24; - mac[1] = value >> 16; - mac[2] = value >> 8; - mac[3] = value; - - value = readl(&fuse->mac_addr1); - mac[4] = value >> 24; - mac[5] = value >> 16; - } -} -#endif - #ifdef CONFIG_IMX_BOOTAUX int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) { |