From 9c83ddc367d1aaccac439cc6c83c6d4467cd7fa8 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Tue, 15 Sep 2020 08:47:19 +0200 Subject: globalvar: add globalvar_set function Instead of overwriting the whole hierarchy beneath a globalvar, the globalvar_set function only sets the specific globalvar. Signed-off-by: Rouven Czerwinski Signed-off-by: Sascha Hauer --- common/globalvar.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/globalvar.c b/common/globalvar.c index 98a028a68a..1219ceaeb3 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -399,6 +399,11 @@ void globalvar_set_match(const char *match, const char *val) } } +void globalvar_set(const char *name, const char *val) +{ + dev_set_param(&global_device, name, val); +} + static int globalvar_simple_set(struct device_d *dev, struct param_d *p, const char *val) { struct device_d *rdev; -- cgit v1.2.3 From 9625c69869076a92e131df78888ef8e5b47846d6 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Tue, 15 Sep 2020 08:47:20 +0200 Subject: blspec: only reset variable locations, not paths Configuration of the loadaddresses for image oftree and initrd can not be done inside the bootloader spec yet, so using bootloader spec should not override settings from the environment. Signed-off-by: Rouven Czerwinski Signed-off-by: Sascha Hauer --- common/blspec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/blspec.c b/common/blspec.c index 9e1036c834..14c98d4f7b 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -137,9 +137,9 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun) }; globalvar_set_match("linux.bootargs.dyn.", ""); - globalvar_set_match("bootm.image", ""); - globalvar_set_match("bootm.oftree", ""); - globalvar_set_match("bootm.initrd", ""); + globalvar_set("bootm.image", ""); + globalvar_set("bootm.oftree", ""); + globalvar_set("bootm.initrd", ""); bootm_data_init_defaults(&data); -- cgit v1.2.3 From c0275ee22a0e52f876034ad60bbabec3beeff181 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Tue, 15 Sep 2020 08:47:21 +0200 Subject: blspec: fix bootm_data initialization Remove initialization of the verbose struct member, it will be overwritten by the call to bootm_data_init_defaults(). Also remove members which are initialized in the call. Verbose should be enabled if either the argument or variable is set, so || both. Signed-off-by: Rouven Czerwinski Signed-off-by: Sascha Hauer --- common/blspec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/blspec.c b/common/blspec.c index 14c98d4f7b..7858df685f 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -130,9 +130,6 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun) const char *overlays; const char *appendroot; struct bootm_data data = { - .initrd_address = UIMAGE_INVALID_ADDRESS, - .os_address = UIMAGE_SOME_ADDRESS, - .verbose = verbose, .dryrun = dryrun, }; @@ -143,6 +140,8 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun) bootm_data_init_defaults(&data); + data.verbose = verbose || data.verbose; + devicetree = blspec_entry_var_get(entry, "devicetree"); initrd = blspec_entry_var_get(entry, "initrd"); options = blspec_entry_var_get(entry, "options"); -- cgit v1.2.3 From 94c0b6c798f619bd45aa1411a2ffedba86cad063 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Tue, 15 Sep 2020 08:47:22 +0200 Subject: fastboot: only unset image, not loadaddr In case the board needs to setup the load address of the kernel, don't overwrite the variable, instead only override the image. Signed-off-by: Rouven Czerwinski Signed-off-by: Sascha Hauer --- common/fastboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/fastboot.c b/common/fastboot.c index 302720c43d..86e7997a0b 100644 --- a/common/fastboot.c +++ b/common/fastboot.c @@ -383,7 +383,7 @@ static void __maybe_unused cb_boot(struct fastboot *fb, const char *opt) fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Booting kernel..\n"); globalvar_set_match("linux.bootargs.dyn.", ""); - globalvar_set_match("bootm.image", ""); + globalvar_set("bootm.image", ""); data.os_file = fb->tempname; -- cgit v1.2.3