[U-Boot] [PATCH v8 1/7] arm: socfpga: add env settings to common header

Alexander Graf
2017-01-30T14:55:41Z

On 01/29/2017 12:05 AM, Dalon Westergreen wrote:
> From: Dalon Westergreen <dalon.westergreen@intel.com>
>
> Move repeated environment settings for socfpga boards
> to a common header.
>
> The default values for the boot partition and the
> OS filesystem partition have changed and as
> as result the default uboot environment for socfpga
> boards needs updating.
>
> Move to using CONFIG_DEFAULT_DEVICE_TREE for setting the
> default linux devicetree used during linux boot.
>
> Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>
> ---
> include/configs/socfpga_common.h | 35 +++++++++++++++++++++++++++++++++--
> 1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index 6285266..744aee9 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -312,10 +312,14 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
> /* SPL SDMMC boot support */
> #ifdef CONFIG_SPL_MMC_SUPPORT
> #if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
> -#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 2
> #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
> +#else
> +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 2
> +#endif
> #else
> -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1
> +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 3
> #endif
> #endif
>
> @@ -336,5 +340,32 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
> * Stack setup
> */
> #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
> +
> +/* Extra Environment */
> +#ifndef CONFIG_EXTRA_ENV_SETTINGS
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> + "verify=n\0" \
> + "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> + "bootimage=" CONFIG_BOOTFILE "\0" \
> + "fdt_addr=100\0" \
> + "fdtimage=" CONFIG_DEFAULT_FDT_FILE "\0" \
> + "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
> + "bootm ${loadaddr} - ${fdt_addr}\0" \
> + "mmcroot=/dev/mmcblk0p2\0" \
> + "mmcboot=setenv bootargs " CONFIG_BOOTARGS \
> + " root=${mmcroot} rw rootwait;" \
> + "bootz ${loadaddr} - ${fdt_addr}\0" \
> + "mmcload=mmc rescan;" \
> + "load mmc 0:1 ${loadaddr} ${bootimage};" \
> + "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
> + "qspiload=sf probe && mtdparts default && run ubiload\0" \
> + "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> + " ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
> + "bootz ${loadaddr} - ${fdt_addr}\0" \
> + "ubiload=ubi part UBI && ubifsmount ubi0 && " \
> + "ubifsload ${loadaddr} /boot/${bootimage} && " \
> + "ubifsload ${fdt_addr} /boot/${fdtimage}\0"

What is the default bootcmd with this environment? Also, keep in mind
that it's 2017. Is there any good reason not to default to distro boot?

Alex