bootm: Add board specific OS preboot hook
PATCH 1/1 bootm: Add board specific OS preboot hook
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.
--- common/bootm_os.c | 7 +++++++ 1 file changed, 7 insertions(+)
common/bootm_os.c +7 -0
@@ -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' */
Signature · 1 line
2.18.0
PATCH 1/1 bootm: Add board specific OS preboot hook
Quoted 7 lines · Marek Vasut
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 <[email protected]>Cc Tom Rini <[email protected]>
Great idea. There are already some boards (including my private ones) that misuse arch_preboot_os(). Those could be converted, too.
Quoted 33 lines
--- common/bootm_os.c | 7 +++++++ 1 file changed, 7 insertions(+)common/bootm_os.c +7
-1@@ -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' */ --2.18.0
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 1/1 bootm: Add board specific OS preboot hook
In reply to Marek VasutAm Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <[email protected]>:
Quoted 7 lines
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 <[email protected]>Cc Tom Rini <[email protected]>
Copy of https://patchwork.ozlabs.org/patch/956942/ ?
Signature · 5 lines
greets -- Christian Gmeiner, MSc https://christian-gmeiner.info
PATCH 1/1 bootm: Add board specific OS preboot hook
Quoted 10 lines · Christian Gmeiner
Am Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <[email protected]>:
Quoted 7 lines
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 <[email protected]>Cc Tom Rini <[email protected]>
Wow, the patch is almost identical, except for the position of the board_preboot_os() :-) ... which is no surprise, given it's almost a verbatim copy of arch_preboot_os().
I'd prefer board after arch though, so the board can have the last word before boot.
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 bootm: Add board specific OS preboot hook
Quoted 10 lines · Marek Vasut
Quoted 9 lines · Christian Gmeiner
Am Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <[email protected]>:
Quoted 7 lines
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 <[email protected]>Cc Tom Rini <[email protected]>
Quoted 8 lines
Quoted 1 line
Wow, the patch is almost identical, except for the position of the
board_preboot_os():-) ... which is no surprise, given it's almost a verbatim copy ofarch_preboot_os().I'd prefer board after arch though, so the board can have the last word before boot.
Agreed, and that's the usual flow too. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181008/e4278386/attachment.sig>
Quoted 7 lines · Marek Vasut
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 <[email protected]>Cc Tom Rini <[email protected]>Reviewed-by Simon Goldschmidt <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/0d7ea9dc/attachment.sig>