summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
Diffstat (limited to 'env')
-rw-r--r--env/Kconfig7
-rw-r--r--env/eeprom.c18
-rw-r--r--env/mmc.c5
3 files changed, 12 insertions, 18 deletions
diff --git a/env/Kconfig b/env/Kconfig
index c0dff1fd819..f75f2b13536 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -44,10 +44,6 @@ config ENV_IS_IN_EEPROM
still be one byte because the extra address bits are hidden
in the chip address.
- - CONFIG_ENV_EEPROM_IS_ON_I2C
- define this, if you have I2C and SPI activated, and your
- EEPROM, which holds the environment, is on the I2C bus.
-
- CONFIG_I2C_ENV_EEPROM_BUS
if you have an Environment on an EEPROM reached over
I2C muxes, you can define here, how to reach this
@@ -689,7 +685,6 @@ config ENV_FDT_PATH
config ENV_APPEND
bool "Always append the environment with new data"
- default n
help
If defined, the environment hash table is only ever appended with new
data, but the existing hash table can never be dropped and reloaded
@@ -698,7 +693,6 @@ config ENV_APPEND
config ENV_WRITEABLE_LIST
bool "Permit write access only to listed variables"
- default n
help
If defined, only environment variables which explicitly set the 'w'
writeable flag can be written and modified at runtime. No variables
@@ -706,7 +700,6 @@ config ENV_WRITEABLE_LIST
config ENV_ACCESS_IGNORE_FORCE
bool "Block forced environment operations"
- default n
help
If defined, don't allow the -f switch to env set override variable
access flags.
diff --git a/env/eeprom.c b/env/eeprom.c
index ba168014e24..253bdf14284 100644
--- a/env/eeprom.c
+++ b/env/eeprom.c
@@ -76,7 +76,7 @@ int env_eeprom_get_char(int index)
if (gd->env_valid == ENV_REDUND)
off = CONFIG_ENV_OFFSET_REDUND;
#endif
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
off + index + offsetof(env_t, data), &c, 1);
return c;
@@ -100,11 +100,11 @@ static int env_eeprom_load(void)
for (i = 0; i < 2; i++) {
/* read CRC */
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
off_env[i] + offsetof(env_t, crc),
(uchar *)&crc[i], sizeof(ulong));
/* read FLAGS */
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
off_env[i] + offsetof(env_t, flags),
(uchar *)&flags[i], sizeof(uchar));
@@ -114,7 +114,7 @@ static int env_eeprom_load(void)
while (len > 0) {
int n = (len > sizeof(rdbuf)) ? sizeof(rdbuf) : len;
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR, off,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR, off,
rdbuf, n);
crc_tmp = crc32(crc_tmp, rdbuf, n);
@@ -156,7 +156,7 @@ static int env_eeprom_load(void)
eeprom_init(-1); /* prepare for EEPROM read/write */
/* read old CRC */
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
CONFIG_ENV_OFFSET + offsetof(env_t, crc),
(uchar *)&crc, sizeof(ulong));
@@ -166,7 +166,7 @@ static int env_eeprom_load(void)
while (len > 0) {
int n = (len > sizeof(rdbuf)) ? sizeof(rdbuf) : len;
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
CONFIG_ENV_OFFSET + off, rdbuf, n);
new = crc32(new, rdbuf, n);
len -= n;
@@ -186,7 +186,7 @@ static int env_eeprom_load(void)
off = CONFIG_ENV_OFFSET_REDUND;
#endif
- eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR,
off, (uchar *)buf_env, CONFIG_ENV_SIZE);
return env_import(buf_env, 1, H_EXTERNAL);
@@ -215,12 +215,12 @@ static int env_eeprom_save(void)
env_new.flags = ENV_REDUND_ACTIVE;
#endif
- rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,
+ rc = eeprom_bus_write(CONFIG_SYS_I2C_EEPROM_ADDR,
off, (uchar *)&env_new, CONFIG_ENV_SIZE);
#ifdef CONFIG_ENV_OFFSET_REDUND
if (rc == 0) {
- eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,
+ eeprom_bus_write(CONFIG_SYS_I2C_EEPROM_ADDR,
off_red + offsetof(env_t, flags),
(uchar *)&flag_obsolete, 1);
diff --git a/env/mmc.c b/env/mmc.c
index 09e94f0bd3b..c4cb1639914 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -19,6 +19,7 @@
#include <part.h>
#include <search.h>
#include <errno.h>
+#include <dm/ofnode.h>
#define __STR(X) #X
#define STR(X) __STR(X)
@@ -73,7 +74,7 @@ static inline s64 mmc_offset(int copy)
int err;
/* look for the partition in mmc CONFIG_SYS_MMC_ENV_DEV */
- str = fdtdec_get_config_string(gd->fdt_blob, dt_prop.partition);
+ str = ofnode_conf_read_str(dt_prop.partition);
if (str) {
/* try to place the environment at end of the partition */
err = mmc_offset_try_partition(str, copy, &val);
@@ -90,7 +91,7 @@ static inline s64 mmc_offset(int copy)
propname = dt_prop.offset_redund;
}
#endif
- return fdtdec_get_config_int(gd->fdt_blob, propname, defvalue);
+ return ofnode_conf_read_int(propname, defvalue);
}
#else
static inline s64 mmc_offset(int copy)