summaryrefslogtreecommitdiff
path: root/board/engicam
diff options
context:
space:
mode:
authorJagan Teki <jagan@amarulasolutions.com>2017-02-24 15:45:24 +0530
committerStefano Babic <sbabic@denx.de>2017-03-17 09:27:08 +0100
commit8c998a85a3df9cabf9701835b82ccbbfcdf9ee36 (patch)
tree76ed1a123a57629f9e8166db54b1578df89aaa88 /board/engicam
parentffa11c33811b610a6ad2b029debc1159a52805de (diff)
i.MX6Q: icorem6_rqs: Add modeboot env via board_late_init
Add runtime, modeboot env which is setting mmcboot based on the bootdevice so-that conditional macros for MMC via CONFIG_BOOTCOMMAND should be avoided in config files. Cc: Stefano Babic <sbabic@denx.de> Cc: Matteo Lisi <matteo.lisi@engicam.com> Cc: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'board/engicam')
-rw-r--r--board/engicam/icorem6_rqs/icorem6_rqs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c
index 175bda5860..cc7f897f63 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -45,6 +45,24 @@ int board_init(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:
+ case IMX6_BMODE_MMC:
+ case IMX6_BMODE_EMMC:
+ setenv("modeboot", "mmcboot");
+ break;
+ default:
+ setenv("modeboot", "");
+ break;
+ }
+
+ return 0;
+}
+
int dram_init(void)
{
gd->ram_size = imx_ddr_size();