From 0160c1e1a373c40bf9f9930c695c121b1f9da5ab Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Fri, 9 Dec 2011 10:59:07 +0000
Subject: [PATCH] pm9261: init serial console before relocation

The early messages can be seen on the debug console.

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
---
 board/ronetix/pm9261/pm9261.c | 17 ++++++++++++-----
 include/configs/pm9261.h      |  1 +
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/board/ronetix/pm9261/pm9261.c b/board/ronetix/pm9261/pm9261.c
index c6b582d2b97..79a3216d31c 100644
--- a/board/ronetix/pm9261/pm9261.c
+++ b/board/ronetix/pm9261/pm9261.c
@@ -237,21 +237,28 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-int board_init(void)
+int board_early_init_f(void)
 {
 	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
 
-	/* Enable Ctrlc */
-	console_init_f();
-
+	/* Enable clocks for some PIOs */
 	writel(1 << ATMEL_ID_PIOA |
 		1 << ATMEL_ID_PIOC,
 		&pmc->pcer);
 
+	at91_seriald_hw_init();
+
+	return 0;
+}
+
+int board_init(void)
+{
+	/* arch number of PM9261-Board */
+	gd->bd->bi_arch_number = MACH_TYPE_PM9261;
+
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-	at91_seriald_hw_init();
 #ifdef CONFIG_CMD_NAND
 	pm9261_nand_hw_init();
 #endif
diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index 9fbf9afe2fb..1e803169e6a 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -161,6 +161,7 @@
 #define CONFIG_INITRD_TAG	1
 
 #undef CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
 
 /*
  * Hardware drivers
-- 
GitLab