On Sat, Feb 28, 2026 at 01:19:52PM -0700, Simon Glass wrote: > From: Simon Glass <[email protected]> > > There are various functions which announce that booting is imminent and > do related preparation. Most of these are arch-specific. > > In practice, most archs do a similar thing. It would be better to > have a common function, with perhaps some events for things that are > really arch- and board-specific. > > Create a new bootm_final() function with the common pre-boot steps: > printing the "Starting kernel" message, recording bootstage data, > optionally writing bootstage to the FDT and printing a report, and > removing active devices. > > Be careful to avoid using BIT() macros which are not available with host > tools. > > Signed-off-by: Simon Glass <[email protected]>
Getting closer for sure.
[snip]
> +void bootm_final(enum bootm_final_t flags)
> +{
> + printf("\nStarting kernel ...\n\n");
So most platforms calls in here with "fake" as a flag so that this
printf can be:
printf("\nStarting kernel ...%s\n\n", fake ? "(fake run for tracing)" : "");
But this isn't preserved.
We should just call this "flag" and make use of it already
being BOOTM_STATE_OS_FAKE_GO, and have the riscv and maybe arm patches
(less clear since it's two places since arm and arm64 both define a
function that calls announce_and_cleanup today) be dropping
announce_and_cleanup() now that it's just two function calls. I see that
arc is just doing this openly and I assume everywhere else is inbetween
the two. This lets us also drop the new bootm_final_t flags as well,
since it's only for the fake message.
A separate follow-up cleanup would be to make it consistent for
do_bootm_linux to pass flag around.
--
Tom
signature.asc
Description: PGP signature

