[PATCH v2] mach-snapdragon: move default environment to a file

Neil Armstrong neil.armstrong at linaro.org
Mon Jun 24 14:55:56 CEST 2024


On 24/06/2024 14:31, Caleb Connolly wrote:
> Make use of CONFIG_DEFAULT_ENV_FILE and move the default qcom
> environment to a file under board/qualcomm.
> 
> This is much cleaner and means we don't need to recompile on changing
> the environment.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
> ---
> Changes since v1:
> - Don't set bootfile
> - V1: https://lore.kernel.org/u-boot/20240617085629.1744017-1-caleb.connolly@linaro.org
> ---
>   board/qualcomm/default.env | 11 +++++++++++
>   configs/qcom_defconfig     |  2 ++
>   include/configs/qcom.h     | 16 ----------------
>   3 files changed, 13 insertions(+), 16 deletions(-)
>   create mode 100644 board/qualcomm/default.env
> 
> diff --git a/board/qualcomm/default.env b/board/qualcomm/default.env
> new file mode 100644
> index 000000000000..dbf6f4e72600
> --- /dev/null
> +++ b/board/qualcomm/default.env
> @@ -0,0 +1,11 @@
> +stdin=serial,button-kbd
> +stdout=serial,vidconsole
> +stderr=serial,vidconsole
> +preboot=scsi scan; usb start
> +fastboot=fastboot -l $fastboot_addr_r usb 0
> +do_boot=bootefi bootmgr
> +bootmenu_0=Boot first available device=run do_boot
> +bootmenu_1=Enable fastboot mode=run fastboot
> +bootmenu_2=Reset device=reset
> +menucmd=bootmenu
> +bootcmd=run do_boot
> diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig
> index 25fa8b0f7d2b..4ff280fc6e7d 100644
> --- a/configs/qcom_defconfig
> +++ b/configs/qcom_defconfig
> @@ -46,8 +46,10 @@ CONFIG_CMD_LOG=y
>   CONFIG_OF_LIVE=y
>   CONFIG_OF_UPSTREAM_BUILD_VENDOR=y
>   CONFIG_BUTTON_QCOM_PMIC=y
>   CONFIG_BUTTON_REMAP_PHONE_KEYS=y
> +CONFIG_USE_DEFAULT_ENV_FILE=y
> +CONFIG_DEFAULT_ENV_FILE="board/qualcomm/default.env"
>   CONFIG_CLK=y
>   CONFIG_CLK_STUB=y
>   CONFIG_CLK_QCOM_APQ8016=y
>   CONFIG_CLK_QCOM_APQ8096=y
> diff --git a/include/configs/qcom.h b/include/configs/qcom.h
> index c13a847f62f1..b7d38866c51d 100644
> --- a/include/configs/qcom.h
> +++ b/include/configs/qcom.h
> @@ -10,21 +10,5 @@
>   #define __CONFIGS_SNAPDRAGON_H
>   
>   #define CFG_SYS_BAUDRATE_TABLE	{ 115200, 230400, 460800, 921600, 3000000 }
>   
> -/* Load addressed are calculated during board_late_init(). See arm/mach-snapdragon/board.c */
> -#define CFG_EXTRA_ENV_SETTINGS \
> -	"stdin=serial,button-kbd\0"	\
> -	"stdout=serial,vidconsole\0"	\
> -	"stderr=serial,vidconsole\0" \
> -	"bootfile=/extlinux/extlinux.conf\0" \
> -	"preboot=scsi scan; usb start\0" \
> -	"fastboot=fastboot -l $fastboot_addr_r usb 0\0" \
> -	"do_boot=bootefi bootmgr\0" \
> -	"bootmenu_0=Boot first available device=run do_boot\0" \
> -	"bootmenu_1=Enable USB mass storage=ums 0 scsi 0,1,2,3,4,5\0" \
> -	"bootmenu_2=Enable fastboot mode=run fastboot\0" \
> -	"bootmenu_3=Reset device=reset\0" \
> -	"menucmd=bootmenu\0" \
> -	"bootcmd=run do_boot\0" /* first entry is default */
> -
>   #endif

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the U-Boot mailing list