summaryrefslogtreecommitdiff
path: root/board/toradex
diff options
context:
space:
mode:
Diffstat (limited to 'board/toradex')
-rw-r--r--board/toradex/common/common-imx.c20
-rw-r--r--board/toradex/common/common.mk3
2 files changed, 23 insertions, 0 deletions
diff --git a/board/toradex/common/common-imx.c b/board/toradex/common/common-imx.c
new file mode 100644
index 0000000000..0fa3402eed
--- /dev/null
+++ b/board/toradex/common/common-imx.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016 Toradex, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/arch/imx-regs.h>
+#include <asm/io.h>
+#include <common.h>
+
+int should_load_env(void)
+{
+ /* Do not load environment from eMMC/NAND, it could be hostile */
+ if (is_boot_from_usb()) {
+ puts("Serial Downloader mode, not loading environment\n");
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/board/toradex/common/common.mk b/board/toradex/common/common.mk
index 469189a315..2679dea169 100644
--- a/board/toradex/common/common.mk
+++ b/board/toradex/common/common.mk
@@ -5,4 +5,7 @@ obj- := __dummy__.o
else
obj-$(CONFIG_TRDX_CFG_BLOCK) += ../common/configblock.o
obj-y += ../common/common.o
+ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
+obj-y += ../common/common-imx.o
+endif
endif