diff mbox

[U-Boot,v2] mx53loco: Fix revision of Dialog boards

Message ID 1338306879-20873-1-git-send-email-fabio.estevam@freescale.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam May 29, 2012, 3:54 p.m. UTC
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>
---
Changes since v1:
- Fix the PMIC detection. Let I2C probe to work earlier in board_init
instead of board_late_init().

 board/freescale/mx53loco/mx53loco.c |   19 +++++++------------
 include/configs/mx53loco.h          |    1 -
 2 files changed, 7 insertions(+), 13 deletions(-)

Comments

Stefano Babic June 12, 2012, 5:19 p.m. UTC | #1
On 29/05/2012 17:54, Fabio Estevam wrote:
> 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>
> ---
> Changes since v1:
> - Fix the PMIC detection. Let I2C probe to work earlier in board_init
> instead of board_late_init().
> 
>  board/freescale/mx53loco/mx53loco.c |   19 +++++++------------
>  include/configs/mx53loco.h          |    1 -
>  2 files changed, 7 insertions(+), 13 deletions(-)
> 

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index dec966d..445d022 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -71,6 +71,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;
 }
 
@@ -424,23 +427,15 @@  int print_cpuinfo(void)
 	return 0;
 }
 
-#ifdef CONFIG_BOARD_LATE_INIT
-int board_late_init(void)
-{
-	setup_iomux_i2c();
-	if (!power_init())
-		clock_1GHz();
-	print_cpuinfo();
-
-	return 0;
-}
-#endif
-
 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();
 
 	return 0;
 }
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index eab0e27..1c8ca59 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -41,7 +41,6 @@ 
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
 
 #define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_GPIO
 #define CONFIG_REVISION_TAG