Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB3C1C433EF for ; Tue, 14 Jun 2022 16:18:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A947084343; Tue, 14 Jun 2022 18:18:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="LOY7tkzr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B86584344; Tue, 14 Jun 2022 18:18:45 +0200 (CEST) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1691E8431D for ; Tue, 14 Jun 2022 18:18:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2a.google.com with SMTP id v12so196360qvh.9 for ; Tue, 14 Jun 2022 09:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qRAtHPlYPbLNaDtY1ksFSMDukwTvVBR1A5PcU/YzzPo=; b=LOY7tkzr0LiK6lMNf/YrhnKJbHX+dvmCD5HbsOrLKtMN8rCkomTVLsveS05jlDHNwn sFO2E+HzDZ6cSJw2e2qbdYE8SAo3WgT3m8It3kUqwf9DRbqUYPaJHdylRv9NINd+3qK9 JMb4x5TZkcyQv2VxaunYyWhLckl4c6WQc+o3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qRAtHPlYPbLNaDtY1ksFSMDukwTvVBR1A5PcU/YzzPo=; b=5efU/9fKP5gTqF/X677uT34W4FZd/nEBw49uIEkE6FK8RZU5/tai1RzpkYEDIUGkdm bwRLDLyR/Ki3o1TM/9X1VowBB/wIynPGuQ7szFA4Ib4Rt36pxSwlrS1Dn5iI0Ef8P4z+ FUluMyV9pYJobUkE5isi1XEt+H9aimUETpuHVmT8jf7+guCE1CnGo/h4NvRmQyGOuRTZ nidpxq7w+YKFQEpk4Qj1Vw/0wK6enjtTeko+eM+u/pFz9M0KKyZhTErYfO5AF21MqTCG Z106pUKYhHXcGxKyDgKwkFc6YN8oamHdWKnmHvrisuJG91pjdq9VIvLonr0vwb46U/5/ dI+g== X-Gm-Message-State: AJIora+Bpo8pqnc++gzC8cDomhBEIPIKOLXWhKl+rIAoT13oZ+gaFxtx xHLszCtCbm7WcyFOx+TilX1PP/RGMHdAvA== X-Google-Smtp-Source: AGRyM1sGLGLG7KdF+RNv9tsZkBD0RPygSJZsDsxnZtHaRwS/eb2ZdHszdf82vz1NyAbi7AyJxKWjdg== X-Received: by 2002:ad4:596f:0:b0:467:d3ad:b582 with SMTP id eq15-20020ad4596f000000b00467d3adb582mr4123243qvb.113.1655223520696; Tue, 14 Jun 2022 09:18:40 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id t25-20020ac85319000000b00304ea0a86cesm7242191qtn.81.2022.06.14.09.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 09:18:39 -0700 (PDT) Date: Tue, 14 Jun 2022 12:18:38 -0400 From: Tom Rini To: Tim Harvey Cc: u-boot Subject: Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Message-ID: <20220614161838.GA2484912@bill-the-cat> References: <20220614025737.3708141-1-trini@konsulko.com> <20220614025737.3708141-8-trini@konsulko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GP2Q9BpnKw3uwZvK" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean --GP2Q9BpnKw3uwZvK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 14, 2022 at 09:14:03AM -0700, Tim Harvey wrote: > On Mon, Jun 13, 2022 at 7:57 PM Tom Rini wrote: > > > > Move the environment text over from being set via > > CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over > > to plain text in board/gateworks/gw_ventana/gw_ventana.env. This lets > > us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a > > single environment file now. > > > > Cc: Tim Harvey > > Signed-off-by: Tom Rini > > --- > > board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++ > > include/configs/gw_ventana.h | 148 ---------------------- > > 2 files changed, 145 insertions(+), 148 deletions(-) > > create mode 100644 board/gateworks/gw_ventana/gw_ventana.env > > > > diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gatework= s/gw_ventana/gw_ventana.env > > new file mode 100644 > > index 000000000000..9a316c74f215 > > --- /dev/null > > +++ b/board/gateworks/gw_ventana/gw_ventana.env > > @@ -0,0 +1,145 @@ > > +/* SPDX-License-Identifier: GPL-2.0+ */ > > +/* > > + * Copyright (C) 2013 Gateworks Corporation > > + */ > > + > > +splashpos=3Dm,m > > +splashimage=3DCONFIG_SYS_LOAD_ADDR > > +usb_pgood_delay=3D2000 > > +console=3Dttymxc1 > > +bootdevs=3Dusb mmc sata flash > > +hwconfig=3D_UNKNOWN_ > > + > > +disk=3D0 > > +part=3D1 > > + > > +fdt_high=3D0xffffffff > > +fdt_addr=3D0x18000000 > > +initrd_high=3D0xffffffff > > +fixfdt=3Dfdt addr ${fdt_addr} > > +bootdir=3Dboot > > +loadfdt=3D > > + if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then > > + echo Loaded DTB from ${bootdir}/${fdt_file}; > > + run fixfdt; > > + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then > > + echo Loaded DTB from ${bootdir}/${fdt_file1}; > > + run fixfdt; > > + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then > > + echo Loaded DTB from ${bootdir}/${fdt_file2}; > > + run fixfdt; > > + fi > > + > > +fs=3Dext4 > > +script=3D6x_bootscript-ventana > > +loadscript=3D > > + if ${fsload} ${loadaddr} ${bootdir}/${script}; then > > + source ${loadaddr}; > > + fi > > + > > +uimage=3DuImage > > +mmc_root=3Dmmcblk0p1 > > +mmc_boot=3D > > + setenv fsload "${fs}load mmc ${disk}:${part}"; > > + mmc dev ${disk} && mmc rescan && > > + setenv dtype mmc; run loadscript; > > + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then > > + setenv bootargs console=3D${console},${baudrate} > > + root=3D/dev/${mmc_root} rootfstype=3D${fs} > > + rootwait rw ${video} ${extra}; > > + if run loadfdt; then > > + bootm ${loadaddr} - ${fdt_addr}; > > + else > > + bootm; > > + fi; > > + fi > > + > > +sata_boot=3D > > + setenv fsload "${fs}load sata ${disk}:${part}"; > > + sata init && > > + setenv dtype sata; run loadscript; > > + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then > > + setenv bootargs console=3D${console},${baudrate} > > + root=3D/dev/sda1 rootfstype=3D${fs} > > + rootwait rw ${video} ${extra}; > > + if run loadfdt; then > > + bootm ${loadaddr} - ${fdt_addr}; > > + else > > + bootm; > > + fi; > > + fi > > + > > +usb_boot=3D > > + setenv fsload "${fs}load usb ${disk}:${part}"; > > + usb start && usb dev ${disk} && > > + setenv dtype usb; run loadscript; > > + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then > > + setenv bootargs console=3D${console},${baudrate} > > + root=3D/dev/sda1 rootfstype=3D${fs} > > + rootwait rw ${video} ${extra}; > > + if run loadfdt; then > > + bootm ${loadaddr} - ${fdt_addr}; > > + else > > + bootm; > > + fi; > > + fi > > + > > +#ifdef CONFIG_SPI_FLASH > > +image_os=3Dventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin > > +image_uboot=3Dventana/u-boot_spi.imx > > + > > +spi_koffset=3D0x90000 > > +spi_klen=3D0x200000 > > + > > +spi_updateuboot=3Decho Updating uboot from > > + ${serverip}:${image_uboot}...; > > + tftpboot ${loadaddr} ${image_uboot} && > > + sf probe && sf erase 0 80000 && > > + sf write ${loadaddr} 400 ${filesize} > > +spi_update=3Decho Updating OS from ${serverip}:${image_os} > > + to ${spi_koffset} ...; > > + tftp ${loadaddr} ${image_os} && > > + sf probe && > > + sf update ${loadaddr} ${spi_koffset} ${filesize} > > + > > +flash_boot=3D > > + if sf probe && > > + sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then > > + setenv bootargs console=3D${console},${baudrate} > > + root=3D/dev/mtdblock3 > > + rootfstype=3Dsquashfs,jffs2 > > + ${video} ${extra}; > > + bootm; > > + fi > > +#else > > +image_rootfs=3Dopenwrt-imx6-ventana-rootfs.ubi > > +nand_update=3Decho Updating NAND from ${serverip}:${image_rootfs}...; > > + tftp ${loadaddr} ${image_rootfs} && > > + nand erase.part rootfs && > > + nand write ${loadaddr} rootfs ${filesize} > > + > > +flash_boot=3D > > + setenv fsload 'ubifsload'; > > + ubi part rootfs; > > + if ubi check boot; then > > + ubifsmount ubi0:boot; > > + setenv root ubi0:rootfs ubi.mtd=3D2 > > + rootfstype=3Dsquashfs,ubifs; > > + setenv bootdir; > > + elif ubi check rootfs; then > > + ubifsmount ubi0:rootfs; > > + setenv root ubi0:rootfs ubi.mtd=3D2 > > + rootfstype=3Dubifs; > > + fi; > > + setenv dtype nand; run loadscript; > > + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then > > + setenv bootargs console=3D${console},${baudrate} > > + root=3D${root} ${video} ${extra}; > > + if run loadfdt; then > > + ubifsumount; > > + bootm ${loadaddr} - ${fdt_addr}; > > + else > > + ubifsumount; bootm; > > + fi; > > + fi > > +#endif > > diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h > > index 77f41502220a..47a72fc8fce5 100644 > > --- a/include/configs/gw_ventana.h > > +++ b/include/configs/gw_ventana.h > > @@ -76,152 +76,4 @@ > > #define CONFIG_IPADDR 192.168.1.1 > > #define CONFIG_SERVERIP 192.168.1.146 > > > > -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \ > > - "splashpos=3Dm,m\0" \ > > - "splashimage=3D" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ > > - "usb_pgood_delay=3D2000\0" \ > > - "console=3Dttymxc1\0" \ > > - "bootdevs=3Dusb mmc sata flash\0" \ > > - "hwconfig=3D_UNKNOWN_\0" \ > > - "video=3D\0" \ > > - \ > > - "disk=3D0\0" \ > > - "part=3D1\0" \ > > - \ > > - "fdt_high=3D0xffffffff\0" \ > > - "fdt_addr=3D0x18000000\0" \ > > - "initrd_high=3D0xffffffff\0" \ > > - "fixfdt=3D" \ > > - "fdt addr ${fdt_addr}\0" \ > > - "bootdir=3Dboot\0" \ > > - "loadfdt=3D" \ > > - "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then = " \ > > - "echo Loaded DTB from ${bootdir}/${fdt_file}; "= \ > > - "run fixfdt; " \ > > - "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; th= en " \ > > - "echo Loaded DTB from ${bootdir}/${fdt_file1}; = " \ > > - "run fixfdt; " \ > > - "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; th= en " \ > > - "echo Loaded DTB from ${bootdir}/${fdt_file2}; = " \ > > - "run fixfdt; " \ > > - "fi\0" \ > > - \ > > - "fs=3Dext4\0" \ > > - "script=3D6x_bootscript-ventana\0" \ > > - "loadscript=3D" \ > > - "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \ > > - "source ${loadaddr}; " \ > > - "fi\0" \ > > - \ > > - "uimage=3DuImage\0" \ > > - "mmc_root=3Dmmcblk0p1\0" \ > > - "mmc_boot=3D" \ > > - "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \ > > - "mmc dev ${disk} && mmc rescan && " \ > > - "setenv dtype mmc; run loadscript; " \ > > - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ > > - "setenv bootargs console=3D${console},${baudrat= e} " \ > > - "root=3D/dev/${mmc_root} rootfstype=3D$= {fs} " \ > > - "rootwait rw ${video} ${extra}; " \ > > - "if run loadfdt; then " \ > > - "bootm ${loadaddr} - ${fdt_addr}; " \ > > - "else " \ > > - "bootm; " \ > > - "fi; " \ > > - "fi\0" \ > > - \ > > - "sata_boot=3D" \ > > - "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \ > > - "sata init && " \ > > - "setenv dtype sata; run loadscript; " \ > > - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ > > - "setenv bootargs console=3D${console},${baudrat= e} " \ > > - "root=3D/dev/sda1 rootfstype=3D${fs} " \ > > - "rootwait rw ${video} ${extra}; " \ > > - "if run loadfdt; then " \ > > - "bootm ${loadaddr} - ${fdt_addr}; " \ > > - "else " \ > > - "bootm; " \ > > - "fi; " \ > > - "fi\0" \ > > - "usb_boot=3D" \ > > - "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \ > > - "usb start && usb dev ${disk} && " \ > > - "setenv dtype usb; run loadscript; " \ > > - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ > > - "setenv bootargs console=3D${console},${baudrat= e} " \ > > - "root=3D/dev/sda1 rootfstype=3D${fs} " \ > > - "rootwait rw ${video} ${extra}; " \ > > - "if run loadfdt; then " \ > > - "bootm ${loadaddr} - ${fdt_addr}; " \ > > - "else " \ > > - "bootm; " \ > > - "fi; " \ > > - "fi\0" > > - > > -#ifdef CONFIG_SPI_FLASH > > - #define CONFIG_EXTRA_ENV_SETTINGS \ > > - CONFIG_EXTRA_ENV_SETTINGS_COMMON \ > > - "image_os=3Dventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0"= \ > > - "image_uboot=3Dventana/u-boot_spi.imx\0" \ > > - \ > > - "spi_koffset=3D0x90000\0" \ > > - "spi_klen=3D0x200000\0" \ > > - \ > > - "spi_updateuboot=3Decho Updating uboot from " \ > > - "${serverip}:${image_uboot}...; " \ > > - "tftpboot ${loadaddr} ${image_uboot} && " \ > > - "sf probe && sf erase 0 80000 && " \ > > - "sf write ${loadaddr} 400 ${filesize}\0" \ > > - "spi_update=3Decho Updating OS from ${serverip}:${image_os} " \ > > - "to ${spi_koffset} ...; " \ > > - "tftp ${loadaddr} ${image_os} && " \ > > - "sf probe && " \ > > - "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \ > > - \ > > - "flash_boot=3D" \ > > - "if sf probe && " \ > > - "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then "= \ > > - "setenv bootargs console=3D${console},${baudrat= e} " \ > > - "root=3D/dev/mtdblock3 " \ > > - "rootfstype=3Dsquashfs,jffs2 " \ > > - "${video} ${extra}; " \ > > - "bootm; " \ > > - "fi\0" > > -#else > > - #define CONFIG_EXTRA_ENV_SETTINGS \ > > - CONFIG_EXTRA_ENV_SETTINGS_COMMON \ > > - \ > > - "image_rootfs=3Dopenwrt-imx6-ventana-rootfs.ubi\0" \ > > - "nand_update=3Decho Updating NAND from ${serverip}:${image_root= fs}...; " \ > > - "tftp ${loadaddr} ${image_rootfs} && " \ > > - "nand erase.part rootfs && " \ > > - "nand write ${loadaddr} rootfs ${filesize}\0" \ > > - \ > > - "flash_boot=3D" \ > > - "setenv fsload 'ubifsload'; " \ > > - "ubi part rootfs; " \ > > - "if ubi check boot; then " \ > > - "ubifsmount ubi0:boot; " \ > > - "setenv root ubi0:rootfs ubi.mtd=3D2 " \ > > - "rootfstype=3Dsquashfs,ubifs; " \ > > - "setenv bootdir; " \ > > - "elif ubi check rootfs; then " \ > > - "ubifsmount ubi0:rootfs; " \ > > - "setenv root ubi0:rootfs ubi.mtd=3D2 " \ > > - "rootfstype=3Dubifs; " \ > > - "fi; " \ > > - "setenv dtype nand; run loadscript; " \ > > - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ > > - "setenv bootargs console=3D${console},${baudrat= e} " \ > > - "root=3D${root} ${video} ${extra}; " \ > > - "if run loadfdt; then " \ > > - "ubifsumount; " \ > > - "bootm ${loadaddr} - ${fdt_addr}; " \ > > - "else " \ > > - "ubifsumount; bootm; " \ > > - "fi; " \ > > - "fi\0" > > -#endif > > - > > #endif /* __CONFIG_H */ > > -- > > 2.25.1 > > >=20 > Tom, >=20 > Thanks, I've been looking forward to seeing how env is going to get > migrated out of headers. Can you explain the process used to create > this patch? It seems you may have something automated. >=20 > Acked-by: Tim Harvey So, I do not have anything automated, unfortunately. In cases like this where we don't use distro_bootcmd and also don't use defined blocks of commands, it's a matter of applying a few regexs to remove quotes, spaces and trailing \, then giving it a quick read to make sure it's still right. This last part is some of why it can't be automated as we have cases of: "some_bootargs=3Da=3D1 b=3D2" \ "c=3D3\0" and since there's no indent on c=3D3, it would become "c=3D3" in the environment rather than "some_bootargs" being set to "a=3D1 b=3D2 c=3D3". --=20 Tom --GP2Q9BpnKw3uwZvK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKotNoACgkQFHw5/5Y0 tyy8Vgv+MXsxp2sfxqAYmKOdpGk4Kgo9ooFXVMYbBz0cEBwLIp2FCNllajwC220t isNdaIxvSJ9J8+9yiD0RRDtlR/JjzKhk6DZoKi/8iuKKHnzVJcxGxnsz0whsrWWe 8ZUgLEIxIp2/5N8o94WKZ9KnSiBowFN8Cm3NpHXZP5L9PFWu9P6qWLXgiYe4XDIm Ys26nHUc0eB4mYXzYvWg+0usY2TPcicZWifO0LIfAoTDOHGOG8eqMD7a5aRLsbY2 2nzzobi5so+WrdCiTjZELrBZFZh9yhRwEnCYNjFCoA7w2H6Lj8eKJaev0nFJC5hm Ej8Os7weaRvTnVfixQLhxE5kUsu9JVt2pdXxCu/Q/TGGUb8qsBjXRvaSe8ymrIW/ VQVih14uJDzsNS4pEXWxDihHMEqjehpvYDS6IuKgrzgR4YIYIGX9KNigPUJ5GVYz qXd2hVp2ZpqqrDVih8lQIvPxHwi251hTNKcZP/lXL+bZQklxrSu2bYNRzXsIRL5p K0vWI56D =647I -----END PGP SIGNATURE----- --GP2Q9BpnKw3uwZvK--