aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJagan Teki2017-05-07 02:43:02 +0530
committerStefano Babic2017-05-18 11:23:31 +0200
commit9786496cdc6fd6c31a16f2b8e8d7570c01e69de5 (patch)
tree6f2a901cdc20121ad7d7fad3da6071f974af66b7 /board
parent4bbd40596b52203158333cfcd56f64f92b04a7f3 (diff)
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 <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')
-rw-r--r--board/engicam/geam6ul/geam6ul.c19
1 files changed, 19 insertions, 0 deletions
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 */