[Skiboot] [RFC PATCH 6/6] core/init: Allow setting size of payload in device-tree
Oliver O'Halloran
oohall at gmail.com
Wed Dec 18 18:26:34 AEDT 2019
On Wed, Dec 18, 2019 at 3:52 PM Jordan Niethe <jniethe5 at gmail.com> wrote:
>
> When a kernel is preloaded by Mambo, the size is already known. Make
> this available in the device-tree so that the size does not need to be
> calculated from the elf by skiboot.
>
> Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
> ---
> core/init.c | 5 ++++-
> external/mambo/skiboot.tcl | 1 +
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/core/init.c b/core/init.c
> index 58e99c6163c1..419bfe28996b 100644
> --- a/core/init.c
> +++ b/core/init.c
> @@ -415,7 +415,10 @@ static bool load_kernel(void)
> memcpy_null(NULL, old_vectors, EXCEPTION_VECTORS_END);
> sync_icache();
> }
> - kernel_size = 0;
> + if (dt_has_node_property(dt_chosen, "kernel-size", NULL))
> + kernel_size = dt_prop_get_u64(dt_chosen, "kernel-size");
> + else
> + kernel_size = 0;
You can simplify this to:
dt_prop_get_u64_def(dt_chosen, "kernel-size", 0);
More information about the Skiboot
mailing list