mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] globalvar: add globalvar_set function
@ 2020-09-15  6:47 Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 2/4] blspec: only reset variable locations, not paths Rouven Czerwinski
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-15  6:47 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

Instead of overwriting the whole hierarchy beneath a globalvar, the
globalvar_set function only sets the specific globalvar.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
v2:
- use the name directly to set the variable
- rename to globalvar_set

 common/globalvar.c  | 5 +++++
 include/globalvar.h | 1 +
 2 files changed, 6 insertions(+)

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;
diff --git a/include/globalvar.h b/include/globalvar.h
index fc85e93e14..956dda074a 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -15,6 +15,7 @@ int globalvar_add_simple(const char *name, const char *value);
 void globalvar_remove(const char *name);
 char *globalvar_get_match(const char *match, const char *separator);
 void globalvar_set_match(const char *match, const char *val);
+void globalvar_set(const char *name, const char *val);
 
 int globalvar_add_simple_string(const char *name, char **value);
 int globalvar_add_simple_int(const char *name, int *value,
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/4] blspec: only reset variable locations, not paths
  2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
@ 2020-09-15  6:47 ` Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 3/4] blspec: fix bootm_data initialization Rouven Czerwinski
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-15  6:47 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

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 <r.czerwinski@pengutronix.de>
---
 common/blspec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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);
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/4] blspec: fix bootm_data initialization
  2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 2/4] blspec: only reset variable locations, not paths Rouven Czerwinski
@ 2020-09-15  6:47 ` Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 4/4] fastboot: only unset image, not loadaddr Rouven Czerwinski
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-15  6:47 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

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 <r.czerwinski@pengutronix.de>
---
 common/blspec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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");
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/4] fastboot: only unset image, not loadaddr
  2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 2/4] blspec: only reset variable locations, not paths Rouven Czerwinski
  2020-09-15  6:47 ` [PATCH 3/4] blspec: fix bootm_data initialization Rouven Czerwinski
@ 2020-09-15  6:47 ` Rouven Czerwinski
  2020-09-15  7:50 ` [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
  2020-09-15 12:38 ` Sascha Hauer
  4 siblings, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-15  6:47 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

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 <r.czerwinski@pengutronix.de>
---
 common/fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] globalvar: add globalvar_set function
  2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
                   ` (2 preceding siblings ...)
  2020-09-15  6:47 ` [PATCH 4/4] fastboot: only unset image, not loadaddr Rouven Czerwinski
@ 2020-09-15  7:50 ` Rouven Czerwinski
  2020-09-15 12:38 ` Sascha Hauer
  4 siblings, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-15  7:50 UTC (permalink / raw)
  To: barebox

Doh, looks like I forgot the -v2 for git format-patch. Thats what I get
for not doing the git send-email workflow for some time…

This is a v2, all issues from v1 should be addressed.

In hopes of maintainer lenience,
Rouven


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] globalvar: add globalvar_set function
  2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
                   ` (3 preceding siblings ...)
  2020-09-15  7:50 ` [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
@ 2020-09-15 12:38 ` Sascha Hauer
  4 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 12:38 UTC (permalink / raw)
  To: Rouven Czerwinski; +Cc: barebox

On Tue, Sep 15, 2020 at 08:47:19AM +0200, Rouven Czerwinski wrote:
> Instead of overwriting the whole hierarchy beneath a globalvar, the
> globalvar_set function only sets the specific globalvar.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
> v2:
> - use the name directly to set the variable
> - rename to globalvar_set

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/4] fastboot: only unset image, not loadaddr
  2020-09-12  7:12 [PATCH 1/4] globalvar: add set_single function Rouven Czerwinski
@ 2020-09-12  7:12 ` Rouven Czerwinski
  0 siblings, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2020-09-12  7:12 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

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 <r.czerwinski@pengutronix.de>
---
 common/fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/fastboot.c b/common/fastboot.c
index 302720c43d..5402a56e66 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_single("bootm.image", "");
 
 	data.os_file = fb->tempname;
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-15 12:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15  6:47 [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
2020-09-15  6:47 ` [PATCH 2/4] blspec: only reset variable locations, not paths Rouven Czerwinski
2020-09-15  6:47 ` [PATCH 3/4] blspec: fix bootm_data initialization Rouven Czerwinski
2020-09-15  6:47 ` [PATCH 4/4] fastboot: only unset image, not loadaddr Rouven Czerwinski
2020-09-15  7:50 ` [PATCH 1/4] globalvar: add globalvar_set function Rouven Czerwinski
2020-09-15 12:38 ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2020-09-12  7:12 [PATCH 1/4] globalvar: add set_single function Rouven Czerwinski
2020-09-12  7:12 ` [PATCH 4/4] fastboot: only unset image, not loadaddr Rouven Czerwinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox