summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorEduard Strehlau <eduard@lionizers.com>2023-04-26 13:04:57 -0300
committerStefano Babic <sbabic@denx.de>2023-05-02 10:57:32 +0200
commita1bc4f1937a04e70f45f3ac87aee0f168b5e7bef (patch)
tree4bd64605f38774b4308eda1300febe9063e40ab5 /board
parentf3ce9db85a326468b71e23adb361f3fed679f2f4 (diff)
downloadu-boot-a1bc4f1937a04e70f45f3ac87aee0f168b5e7bef.tar.gz
smegw01: Add lockdown U-Boot env support
Add lockdown U-Boot env support so that only certain U-Boot environment variables are allowed to be modified. Signed-off-by: Eduard Strehlau <eduard@lionizers.com> Signed-off-by: Fabio Estevam <festevam@denx.de>
Diffstat (limited to 'board')
-rw-r--r--board/storopack/smegw01/Kconfig7
-rw-r--r--board/storopack/smegw01/smegw01.c17
2 files changed, 24 insertions, 0 deletions
diff --git a/board/storopack/smegw01/Kconfig b/board/storopack/smegw01/Kconfig
index d8f24695d0..390214c285 100644
--- a/board/storopack/smegw01/Kconfig
+++ b/board/storopack/smegw01/Kconfig
@@ -12,4 +12,11 @@ config SYS_CONFIG_NAME
config IMX_CONFIG
default "board/storopack/smegw01/imximage.cfg"
+config SYS_BOOT_LOCKED
+ bool "Lock boot process to EMMC"
+ default y
+ help
+ Say N here if you want to boot from eMMC and SD.
+ Say Y to boot from eMMC.
+
endif
diff --git a/board/storopack/smegw01/smegw01.c b/board/storopack/smegw01/smegw01.c
index 7d4de9326d..e648b196b9 100644
--- a/board/storopack/smegw01/smegw01.c
+++ b/board/storopack/smegw01/smegw01.c
@@ -14,6 +14,7 @@
#include <asm/io.h>
#include <common.h>
#include <env.h>
+#include <env_internal.h>
#include <asm/arch/crm_regs.h>
#include <asm/setup.h>
#include <asm/bootm.h>
@@ -103,3 +104,19 @@ uint board_mmc_get_env_part(struct mmc *mmc)
part = 0;
return part;
}
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+ if (op == ENVOP_SAVE || op == ENVOP_ERASE)
+ return ENVL_MMC;
+
+ switch (prio) {
+ case 0:
+ return ENVL_NOWHERE;
+
+ case 1:
+ return ENVL_MMC;
+ }
+
+ return ENVL_UNKNOWN;
+}