diff options
author | Jagan Teki <jagan@amarulasolutions.com> | 2017-05-07 02:43:00 +0530 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2017-05-18 11:23:31 +0200 |
commit | 98f5661033a250b6333460cf1d2bb628c8d66e3d (patch) | |
tree | cecb1d7321a168300e7fcd2029dbbe6258a62b08 /board/engicam | |
parent | 354fa867103bb22a36371a90664a072c9aa71db7 (diff) |
icorem6: Add modeboot env via board_late_init
Add runtime, modeboot env which is setting mmcboot, or
nandboot based on the bootdevice so-that conditional
macros b/w MMC and NAND for CONFIG_BOOTCOMMAND should
be avoided in config files.
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'board/engicam')
-rw-r--r-- | board/engicam/icorem6/icorem6.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c index 171ec451a1..f78f8c9da5 100644 --- a/board/engicam/icorem6/icorem6.c +++ b/board/engicam/icorem6/icorem6.c @@ -205,6 +205,25 @@ int board_early_init_f(void) return 0; } +int board_late_init(void) +{ + switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >> + IMX6_BMODE_SHIFT) { + case IMX6_BMODE_SD: + case IMX6_BMODE_ESD: + setenv("modeboot", "mmcboot"); + break; + case IMX6_BMODE_NAND: + setenv("modeboot", "nandboot"); + break; + default: + setenv("modeboot", ""); + break; + } + + return 0; +} + int board_init(void) { /* Address of boot parameters */ |