]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mx53loco: Add CONFIG_REVISION_TAG
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 8 May 2012 03:40:49 +0000 (03:40 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 15 May 2012 06:31:34 +0000 (08:31 +0200)
FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information.

The kernel uses this data to distinguish between Dialog versus mc34708 based boards,
and also to distinguish between revA and revB of the mc34708 based boards.

Suggested-by: Yu Li <yk@magniel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
arch/arm/include/asm/arch-mx5/imx-regs.h
board/freescale/mx53loco/mx53loco.c
include/configs/mx53loco.h

index a4245a3cff3924d3d6f49b6d71b512a520f1d297..cef419077e6520720fc8d3c51e559df38ab7fb60 100644 (file)
@@ -491,6 +491,11 @@ struct iim_regs {
        } bank[4];
 };
 
+struct fuse_bank0_regs {
+       u32     fuse0_23[24];
+       u32     gp[8];
+};
+
 struct fuse_bank1_regs {
        u32     fuse0_8[9];
        u32     mac_addr[6];
index a49b00a81252ae4a673aa8163fce15244a860bcc..fb138957dbeba1819ea99100666f3ed66cb63c76 100644 (file)
@@ -62,6 +62,18 @@ void dram_init_banksize(void)
        gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 }
 
+u32 get_board_rev(void)
+{
+       struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
+       struct fuse_bank *bank = &iim->bank[0];
+       struct fuse_bank0_regs *fuse =
+               (struct fuse_bank0_regs *)bank->fuse_regs;
+
+       int rev = readl(&fuse->gp[6]);
+
+       return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
+}
+
 static void setup_iomux_uart(void)
 {
        /* UART1 RXD */
index 87f6ed1e2f6be44292154372e2cc408948bf5fa5..eab0e27fb5f64ab25d5cf96b8c9895ececc02211 100644 (file)
@@ -43,6 +43,7 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_GPIO
+#define CONFIG_REVISION_TAG
 
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART1_BASE