mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v5 1/2] u-boot: generate environment image
@ 2019-11-25 18:03 Bruno Thomsen
  2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Bruno Thomsen @ 2019-11-25 18:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl, Denis OSTERLAND, Bruno Thomsen, bth

Add possiblity to generate a default or a custom environment
image. Image can be used during manufacturing to avoid bootloader
console usage and speed up first boot. Other image use-cases
include device development edition, device demonstration
mode, etc.

Custom environment image is generated from an user provided
config file with one 'var=value' per line format. Input config
file name is configurable.

Cc: Denis OSTERLAND <denis.osterland@diehl.com>
Cc: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
---
v5:
- split imx dtb image cleanup into bugfix patch
- removed remove quotes in statedir
- remove quetes in platformconfigdir
- common prefix defines
- common env image name
- remove custom env image install and clean
v4:
- u-boot version limitation help.
- env image size is now Kconfig hex input
- custom env source file is now stored in platformconfigdir
- changes in custom env source file trigger rebuild
- use default mkenvimage pad
- cleanup of env images
- fix missing cleanup of imx dtb image
v3:
- remove multiple env images support
- use static image names
- rebase patches on top of: u-boot: Build out-of-tree
v2:
- remove HOST_U_BOOT_TOOLS dependency
- configurable default env image name
- add custom env image generation option
- move all options to sub menu

 platforms/u-boot.in | 61 +++++++++++++++++++++++++++++++++++++++++++++
 rules/u-boot.make   | 25 +++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 9bac4a758..21baf7c72 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -71,6 +71,67 @@ config U_BOOT_CONFIG
 
 endif
 
+choice
+	prompt "Generate environment image"
+	default U_BOOT_ENV_IMAGE_NONE
+	help
+	  U-Boot from version 2018.03 support out-of-tree environment
+	  image generation.
+
+config U_BOOT_ENV_IMAGE_NONE
+	prompt "none"
+	bool
+	help
+	  Don't generate an U-Boot environment image.
+
+config U_BOOT_ENV_IMAGE_DEFAULT
+	prompt "default"
+	bool
+	help
+	  Use U-Boot's mkenvimage to compile a default U-Boot environment
+	  image for use in e.g. device manufacturing or development.
+
+config U_BOOT_ENV_IMAGE_CUSTOM
+	prompt "custom"
+	bool
+	help
+	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
+	  image based on the text file in U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
+	  for use in e.g. device manufacturing or development.
+
+endchoice
+
+config U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
+	prompt "Custom environment source"
+	string
+	default "custom_env.config"
+	depends on U_BOOT_ENV_IMAGE_CUSTOM
+	help
+	  Text file in platform config directory describing the custom
+	  environment.
+	  The file should have lines in the form var=value, one per line.
+	  Blank lines and lines starting with a # are ignored.
+
+if !U_BOOT_ENV_IMAGE_NONE
+
+config U_BOOT_ENV_IMAGE_SIZE
+	prompt "Environment image size"
+	hex
+	default 0x2000
+	help
+	  Enter the U-Boot environment size in hexadecimal for generation
+	  of image. A wrong size will typically cause crc error when used.
+	  Must match size defined in target config and "/etc/fw_env.config".
+
+config U_BOOT_ENV_IMAGE_REDUNDANT
+	prompt "Environment image with redundant copy"
+	bool
+	help
+	  Use to generate a redundant environment in the image.
+	  Must match target config and "/etc/fw_env.config".
+
+endif
+
 config U_BOOT_BOOT_SCRIPT
 	prompt "Compile U-Boot boot script"
 	bool
diff --git a/rules/u-boot.make b/rules/u-boot.make
index e3c2c2389..9609dca97 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -43,6 +43,12 @@ U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \
 $(STATEDIR)/u-boot.compile: $(U_BOOT_BOOT_SCRIPT_TXT)
 endif
 
+ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
+U_BOOT_ENV_IMAGE_CUSTOM_SRC := $(call ptx/in-platformconfigdir, \
+	$(call remove_quotes, $(PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM_SOURCE)))
+$(STATEDIR)/u-boot.compile: $(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
+endif
+
 U_BOOT_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
@@ -100,6 +106,20 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
 	@$(U_BOOT_BUILD_DIR)/tools/mkimage -T script -C none \
 		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
 		$(U_BOOT_BUILD_DIR)/boot.scr.uimg
+endif
+ifdef PTXCONF_U_BOOT_ENV_IMAGE_DEFAULT
+	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh $(U_BOOT_BUILD_DIR) | \
+		$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
+		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
+		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
+		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img -
+endif
+ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
+	$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
+		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
+		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
+		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img \
+		$(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
 endif
 	@$(call touch)
 
@@ -147,6 +167,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
 	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-with-spl-pbl.bin \
 		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
 endif
+ifndef PTXCONF_U_BOOT_ENV_IMAGE_NONE
+	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-env.img \
+		$(IMAGEDIR)/u-boot-env.img
+endif
 
 ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
 	@$(call install_init, u-boot)
@@ -172,6 +196,7 @@ $(STATEDIR)/u-boot.clean:
 	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
 	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
 	@rm -vf $(IMAGEDIR)/u-boot.imx
+	@rm -vf $(IMAGEDIR)/u-boot-env.img
 	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
 
 # ----------------------------------------------------------------------------
-- 
2.23.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean
  2019-11-25 18:03 [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Bruno Thomsen
@ 2019-11-25 18:03 ` Bruno Thomsen
  2019-11-26  7:49   ` Alexander Dahl
  2019-11-26 10:58   ` Denis OSTERLAND
  2019-11-26  8:09 ` [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Alexander Dahl
  2019-11-26 11:01 ` Denis OSTERLAND
  2 siblings, 2 replies; 9+ messages in thread
From: Bruno Thomsen @ 2019-11-25 18:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl, Denis OSTERLAND, Bruno Thomsen, bth

Fixes: 58c48f349901 ("u-boot: Add u-boot-dtb.imx install option")

Cc: Denis OSTERLAND <denis.osterland@diehl.com>
Cc: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
---
v5:
- moved bugfix to seperate patch
v4-v1:
- patch did not exist

 rules/u-boot.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/u-boot.make b/rules/u-boot.make
index 9609dca97..04d801fc6 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -195,7 +195,7 @@ $(STATEDIR)/u-boot.clean:
 	@$(call clean_pkg, U_BOOT)
 	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
 	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
-	@rm -vf $(IMAGEDIR)/u-boot.imx
+	@rm -vf $(IMAGEDIR)/u-boot.imx $(IMAGEDIR)/u-boot-dtb.imx
 	@rm -vf $(IMAGEDIR)/u-boot-env.img
 	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
 
-- 
2.23.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean
  2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
@ 2019-11-26  7:49   ` Alexander Dahl
  2019-11-26  7:57     ` Michael Olbrich
  2019-11-26 10:58   ` Denis OSTERLAND
  1 sibling, 1 reply; 9+ messages in thread
From: Alexander Dahl @ 2019-11-26  7:49 UTC (permalink / raw)
  To: ptxdist; +Cc: Denis OSTERLAND, Bruno Thomsen, bth

This one LGTM.

Tested-by: Alexander Dahl <ada@thorsis.com>

Am Montag, 25. November 2019, 19:03:35 CET schrieb Bruno Thomsen:
> Fixes: 58c48f349901 ("u-boot: Add u-boot-dtb.imx install option")
> 
> Cc: Denis OSTERLAND <denis.osterland@diehl.com>
> Cc: Alexander Dahl <ada@thorsis.com>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
> v5:
> - moved bugfix to seperate patch
> v4-v1:
> - patch did not exist
> 
>  rules/u-boot.make | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 9609dca97..04d801fc6 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -195,7 +195,7 @@ $(STATEDIR)/u-boot.clean:
>  	@$(call clean_pkg, U_BOOT)
>  	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec
> $(IMAGEDIR)/u-boot.elf @rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL
> $(IMAGEDIR)/MLO
> -	@rm -vf $(IMAGEDIR)/u-boot.imx
> +	@rm -vf $(IMAGEDIR)/u-boot.imx $(IMAGEDIR)/u-boot-dtb.imx
>  	@rm -vf $(IMAGEDIR)/u-boot-env.img
>  	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin


-- 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean
  2019-11-26  7:49   ` Alexander Dahl
@ 2019-11-26  7:57     ` Michael Olbrich
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Olbrich @ 2019-11-26  7:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Denis OSTERLAND, Bruno Thomsen, bth

On Tue, Nov 26, 2019 at 08:49:55AM +0100, Alexander Dahl wrote:
> This one LGTM.
> 
> Tested-by: Alexander Dahl <ada@thorsis.com>

Both patches?

Michael

> Am Montag, 25. November 2019, 19:03:35 CET schrieb Bruno Thomsen:
> > Fixes: 58c48f349901 ("u-boot: Add u-boot-dtb.imx install option")
> > 
> > Cc: Denis OSTERLAND <denis.osterland@diehl.com>
> > Cc: Alexander Dahl <ada@thorsis.com>
> > Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> > ---
> > v5:
> > - moved bugfix to seperate patch
> > v4-v1:
> > - patch did not exist
> > 
> >  rules/u-boot.make | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/rules/u-boot.make b/rules/u-boot.make
> > index 9609dca97..04d801fc6 100644
> > --- a/rules/u-boot.make
> > +++ b/rules/u-boot.make
> > @@ -195,7 +195,7 @@ $(STATEDIR)/u-boot.clean:
> >  	@$(call clean_pkg, U_BOOT)
> >  	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec
> > $(IMAGEDIR)/u-boot.elf @rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL
> > $(IMAGEDIR)/MLO
> > -	@rm -vf $(IMAGEDIR)/u-boot.imx
> > +	@rm -vf $(IMAGEDIR)/u-boot.imx $(IMAGEDIR)/u-boot-dtb.imx
> >  	@rm -vf $(IMAGEDIR)/u-boot-env.img
> >  	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
> 
> 
> -- 
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

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

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 1/2] u-boot: generate environment image
  2019-11-25 18:03 [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Bruno Thomsen
  2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
@ 2019-11-26  8:09 ` Alexander Dahl
  2019-11-26  9:03   ` Bruno Thomsen
  2019-11-26 11:01 ` Denis OSTERLAND
  2 siblings, 1 reply; 9+ messages in thread
From: Alexander Dahl @ 2019-11-26  8:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Denis OSTERLAND, Bruno Thomsen, bth

Hello Bruno,

thanks for your continued work on this. Overall this one looks good to me now, 
only some typos in commit message and help text left, but that's no blocker 
for me (see below for those). :-)

I also tested putting the custom_env.config in different layers. Works fine.

Tested-by: Alexander Dahl <ada@thorsis.com>

Am Montag, 25. November 2019, 19:03:34 CET schrieb Bruno Thomsen:
> Add possiblity to generate a default or a custom environment

possibility

> image. Image can be used during manufacturing to avoid bootloader
> console usage and speed up first boot. Other image use-cases
> include device development edition, device demonstration
> mode, etc.
> 
> Custom environment image is generated from an user provided
> config file with one 'var=value' per line format. Input config
> file name is configurable.
> 
> Cc: Denis OSTERLAND <denis.osterland@diehl.com>
> Cc: Alexander Dahl <ada@thorsis.com>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
> v5:
> - split imx dtb image cleanup into bugfix patch
> - removed remove quotes in statedir
> - remove quetes in platformconfigdir
> - common prefix defines
> - common env image name
> - remove custom env image install and clean
> v4:
> - u-boot version limitation help.
> - env image size is now Kconfig hex input
> - custom env source file is now stored in platformconfigdir
> - changes in custom env source file trigger rebuild
> - use default mkenvimage pad
> - cleanup of env images
> - fix missing cleanup of imx dtb image
> v3:
> - remove multiple env images support
> - use static image names
> - rebase patches on top of: u-boot: Build out-of-tree
> v2:
> - remove HOST_U_BOOT_TOOLS dependency
> - configurable default env image name
> - add custom env image generation option
> - move all options to sub menu
> 
>  platforms/u-boot.in | 61 +++++++++++++++++++++++++++++++++++++++++++++
>  rules/u-boot.make   | 25 +++++++++++++++++++
>  2 files changed, 86 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..21baf7c72 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -71,6 +71,67 @@ config U_BOOT_CONFIG
> 
>  endif
> 
> +choice
> +	prompt "Generate environment image"
> +	default U_BOOT_ENV_IMAGE_NONE
> +	help
> +	  U-Boot from version 2018.03 support out-of-tree environment
> +	  image generation.

supports

> +
> +config U_BOOT_ENV_IMAGE_NONE
> +	prompt "none"
> +	bool
> +	help
> +	  Don't generate an U-Boot environment image.
> +
> +config U_BOOT_ENV_IMAGE_DEFAULT
> +	prompt "default"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a default U-Boot environment
> +	  image for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_ENV_IMAGE_CUSTOM
> +	prompt "custom"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
> +	  image based on the text file in U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
> +	  for use in e.g. device manufacturing or development.
> +
> +endchoice
> +
> +config U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
> +	prompt "Custom environment source"
> +	string
> +	default "custom_env.config"
> +	depends on U_BOOT_ENV_IMAGE_CUSTOM
> +	help
> +	  Text file in platform config directory describing the custom
> +	  environment.
> +	  The file should have lines in the form var=value, one per line.
> +	  Blank lines and lines starting with a # are ignored.
> +
> +if !U_BOOT_ENV_IMAGE_NONE
> +
> +config U_BOOT_ENV_IMAGE_SIZE
> +	prompt "Environment image size"
> +	hex
> +	default 0x2000
> +	help
> +	  Enter the U-Boot environment size in hexadecimal for generation
> +	  of image. A wrong size will typically cause crc error when used.
> +	  Must match size defined in target config and "/etc/fw_env.config".
> +
> +config U_BOOT_ENV_IMAGE_REDUNDANT
> +	prompt "Environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the image.
> +	  Must match target config and "/etc/fw_env.config".
> +
> +endif
> +
>  config U_BOOT_BOOT_SCRIPT
>  	prompt "Compile U-Boot boot script"
>  	bool
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index e3c2c2389..9609dca97 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -43,6 +43,12 @@ U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \
>  $(STATEDIR)/u-boot.compile: $(U_BOOT_BOOT_SCRIPT_TXT)
>  endif
> 
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
> +U_BOOT_ENV_IMAGE_CUSTOM_SRC := $(call ptx/in-platformconfigdir, \
> +	$(call remove_quotes, $(PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM_SOURCE)))
> +$(STATEDIR)/u-boot.compile: $(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
> +endif
> +
>  U_BOOT_WRAPPER_BLACKLIST := \
>  	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
> 
> @@ -100,6 +106,20 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(U_BOOT_BUILD_DIR)/tools/mkimage -T script -C none \
>  		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
>  		$(U_BOOT_BUILD_DIR)/boot.scr.uimg
> +endif
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_DEFAULT
> +	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh
> $(U_BOOT_BUILD_DIR) | \ +		$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img -
> +endif
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
> +	$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img \
> +		$(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
>  endif
>  	@$(call touch)
> 
> @@ -147,6 +167,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
>  	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-with-spl-pbl.bin \
>  		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  endif
> +ifndef PTXCONF_U_BOOT_ENV_IMAGE_NONE
> +	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-env.img \
> +		$(IMAGEDIR)/u-boot-env.img
> +endif
> 
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)
> @@ -172,6 +196,7 @@ $(STATEDIR)/u-boot.clean:
>  	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec
> $(IMAGEDIR)/u-boot.elf @rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL
> $(IMAGEDIR)/MLO
>  	@rm -vf $(IMAGEDIR)/u-boot.imx
> +	@rm -vf $(IMAGEDIR)/u-boot-env.img
>  	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
> 
>  #
> ---------------------------------------------------------------------------
> -

Greets
Alex


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 1/2] u-boot: generate environment image
  2019-11-26  8:09 ` [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Alexander Dahl
@ 2019-11-26  9:03   ` Bruno Thomsen
  2019-11-26  9:25     ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Thomsen @ 2019-11-26  9:03 UTC (permalink / raw)
  To: Alexander Dahl; +Cc: Denis OSTERLAND, ptxdist, bth

Hi Alexander,

Thanks for your continued review and test.

Den tir. 26. nov. 2019 kl. 09.09 skrev Alexander Dahl <ada@thorsis.com>:
> thanks for your continued work on this. Overall this one looks good to me now,
> only some typos in commit message and help text left, but that's no blocker
> for me (see below for those). :-)

Okay, depending on Denis comments we can see if a version 6 is needed.
Maybe we can convince Michael to do a fixup of the 2 spelling typos
before commit if that's all that's needed.

Bruno

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 1/2] u-boot: generate environment image
  2019-11-26  9:03   ` Bruno Thomsen
@ 2019-11-26  9:25     ` Michael Olbrich
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Olbrich @ 2019-11-26  9:25 UTC (permalink / raw)
  To: ptxdist

On Tue, Nov 26, 2019 at 10:03:28AM +0100, Bruno Thomsen wrote:
> Hi Alexander,
> 
> Thanks for your continued review and test.
> 
> Den tir. 26. nov. 2019 kl. 09.09 skrev Alexander Dahl <ada@thorsis.com>:
> > thanks for your continued work on this. Overall this one looks good to me now,
> > only some typos in commit message and help text left, but that's no blocker
> > for me (see below for those). :-)
> 
> Okay, depending on Denis comments we can see if a version 6 is needed.
> Maybe we can convince Michael to do a fixup of the 2 spelling typos
> before commit if that's all that's needed.

I can do the fixup.

Denis, any more comments?

Michael

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

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean
  2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
  2019-11-26  7:49   ` Alexander Dahl
@ 2019-11-26 10:58   ` Denis OSTERLAND
  1 sibling, 0 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2019-11-26 10:58 UTC (permalink / raw)
  To: ptxdist, bruno.thomsen; +Cc: ada, bth

Am Montag, den 25.11.2019, 19:03 +0100 schrieb Bruno Thomsen:
> Fixes: 58c48f349901 ("u-boot: Add u-boot-dtb.imx install option")
> 
> Cc: Denis OSTERLAND <denis.osterland@diehl.com>
> Cc: Alexander Dahl <ada@thorsis.com>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Acked-by: Denis Osterland <Denis.Osterland@diehl.com>

> ---
> v5:
> - moved bugfix to seperate patch
> v4-v1:
> - patch did not exist
> 
>  rules/u-boot.make | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 9609dca97..04d801fc6 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -195,7 +195,7 @@ $(STATEDIR)/u-boot.clean:
>  	@$(call clean_pkg, U_BOOT)
>  	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
>  	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
> -	@rm -vf $(IMAGEDIR)/u-boot.imx
> +	@rm -vf $(IMAGEDIR)/u-boot.imx $(IMAGEDIR)/u-boot-dtb.imx
>  	@rm -vf $(IMAGEDIR)/u-boot-env.img
>  	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  


Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter https://www.diehl.com/group/de/transparenz-und-informationspflichten/

The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
- For general information on data protection and your respective rights please visit https://www.diehl.com/group/en/transparency-and-information-obligations/
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v5 1/2] u-boot: generate environment image
  2019-11-25 18:03 [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Bruno Thomsen
  2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
  2019-11-26  8:09 ` [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Alexander Dahl
@ 2019-11-26 11:01 ` Denis OSTERLAND
  2 siblings, 0 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2019-11-26 11:01 UTC (permalink / raw)
  To: ptxdist, bruno.thomsen; +Cc: ada, bth

Hi,

thanks for your effort and time to implement this additional use-case

Regards Denis

Am Montag, den 25.11.2019, 19:03 +0100 schrieb Bruno Thomsen:
> Add possiblity to generate a default or a custom environment
> image. Image can be used during manufacturing to avoid bootloader
> console usage and speed up first boot. Other image use-cases
> include device development edition, device demonstration
> mode, etc.
> 
> Custom environment image is generated from an user provided
> config file with one 'var=value' per line format. Input config
> file name is configurable.
> 
> Cc: Denis OSTERLAND <denis.osterland@diehl.com>
> Cc: Alexander Dahl <ada@thorsis.com>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Tested-by: Denis Osterland <Denis.Osterland@diehl.com>

> ---
> v5:
> - split imx dtb image cleanup into bugfix patch
> - removed remove quotes in statedir
> - remove quetes in platformconfigdir
> - common prefix defines
> - common env image name
> - remove custom env image install and clean
> v4:
> - u-boot version limitation help.
> - env image size is now Kconfig hex input
> - custom env source file is now stored in platformconfigdir
> - changes in custom env source file trigger rebuild
> - use default mkenvimage pad
> - cleanup of env images
> - fix missing cleanup of imx dtb image
> v3:
> - remove multiple env images support
> - use static image names
> - rebase patches on top of: u-boot: Build out-of-tree
> v2:
> - remove HOST_U_BOOT_TOOLS dependency
> - configurable default env image name
> - add custom env image generation option
> - move all options to sub menu
> 
>  platforms/u-boot.in | 61 +++++++++++++++++++++++++++++++++++++++++++++
>  rules/u-boot.make   | 25 +++++++++++++++++++
>  2 files changed, 86 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..21baf7c72 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -71,6 +71,67 @@ config U_BOOT_CONFIG
>  
>  endif
>  
> +choice
> +	prompt "Generate environment image"
> +	default U_BOOT_ENV_IMAGE_NONE
> +	help
> +	  U-Boot from version 2018.03 support out-of-tree environment
> +	  image generation.
> +
> +config U_BOOT_ENV_IMAGE_NONE
> +	prompt "none"
> +	bool
> +	help
> +	  Don't generate an U-Boot environment image.
> +
> +config U_BOOT_ENV_IMAGE_DEFAULT
> +	prompt "default"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a default U-Boot environment
> +	  image for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_ENV_IMAGE_CUSTOM
> +	prompt "custom"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
> +	  image based on the text file in U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
> +	  for use in e.g. device manufacturing or development.
> +
> +endchoice
> +
> +config U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
> +	prompt "Custom environment source"
> +	string
> +	default "custom_env.config"
> +	depends on U_BOOT_ENV_IMAGE_CUSTOM
> +	help
> +	  Text file in platform config directory describing the custom
> +	  environment.
> +	  The file should have lines in the form var=value, one per line.
> +	  Blank lines and lines starting with a # are ignored.
> +
> +if !U_BOOT_ENV_IMAGE_NONE
> +
> +config U_BOOT_ENV_IMAGE_SIZE
> +	prompt "Environment image size"
> +	hex
> +	default 0x2000
> +	help
> +	  Enter the U-Boot environment size in hexadecimal for generation
> +	  of image. A wrong size will typically cause crc error when used.
> +	  Must match size defined in target config and "/etc/fw_env.config".
> +
> +config U_BOOT_ENV_IMAGE_REDUNDANT
> +	prompt "Environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the image.
> +	  Must match target config and "/etc/fw_env.config".
> +
> +endif
> +
>  config U_BOOT_BOOT_SCRIPT
>  	prompt "Compile U-Boot boot script"
>  	bool
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index e3c2c2389..9609dca97 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -43,6 +43,12 @@ U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \
>  $(STATEDIR)/u-boot.compile: $(U_BOOT_BOOT_SCRIPT_TXT)
>  endif
>  
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
> +U_BOOT_ENV_IMAGE_CUSTOM_SRC := $(call ptx/in-platformconfigdir, \
> +	$(call remove_quotes, $(PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM_SOURCE)))
> +$(STATEDIR)/u-boot.compile: $(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
> +endif
> +
>  U_BOOT_WRAPPER_BLACKLIST := \
>  	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
>  
> @@ -100,6 +106,20 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(U_BOOT_BUILD_DIR)/tools/mkimage -T script -C none \
>  		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
>  		$(U_BOOT_BUILD_DIR)/boot.scr.uimg
> +endif
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_DEFAULT
> +	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh $(U_BOOT_BUILD_DIR) | \
> +		$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img -
> +endif
> +ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
> +	$(U_BOOT_BUILD_DIR)/tools/mkenvimage \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_BUILD_DIR)/u-boot-env.img \
> +		$(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
>  endif
>  	@$(call touch)
>  
> @@ -147,6 +167,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
>  	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-with-spl-pbl.bin \
>  		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  endif
> +ifndef PTXCONF_U_BOOT_ENV_IMAGE_NONE
> +	@install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-env.img \
> +		$(IMAGEDIR)/u-boot-env.img
> +endif
>  
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)
> @@ -172,6 +196,7 @@ $(STATEDIR)/u-boot.clean:
>  	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
>  	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
>  	@rm -vf $(IMAGEDIR)/u-boot.imx
> +	@rm -vf $(IMAGEDIR)/u-boot-env.img
>  	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  
>  # ----------------------------------------------------------------------------


Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter https://www.diehl.com/group/de/transparenz-und-informationspflichten/

The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
- For general information on data protection and your respective rights please visit https://www.diehl.com/group/en/transparency-and-information-obligations/
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2019-11-26 11:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 18:03 [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Bruno Thomsen
2019-11-25 18:03 ` [ptxdist] [PATCH v5 2/2] u-boot: bugfix: missing imx dtb image clean Bruno Thomsen
2019-11-26  7:49   ` Alexander Dahl
2019-11-26  7:57     ` Michael Olbrich
2019-11-26 10:58   ` Denis OSTERLAND
2019-11-26  8:09 ` [ptxdist] [PATCH v5 1/2] u-boot: generate environment image Alexander Dahl
2019-11-26  9:03   ` Bruno Thomsen
2019-11-26  9:25     ` Michael Olbrich
2019-11-26 11:01 ` Denis OSTERLAND

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