summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-12-02 16:42:17 -0500
committerTom Rini <[email protected]>2022-12-22 10:31:47 -0500
commit6bd2372094ab4827547ec0d3e5a258b72810cafd (patch)
tree876ffd8e8541f085ed5945b3afa40b4c911bf466 /include
parent2440b5bb523b004af43a1090e1a4134231702416 (diff)
env: Rework ENV_IS_EMBEDDED and related logic slightly
- Drop CONFIG_BUILD_ENVCRC as this is never set directly but instead means ENV_IS_EMBEDDED, so reference that in code and rename the Makefile usage to BUILD_ENVCRC. - Remove extra-$(CONFIG_ENV_IS_EMBEDDED) line as it could never be true, and likely why there is an extra- line for CONFIG_ENV_IS_IN_FLASH (the only use case today of embedded environments). - With these slight changes we can then see that using the calculated symbol of ENV_IS_EMBEDDED is the right thing to use in any code which needs to know this situation and can remove CONFIG_ENV_IS_EMBEDDED entirely. Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/env_internal.h23
1 files changed, 1 insertions, 22 deletions
diff --git a/include/env_internal.h b/include/env_internal.h
index f30fd6159d8..aee6b3e48fa 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -41,10 +41,6 @@
(CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
# define ENV_IS_EMBEDDED
# endif
-# ifdef CONFIG_ENV_IS_EMBEDDED
-# error "do not define CONFIG_ENV_IS_EMBEDDED in your board config"
-# error "it is calculated automatically for you"
-# endif
#endif /* CONFIG_ENV_IS_IN_FLASH */
#if defined(CONFIG_ENV_IS_IN_NAND)
@@ -57,23 +53,6 @@ extern unsigned long nand_env_oob_offset;
# endif /* CONFIG_ENV_OFFSET_OOB */
#endif /* CONFIG_ENV_IS_IN_NAND */
-/*
- * For the flash types where embedded env is supported, but it cannot be
- * calculated automatically (i.e. NAND), take the board opt-in.
- */
-#if defined(CONFIG_ENV_IS_EMBEDDED) && !defined(ENV_IS_EMBEDDED)
-# define ENV_IS_EMBEDDED
-#endif
-
-/* The build system likes to know if the env is embedded */
-#ifdef DO_DEPS_ONLY
-# ifdef ENV_IS_EMBEDDED
-# ifndef CONFIG_ENV_IS_EMBEDDED
-# define CONFIG_ENV_IS_EMBEDDED
-# endif
-# endif
-#endif
-
#include "compiler.h"
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
@@ -88,7 +67,7 @@ extern unsigned long nand_env_oob_offset;
* If the environment is in RAM, allocate extra space for it in the malloc
* region.
*/
-#if defined(CONFIG_ENV_IS_EMBEDDED)
+#if defined(ENV_IS_EMBEDDED)
#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
#elif (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE < CONFIG_SYS_MONITOR_BASE) || \
(CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) || \