From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iT8MN-0005CF-Mt for ptxdist@pengutronix.de; Fri, 08 Nov 2019 18:47:47 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iT8MN-0007UQ-Ea for ptxdist@pengutronix.de; Fri, 08 Nov 2019 18:47:47 +0100 Date: Fri, 8 Nov 2019 18:47:47 +0100 From: Michael Olbrich Message-ID: <20191108174747.ssegc4sisx4tijtg@pengutronix.de> References: <20191031172852.20544-1-bruno.thomsen@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191031172852.20544-1-bruno.thomsen@gmail.com> Subject: Re: [ptxdist] [PATCH] u-boot: generate default environment image List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Thu, Oct 31, 2019 at 06:28:52PM +0100, Bruno Thomsen wrote: > Can be used during manufacturing to avoid bootloader > console usage and speed up first boot. > > Signed-off-by: Bruno Thomsen > --- > platforms/u-boot.in | 28 ++++++++++++++++++++++++++++ > rules/u-boot.make | 11 +++++++++++ > 2 files changed, 39 insertions(+) > > diff --git a/platforms/u-boot.in b/platforms/u-boot.in > index 9bac4a758..d9195d7cd 100644 > --- a/platforms/u-boot.in > +++ b/platforms/u-boot.in > @@ -2,6 +2,7 @@ > > menuconfig U_BOOT > select BOOTLOADER > + select HOST_U_BOOT_TOOLS if U_BOOT_DEFAULT_ENV_IMAGE Hmm, u-boot builds it's own mkenvimage, right? Why not use that one and avoid the extra dependency? Michael > prompt "U-Boot " > bool > > @@ -71,6 +72,33 @@ config U_BOOT_CONFIG > > endif > > +config U_BOOT_DEFAULT_ENV_IMAGE > + prompt "Generate U-Boot default environment image" > + bool > + help > + Use U-Boot's mkenvimage to compile a U-Boot default environment > + image for use in device manufacturing. > + > +if U_BOOT_DEFAULT_ENV_IMAGE > + > +config U_BOOT_DEFAULT_ENV_IMAGE_SIZE > + prompt "Default environment image size" > + string > + default "0x2000" > + help > + Enter the U-Boot environment size for generation of manufacturing > + image. Size can be prefixed with 0x for hexadecimal values. > + Must match size defined in target config and "/etc/fw_env.config". > + > +config U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT > + prompt "Default environment image with redundant copy" > + bool > + help > + Use to generate a redundant environment in the default 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 8f9290ea7..b6e65a95a 100644 > --- a/rules/u-boot.make > +++ b/rules/u-boot.make > @@ -94,6 +94,13 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT > @$(U_BOOT_DIR)/tools/mkimage -T script -C none \ > -d $(U_BOOT_BOOT_SCRIPT_TXT) \ > $(U_BOOT_DIR)/boot.scr.uimg > +endif > +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE > + $(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh | \ > + $(PTXDIST_SYSROOT_HOST)/bin/mkenvimage -p 0x0 \ > + $(call ptx/ifdef,PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT,-r,) \ > + -s $(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_SIZE) \ > + -o $(U_BOOT_DIR)/u-boot-env.img - > endif > @$(call touch) > > @@ -141,6 +148,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL > @install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \ > $(IMAGEDIR)/u-boot-with-spl-pbl.bin > endif > +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE > + @install -v -D -m644 $(U_BOOT_DIR)/u-boot-env.img \ > + $(IMAGEDIR)/u-boot-env.img > +endif > > ifdef PTXCONF_U_BOOT_BOOT_SCRIPT > @$(call install_init, u-boot) > -- > 2.23.0 > > > _______________________________________________ > 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