All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] bootm: Add board specific OS preboot hook
@ 2018-10-04 19:16 Marek Vasut
  2018-10-08  5:54 ` Simon Goldschmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Marek Vasut @ 2018-10-04 19:16 UTC (permalink / raw)
  To: u-boot

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>
---
 common/bootm_os.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/common/bootm_os.c b/common/bootm_os.c
index f4bd905909..f302135868 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] bootm: Add board specific OS preboot hook
  2018-10-04 19:16 [U-Boot] [PATCH] bootm: Add board specific OS preboot hook Marek Vasut
@ 2018-10-08  5:54 ` Simon Goldschmidt
  2018-10-08 11:34 ` Christian Gmeiner
  2018-10-11 14:12 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 6+ messages in thread
From: Simon Goldschmidt @ 2018-10-08  5:54 UTC (permalink / raw)
  To: u-boot

On Thu, Oct 4, 2018 at 9:16 PM Marek Vasut <marex@denx.de> wrote:
>
> 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>

Great idea. There are already some boards (including my private ones)
that misuse arch_preboot_os(). Those could be converted, too.

Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

> ---
>  common/bootm_os.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/common/bootm_os.c b/common/bootm_os.c
> index f4bd905909..f302135868 100644
> --- a/common/bootm_os.c
> +++ b/common/bootm_os.c
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] bootm: Add board specific OS preboot hook
  2018-10-04 19:16 [U-Boot] [PATCH] bootm: Add board specific OS preboot hook Marek Vasut
  2018-10-08  5:54 ` Simon Goldschmidt
@ 2018-10-08 11:34 ` Christian Gmeiner
  2018-10-08 11:39   ` Marek Vasut
  2018-10-11 14:12 ` [U-Boot] " Tom Rini
  2 siblings, 1 reply; 6+ messages in thread
From: Christian Gmeiner @ 2018-10-08 11:34 UTC (permalink / raw)
  To: u-boot

Am Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <marex@denx.de>:
>
> 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>

Copy of https://patchwork.ozlabs.org/patch/956942/ ?

-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] bootm: Add board specific OS preboot hook
  2018-10-08 11:34 ` Christian Gmeiner
@ 2018-10-08 11:39   ` Marek Vasut
  2018-10-08 12:33     ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2018-10-08 11:39 UTC (permalink / raw)
  To: u-boot

On 10/08/2018 01:34 PM, Christian Gmeiner wrote:
> Am Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <marex@denx.de>:
>>
>> 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>
> 
> Copy of https://patchwork.ozlabs.org/patch/956942/ ?

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.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] bootm: Add board specific OS preboot hook
  2018-10-08 11:39   ` Marek Vasut
@ 2018-10-08 12:33     ` Tom Rini
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2018-10-08 12:33 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 08, 2018 at 01:39:44PM +0200, Marek Vasut wrote:
> On 10/08/2018 01:34 PM, Christian Gmeiner wrote:
> > Am Do., 4. Okt. 2018 um 21:16 Uhr schrieb Marek Vasut <marex@denx.de>:
> >>
> >> 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>
> > 
> > Copy of https://patchwork.ozlabs.org/patch/956942/ ?
> 
> 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.

Agreed, and that's the usual flow too.  Thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] bootm: Add board specific OS preboot hook
  2018-10-04 19:16 [U-Boot] [PATCH] bootm: Add board specific OS preboot hook Marek Vasut
  2018-10-08  5:54 ` Simon Goldschmidt
  2018-10-08 11:34 ` Christian Gmeiner
@ 2018-10-11 14:12 ` Tom Rini
  2 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2018-10-11 14:12 UTC (permalink / raw)
  To: u-boot

On Thu, Oct 04, 2018 at 09:16:31PM +0200, Marek Vasut wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-11 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 19:16 [U-Boot] [PATCH] bootm: Add board specific OS preboot hook Marek Vasut
2018-10-08  5:54 ` Simon Goldschmidt
2018-10-08 11:34 ` Christian Gmeiner
2018-10-08 11:39   ` Marek Vasut
2018-10-08 12:33     ` Tom Rini
2018-10-11 14:12 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.