summaryrefslogtreecommitdiff
path: root/include/env_flags.h
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:37 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:57 -0700
commit1d6cd0a3f69b549a3fc7e735a045279e7a14947e (patch)
tree4abb7a50269c09b33e599f291bf6295b863e28e0 /include/env_flags.h
parent9d8d661d7fda6ccda1d5fc31565f207b7648bc6d (diff)
env: Handle write-once ethaddr and serial# generically
Use the variable access flags to implement the protection for ethaddr and serial# instead of hard-coding them. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/env_flags.h')
-rw-r--r--include/env_flags.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/env_flags.h b/include/env_flags.h
index 0bdae07838..d1aa1440f7 100644
--- a/include/env_flags.h
+++ b/include/env_flags.h
@@ -53,7 +53,29 @@ enum env_flags_varaccess {
#define CONFIG_ENV_FLAGS_LIST_STATIC ""
#endif
+#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_ENV_OVERWRITE
+#define ETHADDR_FLAGS "ethaddr:ma,"
+#else
+#ifdef CONFIG_OVERWRITE_ETHADDR_ONCE
+#define ETHADDR_FLAGS "ethaddr:mc,"
+#else
+#define ETHADDR_FLAGS "ethaddr:mo,"
+#endif
+#endif
+#else
+#define ETHADDR_FLAGS ""
+#endif
+
+#ifndef CONFIG_ENV_OVERWRITE
+#define SERIAL_FLAGS "serial#:so,"
+#else
+#define SERIAL_FLAGS ""
+#endif
+
#define ENV_FLAGS_LIST_STATIC \
+ ETHADDR_FLAGS \
+ SERIAL_FLAGS \
CONFIG_ENV_FLAGS_LIST_STATIC
#ifdef CONFIG_CMD_ENV_FLAGS