[U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE

Bo Shen voice.shen at gmail.com
Sun Aug 11 16:15:03 CEST 2013


when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define
CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid
compile error if not define CONFIG_ENV_SIZE

Signed-off-by: Bo Shen <voice.shen at gmail.com>

---
The default value for CONFIG_ENV_SIZE (1024 Bytes) maybe not the
better choice, consider runtime decided, however failed.

This patch is only compile testing with CONFIG_ENV_IS_NOWHERE enable
---

 include/environment.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/environment.h b/include/environment.h
index 46a3554..52a7769 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -146,6 +146,12 @@ extern unsigned long nand_env_oob_offset;
 extern char *env_name_spec;
 #endif
 
+#ifdef CONFIG_ENV_IS_NOWHERE
+# ifndef CONFIG_ENV_SIZE
+# define CONFIG_ENV_SIZE 0x400
+# endif
+#endif
+
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
 
 typedef struct environment_s {
-- 
1.7.10.4



More information about the U-Boot mailing list