]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootm: Add board specific OS preboot hook
authorMarek Vasut <marex@denx.de>
Thu, 4 Oct 2018 19:16:31 +0000 (21:16 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 10 Oct 2018 17:35:09 +0000 (13:35 -0400)
Add board-specific hook which is executed before the code hands over
control to the OS. This lets the board perform some last-minute clean
ups.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
common/bootm_os.c

index f4bd90590944dd26c881ed7a04a05843bce0cdc5..f3021358686a00c36f0cf5356c87be33677a4aa6 100644 (file)
@@ -505,10 +505,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' */