From bc94fb379a46f9b4dabc982953a8d553c909bedb Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 15 Jan 2016 12:57:56 +0100 Subject: bootm: Initialize bootm_data defaults in single place Both the bootm and the boot code initialize the struct bootm_data with defaults from the bootm global variables. Create a common function for doing this. Signed-off-by: Sascha Hauer --- common/bootm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/bootm.c') diff --git a/common/bootm.c b/common/bootm.c index e399a6acdb..4409a8be27 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -47,6 +47,17 @@ static struct image_handler *bootm_find_handler(enum filetype filetype, return NULL; } +void bootm_data_init_defaults(struct bootm_data *data) +{ + data->initrd_address = UIMAGE_INVALID_ADDRESS; + data->os_address = UIMAGE_SOME_ADDRESS; + data->oftree_file = getenv_nonempty("global.bootm.oftree"); + data->os_file = getenv_nonempty("global.bootm.image"); + getenv_ul("global.bootm.image.loadaddr", &data->os_address); + getenv_ul("global.bootm.initrd.loadaddr", &data->initrd_address); + data->initrd_file = getenv_nonempty("global.bootm.initrd"); +} + /* * bootm_load_os() - load OS to RAM * -- cgit v1.2.3