[U-Boot] [PATCH 3/3] common: introduce board_preboot_os hook

Nikita Kiryanov nikita at compulab.co.il
Wed Oct 29 14:08:25 CET 2014


Introduce board specific function board_preboot_os() to allow for board
specific config before we boot, and use it on cm_fx6 to power off sata
so that Linux will be able to setup it correctly.

Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
Cc: Igor Grinberg <grinberg at compulab.co.il>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Tom Rini <trini at ti.com>
---
 board/compulab/cm_fx6/cm_fx6.c | 5 +++++
 common/bootm_os.c              | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index 0206ae8..b44ee9d 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -125,6 +125,11 @@ int sata_initialize(void)
 
 	return err;
 }
+
+void board_preboot_os(void)
+{
+	cm_fx6_sata_power(0);
+}
 #else
 static int cm_fx6_setup_issd(void) { return 0; }
 #endif
diff --git a/common/bootm_os.c b/common/bootm_os.c
index 5be4467..95cd657 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -442,10 +442,17 @@ __weak void arch_preboot_os(void)
 	/* please define platform specific arch_preboot_os() */
 }
 
+/* Allow for board specific config before we boot */
+__weak void board_preboot_os(void)
+{
+	/* please define board specific board_preboot_os() */
+}
+
 int boot_selected_os(int argc, char * const argv[], int state,
 		     bootm_headers_t *images, boot_os_fn *boot_fn)
 {
 	arch_preboot_os();
+	board_preboot_os();
 	boot_fn(state, argc, argv, images);
 
 	/* Stand-alone may return when 'autostart' is 'no' */
-- 
1.9.1



More information about the U-Boot mailing list