[U-Boot] [PATCH 16/20] tegra: Allow board-specific init

Simon Glass
2015-02-17T22:29:50Z

Add a hook to allows boards to add their own init to board_init().

Signed-off-by: Simon Glass <sjg@chromium.org>
---

arch/arm/include/asm/arch-tegra/sys_proto.h | 7 +++++++
board/nvidia/common/board.c | 8 ++++++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/sys_proto.h b/arch/arm/include/asm/arch-tegra/sys_proto.h
index 83f9f47..b64f9d8 100644
--- a/arch/arm/include/asm/arch-tegra/sys_proto.h
+++ b/arch/arm/include/asm/arch-tegra/sys_proto.h
@@ -25,4 +25,11 @@ int tegra_board_id(void);
*/
int tegra_lcd_pmic_init(int board_id);

+/**
+ * nvidia_board_init() - perform any board-specific init
+ *
+ * @return 0 if OK, -ve on error
+ */
+int nvidia_board_init(void);
+
#endif
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 18e1709..7563c4c 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -106,6 +106,11 @@ __weak int tegra_lcd_pmic_init(int board_it)
return 0;
}

+__weak int nvidia_board_init(void)
+{
+ return 0;
+}
+
/*
* Routine: board_init
* Description: Early hardware init.
@@ -179,8 +184,7 @@ int board_init(void)
/* prepare the WB code to LP0 location */
warmboot_prepare_code(TEGRA_LP0_ADDR, TEGRA_LP0_SIZE);
#endif
-
- return 0;
+ return nvidia_board_init();
}

#ifdef CONFIG_BOARD_EARLY_INIT_F
--
2.2.0.rc0.207.ga3a616c