summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2011-02-25 14:52:07 +0800
committerTerry Lv <r65388@freescale.com>2011-03-02 14:56:26 +0800
commit0e5060fb1663ce2878d3a45b26b0da1280bba346 (patch)
tree6141692b6844574180ae216eac1762e624c81aeb
parentd9e9aa9d87cc4ab111421011845c6d001b1ffabb (diff)
downloadu-boot-imx-0e5060fb1663ce2878d3a45b26b0da1280bba346.zip
u-boot-imx-0e5060fb1663ce2878d3a45b26b0da1280bba346.tar.gz
u-boot-imx-0e5060fb1663ce2878d3a45b26b0da1280bba346.tar.bz2
ENGR00139747: Read fuse to distinguish between mx53 revA and revB
Read fuse to distinguish between mx53 revA and revB. Now SoC efuse is used for board id. Thus we now check fuse value for board rev and id. Signed-off-by: Terry Lv <r65388@freescale.com>
-rw-r--r--board/freescale/mx53_smd/mx53_smd.c43
-rw-r--r--include/asm-arm/arch-mx53/mx53.h7
2 files changed, 43 insertions, 7 deletions
diff --git a/board/freescale/mx53_smd/mx53_smd.c b/board/freescale/mx53_smd/mx53_smd.c
index 037a7b6..1ef757c 100644
--- a/board/freescale/mx53_smd/mx53_smd.c
+++ b/board/freescale/mx53_smd/mx53_smd.c
@@ -159,6 +159,20 @@ enum boot_device get_boot_device(void)
return boot_dev;
}
+u32 get_board_rev_from_fuse(void)
+{
+ u32 board_rev = readl(IIM_BASE_ADDR + 0x878);
+
+ return board_rev;
+}
+
+u32 get_board_id_from_fuse(void)
+{
+ u32 board_id = readl(IIM_BASE_ADDR + 0x87c);
+
+ return board_id;
+}
+
u32 get_board_rev(void)
{
return system_rev;
@@ -167,6 +181,7 @@ u32 get_board_rev(void)
static inline void setup_soc_rev(void)
{
int reg;
+ u32 board_rev = get_board_rev_from_fuse();
/* Si rev is obtained from ROM */
reg = __REG(ROM_SI_REV);
@@ -181,11 +196,15 @@ static inline void setup_soc_rev(void)
default:
system_rev = 0x53000 | CHIP_REV_2_0;
}
-}
-static inline void setup_board_rev(int rev)
-{
- system_rev |= (rev & 0xF) << 8;
+ switch (board_rev) {
+ case 0x02:
+ system_rev |= BOARD_REV_5;
+ break;
+ case 0x01:
+ default:
+ system_rev |= BOARD_REV_4;
+ }
}
inline int is_soc_rev(int rev)
@@ -846,10 +865,20 @@ int board_late_init(void)
int checkboard(void)
{
- printf("Board: ");
- printf("MX53-SMD 1.0\n");
- printf("Boot Reason: [");
+ printf("Board: MX53-SMD ");
+ switch (get_board_rev_from_fuse()) {
+ case 0x2:
+ printf("Rev. B\n");
+ break;
+ case 0x1:
+ default:
+ printf("Rev. A\n");
+ break;
+
+ }
+
+ printf("Boot Reason: [");
switch (__REG(SRC_BASE_ADDR + 0x8)) {
case 0x0001:
diff --git a/include/asm-arm/arch-mx53/mx53.h b/include/asm-arm/arch-mx53/mx53.h
index 037054d..bb5252c 100644
--- a/include/asm-arm/arch-mx53/mx53.h
+++ b/include/asm-arm/arch-mx53/mx53.h
@@ -347,6 +347,13 @@
#define CHIP_REV_1_0 0x10
#define CHIP_REV_2_0 0x20
+
+#define BOARD_REV_1 0x000
+#define BOARD_REV_2 0x100
+#define BOARD_REV_3 0x200
+#define BOARD_REV_4 0x300
+#define BOARD_REV_5 0x400
+
#define PLATFORM_ICGC 0x14
/* Assuming 24MHz input clock with doubler ON */