1 From a7fc31a95a55983ddd0015d3778e0fe1c2d220dc Mon Sep 17 00:00:00 2001
2 From: Lily Zhang <r58066@freescale.com>
3 Date: Sun, 27 Dec 2009 17:21:58 +0800
4 Subject: [PATCH] ENGR00118739 Correct the board version of MX51 EVK
6 The SD card in MMC Slot2 can not be detected. This is because
7 the board version of MX51 EVK doesn't keep synchronization
8 with kernel. So the card detect PIN is not configured well.
9 Here Bit 11-Bit 8 in system_rev indicates the board version.
10 The fix is to set Bit 11 -Bit8 as 1 for MX51 EVK board.
12 Signed-off-by: Lily Zhang <r58066@freescale.com>
14 board/freescale/mx51_bbg/mx51_bbg.c | 22 +++++++++++-----------
15 include/asm-arm/arch-mx51/mx51.h | 2 ++
16 2 files changed, 13 insertions(+), 11 deletions(-)
18 diff --git a/board/freescale/mx51_bbg/mx51_bbg.c b/board/freescale/mx51_bbg/mx51_bbg.c
19 index 4279ac6..60fc704 100644
20 --- a/board/freescale/mx51_bbg/mx51_bbg.c
21 +++ b/board/freescale/mx51_bbg/mx51_bbg.c
22 @@ -121,11 +121,7 @@ static inline void setup_soc_rev(void)
23 system_rev = 0x51000 | CHIP_REV_1_1;
26 - if ((__REG(GPIO1_BASE_ADDR + 0x0) & (0x1 << 22)) == 0) {
27 - system_rev = 0x51000 | CHIP_REV_2_5;
29 - system_rev = 0x51000 | CHIP_REV_2_0;
31 + system_rev = 0x51000 | CHIP_REV_2_0;
34 system_rev = 0x51000 | CHIP_REV_3_0;
35 @@ -135,9 +131,11 @@ static inline void setup_soc_rev(void)
39 -static inline void set_board_rev(int rev)
40 +static inline void set_board_rev()
42 - system_rev |= (rev & 0xF) << 8;
43 + if ((__REG(GPIO1_BASE_ADDR + 0x0) & (0x1 << 22)) == 0)
44 + system_rev |= BOARD_REV_2_0 << BOARD_VER_OFFSET;
48 inline int is_soc_rev(int rev)
49 @@ -664,6 +662,7 @@ int board_init(void)
55 gd->bd->bi_arch_number = MACH_TYPE_MX51_BABBAGE; /* board id for linux */
56 /* address of boot parameters */
57 @@ -886,13 +885,14 @@ int checkboard(void)
59 printf("Board: MX51 BABBAGE ");
61 - if (system_rev & CHIP_REV_3_0) {
62 + if (is_soc_rev(CHIP_REV_3_0) == 0) {
64 - } else if (system_rev & CHIP_REV_2_5) {
65 + } else if ((is_soc_rev(CHIP_REV_2_0) == 0)
66 + && (system_rev & (BOARD_REV_2_0 << BOARD_VER_OFFSET))) {
68 - } else if (system_rev & CHIP_REV_2_0) {
69 + } else if (is_soc_rev(CHIP_REV_2_0) == 0) {
71 - } else if (system_rev & CHIP_REV_1_1) {
72 + } else if (is_soc_rev(CHIP_REV_1_1) == 0) {
76 diff --git a/include/asm-arm/arch-mx51/mx51.h b/include/asm-arm/arch-mx51/mx51.h
77 index 6554b56..00e50cf 100644
78 --- a/include/asm-arm/arch-mx51/mx51.h
79 +++ b/include/asm-arm/arch-mx51/mx51.h
81 #define BOARD_REV_1_0 0x0
82 #define BOARD_REV_2_0 0x1
84 +#define BOARD_VER_OFFSET 0x8
86 #define NAND_FLASH_BOOT 0x10000000
87 #define SPI_NOR_FLASH_BOOT 0x80000000
88 #define MMC_FLASH_BOOT 0x40000000