mx51evk: Add CONFIG_REVISION_TAG
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Tue, 18 Sep 2012 04:48:42 +0000 (04:48 +0000)
committerStefano Babic <sbabic@denx.de>
Sun, 23 Sep 2012 17:55:06 +0000 (19:55 +0200)
FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG
information.

If this data is not present, the kernel misconfigures the TZIC, which results in
the timer interrupt handler never being called, so the kernel deadlocks while
calibrating its delay.

Suggested-by: Greg Topmiller <Greg.Topmiller@jdsu.com>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Acked-by: Fabio Estevam <fabio.estevam@freescale.com>
arch/arm/include/asm/arch-mx5/imx-regs.h
board/freescale/mx51evk/mx51evk.c
include/configs/mx51evk.h

index d1ef15d043da143cd81b7b6d85ed86b8a75ef54d..46017f4ad062a5289e007ab4507bef43db6a5216 100644 (file)
 #define BOARD_REV_1_0           0x0
 #define BOARD_REV_2_0           0x1
 
+#define BOARD_VER_OFFSET       0x8
+
 #define IMX_IIM_BASE            (IIM_BASE_ADDR)
 
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
index 7a0682a7e96286f1f4b8e0547fd6972d19f802f2..a94701cbf1757d04ad0b894c039072d5cf8fd399 100644 (file)
@@ -60,6 +60,14 @@ int dram_init(void)
        return 0;
 }
 
+u32 get_board_rev(void)
+{
+       u32 rev = get_cpu_rev();
+       if (!gpio_get_value(IMX_GPIO_NR(1, 22)))
+               rev |= BOARD_REV_2_0 << BOARD_VER_OFFSET;
+       return rev;
+}
+
 static void setup_iomux_uart(void)
 {
        unsigned int pad = PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
index ba4a4a623c10403fdd9aa196fb4a0b2044bcc2be..7b027b42acd8d403633c5cb1dca9b6bb04ee2b15 100644 (file)
@@ -44,6 +44,7 @@
 #define CONFIG_CMDLINE_TAG                     /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
 #define CONFIG_OF_LIBFDT