From 9786496cdc6fd6c31a16f2b8e8d7570c01e69de5 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Sun, 7 May 2017 02:43:02 +0530 Subject: geam6ul: 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 Cc: Michael Trimarchi Cc: Stefano Babic Signed-off-by: Jagan Teki --- board/engicam/geam6ul/geam6ul.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'board') diff --git a/board/engicam/geam6ul/geam6ul.c b/board/engicam/geam6ul/geam6ul.c index 40f20a9bec2..29a4830c6a9 100644 --- a/board/engicam/geam6ul/geam6ul.c +++ b/board/engicam/geam6ul/geam6ul.c @@ -103,6 +103,25 @@ static void setup_gpmi_nand(void) } #endif /* CONFIG_NAND_MXS */ +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 */ -- cgit v1.2.3