[PATCH 2/4] socfpga: chameleonv3: Move environment to a text file
Alexandru M Stan
amstan at chromium.org
Fri Aug 26 21:46:27 CEST 2022
On Fri, Aug 26, 2022 at 12:54 AM Paweł Anikiel <pan at semihalf.com> wrote:
>
> Move the environment to an easily editable text file in the boot
> partition
>
> Signed-off-by: Paweł Anikiel <pan at semihalf.com>
> ---
> board/google/chameleonv3/environment.txt | 13 +++++++++++++
> include/configs/socfpga_chameleonv3.h | 9 ++++-----
> 2 files changed, 17 insertions(+), 5 deletions(-)
> create mode 100644 board/google/chameleonv3/environment.txt
>
> diff --git a/board/google/chameleonv3/environment.txt b/board/google/chameleonv3/environment.txt
> new file mode 100644
> index 0000000000..52aedbb90a
> --- /dev/null
> +++ b/board/google/chameleonv3/environment.txt
> @@ -0,0 +1,13 @@
> +# MMC boot command
> +bootcmd_mmc=load mmc 0:1 ${loadaddr} kernel.itb; bootm
> +
> +# Network boot command and vars
> +bootcmd_net=dhcp; tftpboot ${loadaddr} kernel.itb; bootm
> +autoload=no
> +serverip=192.168.0.1
> +
> +# U-Boot will run this after loading this file
> +bootcmd_txt=run bootcmd_mmc
> +
> +# Kernel cmdline
> +bootargs=cma=256M console=ttyS1,115200 root=/dev/mmcblk0p3 rootflags=subvol=root rw rootwait
> diff --git a/include/configs/socfpga_chameleonv3.h b/include/configs/socfpga_chameleonv3.h
> index 75d2081fac..4c43d89a20 100644
> --- a/include/configs/socfpga_chameleonv3.h
> +++ b/include/configs/socfpga_chameleonv3.h
> @@ -21,11 +21,10 @@
> #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
>
> #define CONFIG_EXTRA_ENV_SETTINGS \
> - "autoload=no\0" \
> - "bootargs=cma=256M console=ttyS1,115200 root=/dev/mmcblk0p3 rw rootwait\0" \
> - "distro_bootcmd=bridge enable; run bootcmd_mmc\0" \
> - "bootcmd_mmc=load mmc 0:1 ${loadaddr} kernel.itb; bootm\0" \
> - "bootcmd_net=dhcp; tftpboot ${loadaddr} kernel.itb; bootm\0"
> + "distro_bootcmd=bridge enable; " \
> + "load mmc 0:1 ${loadaddr} u-boot.txt; " \
> + "env import -t ${loadaddr}; " \
> + "run bootcmd_txt\0"
>
> /*
> * L4 OSC1 Timer 0
> --
> 2.37.2.672.g94769d06f0-goog
>
This has been my request. I really want to be able to change kernel
cmdline by editing a text file in /boot instead of recompiling u-boot.
Tested-by: Alexandru Stan <amstan at chromium.org>
I've been getting the following warning:
> Loading Environment from MMC... *** Warning - bad CRC, using default environment
Is this expected since it's a bare, non CRCd, txt file? Is there any
way we can silence the warning?
Alexandru Stan (amstan)
More information about the U-Boot
mailing list