[PoC 057/241] global: Migrate CONFIG_I2C_ENV_EEPROM_BUS to CFG

Tom Rini
2022-11-20T13:43:35Z

env/Kconfig | 4 ++--
env/eeprom.c | 18 +++++++++---------
scripts/config_whitelist.txt | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/env/Kconfig b/env/Kconfig
index 5a7e2f299b06..1c7a414321ce 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -78,12 +78,12 @@ config ENV_IS_IN_EEPROM
still be one byte because the extra address bits are hidden
in the chip address.

- - CONFIG_I2C_ENV_EEPROM_BUS
+ - CFG_I2C_ENV_EEPROM_BUS
if you have an Environment on an EEPROM reached over
I2C muxes, you can define here, how to reach this
EEPROM. For example:

- #define CONFIG_I2C_ENV_EEPROM_BUS 1
+ #define CFG_I2C_ENV_EEPROM_BUS 1

EEPROM which holds the environment, is reached over
a pca9547 i2c mux with address 0x70, channel 3.
diff --git a/env/eeprom.c b/env/eeprom.c
index f8556a47213c..192e0f3af6d0 100644
--- a/env/eeprom.c
+++ b/env/eeprom.c
@@ -15,7 +15,7 @@
#include <asm/global_data.h>
#include <linux/stddef.h>
#include <u-boot/crc.h>
-#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
+#if defined(CFG_I2C_ENV_EEPROM_BUS)
#include <i2c.h>
#endif
#include <search.h>
@@ -28,16 +28,16 @@ static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
uchar *buffer, unsigned cnt)
{
int rcode;
-#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
+#if defined(CFG_I2C_ENV_EEPROM_BUS)
int old_bus = i2c_get_bus_num();

- if (old_bus != CONFIG_I2C_ENV_EEPROM_BUS)
- i2c_set_bus_num(CONFIG_I2C_ENV_EEPROM_BUS);
+ if (old_bus != CFG_I2C_ENV_EEPROM_BUS)
+ i2c_set_bus_num(CFG_I2C_ENV_EEPROM_BUS);
#endif

rcode = eeprom_read(dev_addr, offset, buffer, cnt);

-#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
+#if defined(CFG_I2C_ENV_EEPROM_BUS)
i2c_set_bus_num(old_bus);
#endif

@@ -48,16 +48,16 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset,
uchar *buffer, unsigned cnt)
{
int rcode;
-#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
+#if defined(CFG_I2C_ENV_EEPROM_BUS)
int old_bus = i2c_get_bus_num();

- if (old_bus != CONFIG_I2C_ENV_EEPROM_BUS)
- i2c_set_bus_num(CONFIG_I2C_ENV_EEPROM_BUS);
+ if (old_bus != CFG_I2C_ENV_EEPROM_BUS)
+ i2c_set_bus_num(CFG_I2C_ENV_EEPROM_BUS);
#endif

rcode = eeprom_write(dev_addr, offset, buffer, cnt);

-#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
+#if defined(CFG_I2C_ENV_EEPROM_BUS)
i2c_set_bus_num(old_bus);
#endif

diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 44956bff3940..440bef90575d 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -57,7 +57,7 @@ CFG_HDMI_ENCODER_I2C_ADDR
CFG_HOSTNAME
CFG_HSMMC2_8BIT
CFG_HW_ENV_SETTINGS
-CONFIG_I2C_ENV_EEPROM_BUS
+CFG_I2C_ENV_EEPROM_BUS
CONFIG_I2C_MULTI_BUS
CONFIG_I2C_MVTWSI
CONFIG_I2C_MVTWSI_BASE0
--
2.25.1