It is necessary to introduce a new system wide function- power_board_init()

It turns out, that power initialization must be done as early as possible.
In the case of PMIC framework redesign, which aims to support multiple
instances of PMIC devices the initialization shall be performed just
after malloc configuration.

The arch_early_init_r() could be used instead, but it doesn't reflect
that the "power" subsystem is going to be initialized.

Signed-off-by: Lukasz Majewski <l.majew...@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.p...@samsung.com>
---
 arch/arm/lib/board.c |    4 ++++
 include/common.h     |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index f1951e8..38d92fe 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -510,6 +510,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
        arch_early_init_r();
 #endif
 
+#ifdef CONFIG_POWER_INIT
+       power_board_init();
+#endif
+
 #if !defined(CONFIG_SYS_NO_FLASH)
        puts("Flash: ");
 
diff --git a/include/common.h b/include/common.h
index 55025c0..62c8e9a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -487,6 +487,9 @@ int board_late_init (void);
 int board_postclk_init (void); /* after clocks/timebase, before env/serial */
 int board_early_init_r (void);
 void board_poweroff (void);
+#ifdef CONFIG_POWER_INIT
+int power_board_init(void);
+#endif
 
 #if defined(CONFIG_SYS_DRAM_TEST)
 int testdram(void);
-- 
1.7.2.3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to