aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-08-10 18:20:02 -0400
committerTom Rini <trini@konsulko.com>2021-08-10 18:20:02 -0400
commit5546ad726e0a76b92c4126f036e5f80279900488 (patch)
tree79ea80a8797c46b0653b5dbd49f33e2753f11c0b
parentbd3f1a931b41d296089c2ddd86ff890c5fc52861 (diff)
downloadu-boot-TEST/rename-various-CONFIG-options.zip
u-boot-TEST/rename-various-CONFIG-options.tar.gz
u-boot-TEST/rename-various-CONFIG-options.tar.bz2
TEST: No more embedded env?TEST/rename-various-CONFIG-options
Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c2
-rw-r--r--env/Makefile1
-rw-r--r--env/embedded.c4
-rw-r--r--env/flash.c5
-rw-r--r--env/mmc.c4
-rw-r--r--env/nand.c20
-rw-r--r--env/onenand.c10
-rw-r--r--env/remote.c8
-rw-r--r--include/env_internal.h20
-rw-r--r--tools/Makefile1
-rw-r--r--tools/envcrc.c8
11 files changed, 14 insertions, 69 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index f2ddc83..8717ba6 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -1342,7 +1342,6 @@ enum env_location env_get_location(enum env_operation op, int prio)
return env_loc;
}
-#ifndef ENV_IS_EMBEDDED
long long env_get_offset(long long defautl_offset)
{
enum boot_device dev = get_boot_device();
@@ -1357,4 +1356,3 @@ long long env_get_offset(long long defautl_offset)
return defautl_offset;
}
#endif
-#endif
diff --git a/env/Makefile b/env/Makefile
index c4ad654..bb6e24b 100644
--- a/env/Makefile
+++ b/env/Makefile
@@ -11,7 +11,6 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o
ifndef CONFIG_SPL_BUILD
obj-y += callback.o
obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
-extra-$(CONFIG_ENV_IS_EMBEDDED) += embedded.o
obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o
extra-$(CONFIG_ENV_IS_IN_FLASH) += embedded.o
obj-$(CONFIG_ENV_IS_IN_NVRAM) += embedded.o
diff --git a/env/embedded.c b/env/embedded.c
index 208553e..34eb6ad 100644
--- a/env/embedded.c
+++ b/env/embedded.c
@@ -27,7 +27,7 @@
* Generate embedded environment table
* inside U-Boot image, if needed.
*/
-#if defined(ENV_IS_EMBEDDED) || defined(CONFIG_BUILD_ENVCRC)
+#if defined(CONFIG_BUILD_ENVCRC)
/*
* Put the environment in the .text section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
@@ -93,4 +93,4 @@ unsigned long env_size __UBOOT_ENV_SECTION__(env_size) = sizeof(env_t);
*/
GEN_ABS(env_offset, (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE));
-#endif /* ENV_IS_EMBEDDED */
+#endif /* CONFIG_BUILD_ENVCRC */
diff --git a/env/flash.c b/env/flash.c
index ebee906..e67a199 100644
--- a/env/flash.c
+++ b/env/flash.c
@@ -46,12 +46,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_ENV_ADDR_REDUND) && defined(CMD_SAVEENV) || \
!defined(CONFIG_ENV_ADDR_REDUND) && defined(INITENV)
-#ifdef ENV_IS_EMBEDDED
-static env_t *env_ptr = &embedded_environment;
-#else /* ! ENV_IS_EMBEDDED */
-
static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
-#endif /* ENV_IS_EMBEDDED */
#endif
static __maybe_unused env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR;
diff --git a/env/mmc.c b/env/mmc.c
index 09e94f0..813a77f 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -297,7 +297,6 @@ static inline int read_env(struct mmc *mmc, unsigned long size,
#ifdef CONFIG_ENV_OFFSET_REDUND
static int env_mmc_load(void)
{
-#if !defined(ENV_IS_EMBEDDED)
struct mmc *mmc;
u32 offset1, offset2;
int read1_fail = 0, read2_fail = 0;
@@ -336,13 +335,11 @@ err:
if (ret)
env_set_default(errmsg, 0);
-#endif
return ret;
}
#else /* ! CONFIG_ENV_OFFSET_REDUND */
static int env_mmc_load(void)
{
-#if !defined(ENV_IS_EMBEDDED)
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
struct mmc *mmc;
u32 offset;
@@ -381,7 +378,6 @@ fini:
err:
if (ret)
env_set_default(errmsg, 0);
-#endif
return ret;
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
diff --git a/env/nand.c b/env/nand.c
index be82e97..43ea8f1 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -37,11 +37,9 @@
#define CONFIG_ENV_RANGE CONFIG_ENV_SIZE
#endif
-#if defined(ENV_IS_EMBEDDED)
-static env_t *env_ptr = &environment;
-#elif defined(CONFIG_NAND_ENV_DST)
+#if defined(CONFIG_NAND_ENV_DST)
static env_t *env_ptr = (env_t *)CONFIG_NAND_ENV_DST;
-#endif /* ENV_IS_EMBEDDED */
+#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -59,7 +57,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
static int env_nand_init(void)
{
-#if defined(ENV_IS_EMBEDDED) || defined(CONFIG_NAND_ENV_DST)
+#if defined(CONFIG_NAND_ENV_DST)
int crc1_ok = 0, crc2_ok = 0;
env_t *tmp_env1;
@@ -106,10 +104,10 @@ static int env_nand_init(void)
gd->env_addr = (ulong)env_ptr->data;
-#else /* ENV_IS_EMBEDDED || CONFIG_NAND_ENV_DST */
+#else /* CONFIG_NAND_ENV_DST */
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = ENV_VALID;
-#endif /* ENV_IS_EMBEDDED || CONFIG_NAND_ENV_DST */
+#endif /* CONFIG_NAND_ENV_DST */
return 0;
}
@@ -312,9 +310,6 @@ int get_nand_env_oob(struct mtd_info *mtd, unsigned long *result)
#ifdef CONFIG_ENV_OFFSET_REDUND
static int env_nand_load(void)
{
-#if defined(ENV_IS_EMBEDDED)
- return 0;
-#else
int read1_fail, read2_fail;
env_t *tmp_env1, *tmp_env2;
int ret = 0;
@@ -339,7 +334,6 @@ done:
free(tmp_env2);
return ret;
-#endif /* ! ENV_IS_EMBEDDED */
}
#else /* ! CONFIG_ENV_OFFSET_REDUND */
/*
@@ -349,7 +343,6 @@ done:
*/
static int env_nand_load(void)
{
-#if !defined(ENV_IS_EMBEDDED)
int ret;
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
@@ -374,9 +367,6 @@ static int env_nand_load(void)
}
return env_import(buf, 1, H_EXTERNAL);
-#endif /* ! ENV_IS_EMBEDDED */
-
- return 0;
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
diff --git a/env/onenand.c b/env/onenand.c
index c8da3ff..85b657b 100644
--- a/env/onenand.c
+++ b/env/onenand.c
@@ -34,19 +34,14 @@ static int env_onenand_load(void)
#endif
int rc;
size_t retlen;
-#ifdef ENV_IS_EMBEDDED
- char *buf = (char *)&environment;
-#else
loff_t env_addr = CONFIG_ENV_ADDR;
char onenand_env[ONENAND_MAX_ENV_SIZE];
char *buf = (char *)&onenand_env[0];
-#endif /* ENV_IS_EMBEDDED */
-#ifndef ENV_IS_EMBEDDED
-# ifdef CONFIG_ENV_ADDR_FLEX
+#ifdef CONFIG_ENV_ADDR_FLEX
if (FLEXONENAND(this))
env_addr = CONFIG_ENV_ADDR_FLEX;
-# endif
+#endif
/* Check OneNAND exist */
if (mtd->writesize)
/* Ignore read fail */
@@ -54,7 +49,6 @@ static int env_onenand_load(void)
&retlen, (u_char *)buf);
else
mtd->writesize = MAX_ONENAND_PAGESIZE;
-#endif /* !ENV_IS_EMBEDDED */
rc = env_import(buf, 1, H_EXTERNAL);
if (!rc)
diff --git a/env/remote.c b/env/remote.c
index 166bebf..2a609d4 100644
--- a/env/remote.c
+++ b/env/remote.c
@@ -12,11 +12,7 @@
#include <linux/stddef.h>
#include <u-boot/crc.h>
-#ifdef ENV_IS_EMBEDDED
-static env_t *env_ptr = &environment;
-#else /* ! ENV_IS_EMBEDDED */
static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
-#endif /* ENV_IS_EMBEDDED */
DECLARE_GLOBAL_DATA_PTR;
@@ -45,11 +41,7 @@ static int env_remote_save(void)
static int env_remote_load(void)
{
-#ifndef ENV_IS_EMBEDDED
return env_import((char *)env_ptr, 1, H_EXTERNAL);
-#endif
-
- return 0;
}
U_BOOT_ENV_LOCATION(remote) = {
diff --git a/include/env_internal.h b/include/env_internal.h
index b7bddcb..246a70e 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -34,16 +34,12 @@
((CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
(CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SIZE) <= \
(CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED
+#error "Embedded environment shouldn't have happened"
# endif
# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
(CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= \
(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"
+#error "Embedded environment shouldn't have happened"
# endif
#endif /* CONFIG_ENV_IS_IN_FLASH */
@@ -63,15 +59,13 @@ extern unsigned long nand_env_oob_offset;
* calculated automatically (i.e. NAND), take the board opt-in.
*/
#if defined(CONFIG_ENV_IS_EMBEDDED) && !defined(ENV_IS_EMBEDDED)
-# define ENV_IS_EMBEDDED
+#error "Embedded environment shouldn't have happened"
#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
+#error "Embedded environment shouldn't have happened"
# endif
#endif
@@ -90,7 +84,7 @@ extern unsigned long nand_env_oob_offset;
* region.
*/
#if defined(CONFIG_ENV_IS_EMBEDDED)
-#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
+#error "Embedded environment shouldn't have happened"
#elif (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE < CONFIG_SYS_MONITOR_BASE) || \
(CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) || \
defined(CONFIG_ENV_IS_IN_NVRAM)
@@ -107,10 +101,6 @@ typedef struct environment_s {
unsigned char data[ENV_SIZE]; /* Environment data */
} env_t;
-#ifdef ENV_IS_EMBEDDED
-extern env_t embedded_environment;
-#endif /* ENV_IS_EMBEDDED */
-
#ifdef DEFAULT_ENV_IS_RW
extern unsigned char default_environment[];
#else
diff --git a/tools/Makefile b/tools/Makefile
index 4a86321..b576e48 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -37,7 +37,6 @@ endif
subdir-$(HOST_TOOLS_ALL) += gdb
# Merge all the different vars for envcrc into one
-ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
diff --git a/tools/envcrc.c b/tools/envcrc.c
index bce7790..2d4d523 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -34,16 +34,8 @@
# ifndef CONFIG_ENV_SIZE
# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
# endif
-# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
- ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED
-# endif
#endif /* CONFIG_ENV_IS_IN_FLASH */
-#if defined(ENV_IS_EMBEDDED) && !defined(CONFIG_BUILD_ENVCRC)
-# define CONFIG_BUILD_ENVCRC
-#endif
-
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
# define ENV_HEADER_SIZE (sizeof(uint32_t) + 1)
#else