Commit graph

8 commits

Author SHA1 Message Date
Simon Glass
9ad5fdf1a8 x86: zboot: Separate logic functions from commands
Move zboot_start() and zboot_info() in with the other logic functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10 13:49:16 -06:00
Simon Glass
02ed6c333e x86: zboot: Move argument processing outside zboot_start()
Process the arguments before calling zboot_start() so that we can
separate the command line from the internal logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
d531499749 x86: zboot: Drop intermediate zboot_go() function
This function only calls zboot_go() so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
cb19931ee5 x86: zboot: Drop intermediate zboot_setup() function
Move error checking into the caller so that do_zboot_setup() can call
zboot_setup() directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
db0c6f47c3 x86: zboot: Move environment setting into zboot_load()
The only difference between the command and the underlying logic is the
setting of envrionment variables. Move this out of the command
processing since it needs to be done in any case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
42a99d0df6 x86: zboot: Create separate functions for the logic
Separate out the commands from the logic. This will eventually allow
the logic to be used when CONFIG_CMDLINE is not enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
228c6722d4 x86: zboot: Avoid iteration in do_zboot_states()
Drop the iteration and write out each state in full. This will allow
the arguments to be reduced and adjusted in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
bade0ac04b x86: zboot: Move command code into its own file
Much of the code in zimage.c deals with the zboot command. Move it into
a sepatate zboot.c file within the cmd/ directory. This will eventually
allow use of the zimage logic without the command being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:15 -06:00