summaryrefslogtreecommitdiff
path: root/board/engicam
diff options
context:
space:
mode:
authorJagan Teki <jagan@amarulasolutions.com>2017-02-24 15:45:18 +0530
committerStefano Babic <sbabic@denx.de>2017-03-17 09:27:08 +0100
commit2e2a8dc635f5ca3be9d96759a905ede73f1baf33 (patch)
treeb56af27285a8cf083212937a1845b8fdc556432e /board/engicam
parent7cf22dc8d87285ba4f82f8a0a9d7b0c33c1b9d74 (diff)
i.MX6UL: isiot: 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> Reviewed by: Stefano Babic <sbabic@denx.de> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'board/engicam')
-rw-r--r--board/engicam/isiotmx6ul/isiotmx6ul.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c b/board/engicam/isiotmx6ul/isiotmx6ul.c
index 9cde4fc8f2..0e607e0da0 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -103,6 +103,27 @@ 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:
+ case IMX6_BMODE_MMC:
+ case IMX6_BMODE_EMMC:
+ 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 */