mx53loco: Fix revision of Dialog boards
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 29 May 2012 05:54:39 +0000 (05:54 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:25 +0000 (14:07 +0200)
Original code was assuming that the fuse revision version for all mx53loco boards
based on Dialog PMIC was the same, which is not the case.

Force the revision of all Dialog-based boards to 0.

This fixes a kernel crash when PMIC is accessed in the 2.6.35 kernel
for Dialog rev E boards.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
board/freescale/mx53loco/mx53loco.c
include/configs/mx53loco.h

index d8e027ce6632566de2493396aa6cbbbfee390be9..cbdcfadf2794897cab9c42ea15f37a253ed1fdf7 100644 (file)
@@ -75,6 +75,9 @@ u32 get_board_rev(void)
 
        int rev = readl(&fuse->gp[6]);
 
+       if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR))
+               rev = 0;
+
        return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
 }
 
@@ -495,11 +498,6 @@ int print_cpuinfo(void)
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
-       setup_iomux_i2c();
-       if (!power_init())
-               clock_1GHz();
-       print_cpuinfo();
-
        setenv("stdout", "serial");
 
        return 0;
@@ -511,6 +509,10 @@ int board_init(void)
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
        mxc_set_sata_internal_clock();
+       setup_iomux_i2c();
+       if (!power_init())
+               clock_1GHz();
+       print_cpuinfo();
 
        lcd_enable();
 
index 8b4e00855d293d793de421f443db2c22e84484e2..b63d37d55f91578c1c49939e42930dce31a5a265 100644 (file)
@@ -41,7 +41,6 @@
 #define CONFIG_SYS_MALLOC_LEN          (10 * 1024 * 1024)
 
 #define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_GPIO
 #define CONFIG_REVISION_TAG