]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - patches/0069-ENGR00118739-Correct-the-board-version-of-MX51-EVK.patch
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / patches / 0069-ENGR00118739-Correct-the-board-version-of-MX51-EVK.patch
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
5
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.
11
12 Signed-off-by: Lily Zhang <r58066@freescale.com>
13 ---
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(-)
17
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;
24                 break;
25         case 0x10:
26 -               if ((__REG(GPIO1_BASE_ADDR + 0x0) & (0x1 << 22)) == 0) {
27 -                       system_rev = 0x51000 | CHIP_REV_2_5;
28 -               } else {
29 -                       system_rev = 0x51000 | CHIP_REV_2_0;
30 -               }
31 +               system_rev = 0x51000 | CHIP_REV_2_0;
32                 break;
33         case 0x20:
34                 system_rev = 0x51000 | CHIP_REV_3_0;
35 @@ -135,9 +131,11 @@ static inline void setup_soc_rev(void)
36         }
37  }
38  
39 -static inline void set_board_rev(int rev)
40 +static inline void set_board_rev()
41  {
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;
45 +
46  }
47  
48  inline int is_soc_rev(int rev)
49 @@ -664,6 +662,7 @@ int board_init(void)
50  {
51         setup_boot_device();
52         setup_soc_rev();
53 +       set_board_rev();
54  
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)
58  {
59         printf("Board: MX51 BABBAGE ");
60  
61 -       if (system_rev & CHIP_REV_3_0) {
62 +       if (is_soc_rev(CHIP_REV_3_0) == 0) {
63                 printf("3.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))) {
67                 printf("2.5 [");
68 -       } else if (system_rev & CHIP_REV_2_0) {
69 +       } else if (is_soc_rev(CHIP_REV_2_0) == 0) {
70                 printf("2.0 [");
71 -       } else if (system_rev & CHIP_REV_1_1) {
72 +       } else if (is_soc_rev(CHIP_REV_1_1) == 0) {
73                 printf("1.1 [");
74         } else {
75                 printf("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
80 @@ -399,6 +399,8 @@
81  #define BOARD_REV_1_0           0x0
82  #define BOARD_REV_2_0           0x1
83  
84 +#define BOARD_VER_OFFSET       0x8
85 +
86  #define NAND_FLASH_BOOT                0x10000000
87  #define SPI_NOR_FLASH_BOOT     0x80000000
88  #define MMC_FLASH_BOOT         0x40000000
89 -- 
90 1.5.4.4
91