diff mbox

[U-Boot,RFC,5/7] sunxi: env: flag fel_* environment vars as "system"

Message ID 1468260895-14624-6-git-send-email-bernhard.nortmann@web.de
State RFC
Delegated to: Joe Hershberger
Headers show

Commit Message

Bernhard Nortmann July 11, 2016, 6:14 p.m. UTC
"fel_booted" and "fel_scriptaddr" have a special meaning and get
used by U-Boot internally.

This patch aims at both preventing user modification of these
values, and at excluding them from being stored on "saveenv".

As this is achieved by setting specialized access flags,
also enable the "env flags" command.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
---

 include/configs/sunxi-common.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 94275a7..1b48cf2 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -433,6 +433,14 @@  extern int soft_i2c_gpio_scl;
 	"fdt ram " FDT_ADDR_R " 0x100000;" \
 	"ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
 
+/*
+ * flag environment vars for FEL mode ("usb boot") as special. "system" access
+ * means they're marked read-only, and shouldn't be written on "saveenv".
+ */
+#define CONFIG_ENV_FLAGS_LIST_STATIC "fel_booted:bS,fel_scriptaddr:xS"
+/* support "env flags" command */
+#define CONFIG_CMD_ENV_FLAGS
+
 #ifdef CONFIG_MMC
 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
 #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1