summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-01-10 11:19:30 -0500
committerTom Rini <trini@konsulko.com>2023-01-20 12:27:06 -0500
commit81451a3985a7ca9f2bc871a14d8aff8aa86db9ba (patch)
tree053319db5c4ce7d77a45931458eaeab8c1e24dbd /drivers/i2c
parent409163a46e161e906fcc2c3963dec45166a81460 (diff)
downloadu-boot-81451a3985a7ca9f2bc871a14d8aff8aa86db9ba.tar.gz
u-boot-81451a3985a7ca9f2bc871a14d8aff8aa86db9ba.tar.bz2
u-boot-81451a3985a7ca9f2bc871a14d8aff8aa86db9ba.zip
i2c: fsl_i2c: Rework usage of CONFIG_SYS_IMMR
This driver is used on both m68k, where CONFIG_SYS_IMMR is not used, and PowerPC an ARM where it is. Abstract this to a new value rather than re-defining a CONFIG symbol on m68k. Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/fsl_i2c.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 187db92b75..147a4b91f0 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -41,20 +41,22 @@
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_M68K
-#define CONFIG_SYS_IMMR CFG_SYS_MBAR
+#define CFG_FSL_I2C_BASE_ADDR CFG_SYS_MBAR
+#else
+#define CFG_FSL_I2C_BASE_ADDR CONFIG_SYS_IMMR
#endif
#if !CONFIG_IS_ENABLED(DM_I2C)
static const struct fsl_i2c_base *i2c_base[4] = {
- (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C_OFFSET),
+ (struct fsl_i2c_base *)(CFG_FSL_I2C_BASE_ADDR + CONFIG_SYS_FSL_I2C_OFFSET),
#ifdef CONFIG_SYS_FSL_I2C2_OFFSET
- (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C2_OFFSET),
+ (struct fsl_i2c_base *)(CFG_FSL_I2C_BASE_ADDR + CONFIG_SYS_FSL_I2C2_OFFSET),
#endif
#ifdef CONFIG_SYS_FSL_I2C3_OFFSET
- (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C3_OFFSET),
+ (struct fsl_i2c_base *)(CFG_FSL_I2C_BASE_ADDR + CONFIG_SYS_FSL_I2C3_OFFSET),
#endif
#ifdef CONFIG_SYS_FSL_I2C4_OFFSET
- (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C4_OFFSET)
+ (struct fsl_i2c_base *)(CFG_FSL_I2C_BASE_ADDR + CONFIG_SYS_FSL_I2C4_OFFSET)
#endif
};
#endif