summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-07-08 21:26:36 +0800
committerTerry Lv <r65388@freescale.com>2010-07-16 11:18:57 +0800
commitc5f6bfc5b71f455171b22e7291c75da3a7704974 (patch)
tree0009f7e5289daa73f2c100b593c1da26a738eb0f /board
parentacce438960d7ba5312e5d26d828fd2875901304b (diff)
downloadu-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.zip
u-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.tar.gz
u-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.tar.bz2
ENGR00123924: Reconstructure fuse files and add fuse to mx53.
1. Reconstructure fuse. Move fuse files to common directory. 2. Read mac from fuse in fec. 3. Remove scc and srk command from fuse command. 4. Change fuse to iim. 5. Add fuse for mx53. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx25_3stack/mx25_3stack.c20
-rw-r--r--board/freescale/mx50_arm2/mx50_arm2.c18
-rw-r--r--board/freescale/mx51_bbg/flash_header.S4
-rw-r--r--board/freescale/mx51_bbg/mx51_bbg.c21
-rw-r--r--board/freescale/mx53_evk/mx53_evk.c22
5 files changed, 83 insertions, 2 deletions
diff --git a/board/freescale/mx25_3stack/mx25_3stack.c b/board/freescale/mx25_3stack/mx25_3stack.c
index b8bb256..2dc7130 100644
--- a/board/freescale/mx25_3stack/mx25_3stack.c
+++ b/board/freescale/mx25_3stack/mx25_3stack.c
@@ -38,6 +38,10 @@
#include <lcd.h>
#endif
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+#include <asm/imx_iim.h>
+#endif
+
#ifdef CONFIG_CMD_MMC
#include <mmc.h>
#include <fsl_esdhc.h>
@@ -319,6 +323,22 @@ int setup_splash_img()
#endif
#endif
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+
+int fec_get_mac_addr(unsigned char *mac)
+{
+ u32 *iim0_mac_base =
+ (u32 *)(IIM_BASE + IIM_BANK_AREA_0_OFFSET +
+ CONFIG_IIM_MAC_ADDR_OFFSET);
+ int i;
+
+ for (i = 0; i < 6; ++i, ++iim0_mac_base)
+ mac[i] = readl(iim0_mac_base);
+
+ return 0;
+}
+#endif
+
int board_init(void)
{
diff --git a/board/freescale/mx50_arm2/mx50_arm2.c b/board/freescale/mx50_arm2/mx50_arm2.c
index bb0ea3a..df5d33a 100644
--- a/board/freescale/mx50_arm2/mx50_arm2.c
+++ b/board/freescale/mx50_arm2/mx50_arm2.c
@@ -348,6 +348,24 @@ void spi_io_init(struct imx_spi_dev_t *dev)
#endif
#ifdef CONFIG_MXC_FEC
+
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+
+#define HW_OCOTP_MACn(n) (0x00000250 + (n) * 0x10)
+
+int fec_get_mac_addr(unsigned char *mac)
+{
+ u32 *ocotp_mac_base =
+ (u32 *)(OCOTP_CTRL_BASE_ADDR + HW_OCOTP_MACn(0));
+ int i;
+
+ for (i = 0; i < 6; ++i, ++ocotp_mac_base)
+ mac[6 - 1 - i] = readl(++ocotp_mac_base);
+
+ return 0;
+}
+#endif
+
static void setup_fec(void)
{
volatile unsigned int reg;
diff --git a/board/freescale/mx51_bbg/flash_header.S b/board/freescale/mx51_bbg/flash_header.S
index 2f860b8..72d0e81 100644
--- a/board/freescale/mx51_bbg/flash_header.S
+++ b/board/freescale/mx51_bbg/flash_header.S
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -108,5 +108,5 @@ MXC_DCD_ITEM(54, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, 0x000ad6d0)
MXC_DCD_ITEM(55, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCDLYGD, 0x90000000)
MXC_DCD_ITEM(56, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00000000)
dcd_data_end:
-image_len: .word __u_boot_cmd_end - TEXT_BASE
+image_len: .word _end - TEXT_BASE
#endif
diff --git a/board/freescale/mx51_bbg/mx51_bbg.c b/board/freescale/mx51_bbg/mx51_bbg.c
index 66bb43d..1f49c0e 100644
--- a/board/freescale/mx51_bbg/mx51_bbg.c
+++ b/board/freescale/mx51_bbg/mx51_bbg.c
@@ -48,6 +48,10 @@
#include <asm/arch/mmu.h>
#endif
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+#include <asm/imx_iim.h>
+#endif
+
#ifdef CONFIG_FSL_ANDROID
#include <mxc_keyb.h>
#include <part.h>
@@ -382,6 +386,23 @@ void spi_io_init(struct imx_spi_dev_t *dev)
#endif
#ifdef CONFIG_MXC_FEC
+
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+
+int fec_get_mac_addr(unsigned char *mac)
+{
+ u32 *iim1_mac_base =
+ (u32 *)(IIM_BASE_ADDR + IIM_BANK_AREA_1_OFFSET +
+ CONFIG_IIM_MAC_ADDR_OFFSET);
+ int i;
+
+ for (i = 0; i < 6; ++i, ++iim1_mac_base)
+ mac[i] = (u8)readl(iim1_mac_base);
+
+ return 0;
+}
+#endif
+
static void setup_fec(void)
{
/*FEC_MDIO*/
diff --git a/board/freescale/mx53_evk/mx53_evk.c b/board/freescale/mx53_evk/mx53_evk.c
index a9e7f61..2f5c4b1 100644
--- a/board/freescale/mx53_evk/mx53_evk.c
+++ b/board/freescale/mx53_evk/mx53_evk.c
@@ -44,6 +44,10 @@
#include <asm/arch/mmu.h>
#endif
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+#include <asm/imx_iim.h>
+#endif
+
#ifdef CONFIG_CMD_CLOCK
#include <asm/clock.h>
#endif
@@ -558,7 +562,24 @@ void spi_io_init(struct imx_spi_dev_t *dev)
break;
}
}
+#endif
+#ifdef CONFIG_MXC_FEC
+
+#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
+
+int fec_get_mac_addr(unsigned char *mac)
+{
+ u32 *iim1_mac_base =
+ (u32 *)(IIM_BASE_ADDR + IIM_BANK_AREA_1_OFFSET +
+ CONFIG_IIM_MAC_ADDR_OFFSET);
+ int i;
+
+ for (i = 0; i < 6; ++i, ++iim1_mac_base)
+ mac[i] = (u8)readl(iim1_mac_base);
+
+ return 0;
+}
#endif
static void setup_fec(void)
@@ -624,6 +645,7 @@ static void setup_fec(void)
writel(reg, GPIO7_BASE_ADDR + 0x0);
}
+#endif
#ifdef CONFIG_CMD_MMC