summaryrefslogtreecommitdiff
path: root/board/engicam/common
diff options
context:
space:
mode:
authorJagan Teki <jagan@amarulasolutions.com>2017-05-07 02:43:15 +0530
committerStefano Babic <sbabic@denx.de>2017-05-18 11:23:31 +0200
commitf9247569d842c0442cf1a6d2a37d447581694ed0 (patch)
tree7ac7bbd521468acb12d9e94ed3c11c4e729e3844 /board/engicam/common
parentac880e774260f5e1988d173d5bf75ea10ee04aeb (diff)
engicam: common: Move board_late_init
Move board_late_init into common area from supported boards. 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/common')
-rw-r--r--board/engicam/common/board.c28
-rw-r--r--board/engicam/common/board.h2
2 files changed, 28 insertions, 2 deletions
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index 8a83608c5b..af4ef28dac 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -15,7 +15,7 @@
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_ENV_IS_IN_MMC
-void mmc_late_init(void)
+static void mmc_late_init(void)
{
char cmd[32];
char mmcblk[32];
@@ -32,6 +32,32 @@ void mmc_late_init(void)
}
#endif
+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:
+#ifdef CONFIG_ENV_IS_IN_MMC
+ mmc_late_init();
+#endif
+ setenv("modeboot", "mmcboot");
+ break;
+ case IMX6_BMODE_NAND:
+ setenv("modeboot", "nandboot");
+ break;
+ default:
+ setenv("modeboot", "");
+ break;
+ }
+
+ setenv_fdt_file();
+
+ return 0;
+}
+
int board_init(void)
{
/* Address of boot parameters */
diff --git a/board/engicam/common/board.h b/board/engicam/common/board.h
index 9717e400c2..f364a23296 100644
--- a/board/engicam/common/board.h
+++ b/board/engicam/common/board.h
@@ -6,7 +6,7 @@
#ifndef _BOARD_H_
#define _BOARD_H_
-void mmc_late_init(void);
+void setenv_fdt_file(void);
void setup_gpmi_nand(void);
void setup_display(void);
#endif /* _BOARD_H_ */