ARM: imx: cm_fx6: env: support distro boot command
The current default environment of the cm_fx6 is not suitable for booting modern distributions. Instead of extending the custom environment, let's use the distro boot command, which has been developed for precisely this use case. If the distro boot command fails, fall back to the old behavior (except for USB drives where the old behaviour is completely covered by the distro boot command). That way it is still possible to create "rescue SD cards" for old installations (e.g. if one messes up the on-flash environment). Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
This commit is contained in:
committed by
Stefano Babic
parent
6b79f71c8e
commit
3ef5f6714a
@@ -12,9 +12,11 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
|
|||||||
# CONFIG_CMD_BMODE is not set
|
# CONFIG_CMD_BMODE is not set
|
||||||
CONFIG_DEFAULT_DEVICE_TREE="imx6q-cm-fx6"
|
CONFIG_DEFAULT_DEVICE_TREE="imx6q-cm-fx6"
|
||||||
CONFIG_AHCI=y
|
CONFIG_AHCI=y
|
||||||
|
CONFIG_DISTRO_DEFAULTS=y
|
||||||
CONFIG_OF_BOARD_SETUP=y
|
CONFIG_OF_BOARD_SETUP=y
|
||||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
|
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
|
||||||
CONFIG_BOOTDELAY=3
|
CONFIG_BOOTDELAY=3
|
||||||
|
CONFIG_BOOTCOMMAND="run distro_bootcmd; run legacy_bootcmd"
|
||||||
CONFIG_SPL=y
|
CONFIG_SPL=y
|
||||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80
|
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80
|
||||||
CONFIG_SPL_I2C_SUPPORT=y
|
CONFIG_SPL_I2C_SUPPORT=y
|
||||||
|
|||||||
@@ -13,6 +13,10 @@
|
|||||||
|
|
||||||
#include "mx6_common.h"
|
#include "mx6_common.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
#include <config_distro_defaults.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Machine config */
|
/* Machine config */
|
||||||
#define CONFIG_SYS_LITTLE_ENDIAN
|
#define CONFIG_SYS_LITTLE_ENDIAN
|
||||||
#define CONFIG_MACH_TYPE 4273
|
#define CONFIG_MACH_TYPE 4273
|
||||||
@@ -62,6 +66,7 @@
|
|||||||
#define CONFIG_ENV_SIZE (8 * 1024)
|
#define CONFIG_ENV_SIZE (8 * 1024)
|
||||||
#define CONFIG_ENV_OFFSET (768 * 1024)
|
#define CONFIG_ENV_OFFSET (768 * 1024)
|
||||||
|
|
||||||
|
#ifndef CONFIG_SPL_BUILD
|
||||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||||
"fdt_high=0xffffffff\0" \
|
"fdt_high=0xffffffff\0" \
|
||||||
"initrd_high=0xffffffff\0" \
|
"initrd_high=0xffffffff\0" \
|
||||||
@@ -126,7 +131,6 @@
|
|||||||
"setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
|
"setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
|
||||||
"setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \
|
"setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \
|
||||||
"setupnandboot=setenv storagetype nand;\0" \
|
"setupnandboot=setenv storagetype nand;\0" \
|
||||||
"setupusbboot=setenv storagetype usb; setenv storagedev 0;\0" \
|
|
||||||
"storagebootcmd=echo Booting from ${storagetype} ...;" \
|
"storagebootcmd=echo Booting from ${storagetype} ...;" \
|
||||||
"run ${storagetype}args; run doboot;\0" \
|
"run ${storagetype}args; run doboot;\0" \
|
||||||
"trybootk=if run loadkernel; then " \
|
"trybootk=if run loadkernel; then " \
|
||||||
@@ -141,29 +145,33 @@
|
|||||||
"run setboottypem;" \
|
"run setboottypem;" \
|
||||||
"run trybootk;" \
|
"run trybootk;" \
|
||||||
"run setboottypez;" \
|
"run setboottypez;" \
|
||||||
"run trybootk;\0"
|
"run trybootk;\0" \
|
||||||
|
"legacy_bootcmd=" \
|
||||||
#define CONFIG_BOOTCOMMAND \
|
"run setupmmcboot;" \
|
||||||
"run setupmmcboot;" \
|
"mmc dev ${storagedev};" \
|
||||||
"mmc dev ${storagedev};" \
|
"if mmc rescan; then " \
|
||||||
"if mmc rescan; then " \
|
"run trybootsmz;" \
|
||||||
"run trybootsmz;" \
|
|
||||||
"fi;" \
|
|
||||||
"run setupusbboot;" \
|
|
||||||
"if usb start; then "\
|
|
||||||
"if run loadscript; then " \
|
|
||||||
"run bootscript;" \
|
|
||||||
"fi;" \
|
"fi;" \
|
||||||
"fi;" \
|
"run setupsataboot;" \
|
||||||
"run setupsataboot;" \
|
"if sata init; then " \
|
||||||
"if sata init; then " \
|
"run trybootsmz;" \
|
||||||
"run trybootsmz;" \
|
"fi;" \
|
||||||
"fi;" \
|
"run setupnandboot;" \
|
||||||
"run setupnandboot;" \
|
"run nandboot;\0" \
|
||||||
"run nandboot;"
|
BOOTENV
|
||||||
|
|
||||||
#define CONFIG_PREBOOT "usb start;sf probe"
|
#define CONFIG_PREBOOT "usb start;sf probe"
|
||||||
|
|
||||||
|
#define BOOT_TARGET_DEVICES(func) \
|
||||||
|
func(USB, usb, 0) \
|
||||||
|
func(MMC, mmc, 2) \
|
||||||
|
func(SATA, sata, 0)
|
||||||
|
|
||||||
|
#include <config_distro_bootcmd.h>
|
||||||
|
#else
|
||||||
|
#define CONFIG_EXTRA_ENV_SETTINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
/* SPI */
|
/* SPI */
|
||||||
#define CONFIG_SPI
|
#define CONFIG_SPI
|
||||||
#define CONFIG_MXC_SPI
|
#define CONFIG_MXC_SPI
|
||||||
|
|||||||
Reference in New Issue
Block a user