"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.nortm...@web.de>
---

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

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
-- 
2.7.3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to