mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-28 23:23:30 +08:00
i2c: Remove CONFIG_I2C_MULTI_BUS
This functionality is part of the legacy I2C subsystem and is currently unused anywhere. Remove the remaining references. Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
495fc3e836
commit
1353b25ec5
10
README
10
README
@ -984,21 +984,13 @@ The following options need to be configured:
|
||||
CFG_SYS_I2C_NOPROBES
|
||||
|
||||
This option specifies a list of I2C devices that will be skipped
|
||||
when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS
|
||||
is set, specify a list of bus-device pairs. Otherwise, specify
|
||||
a 1D array of device addresses
|
||||
when the 'i2c probe' command is issued.
|
||||
|
||||
e.g.
|
||||
#undef CONFIG_I2C_MULTI_BUS
|
||||
#define CFG_SYS_I2C_NOPROBES {0x50,0x68}
|
||||
|
||||
will skip addresses 0x50 and 0x68 on a board with one I2C bus
|
||||
|
||||
#define CONFIG_I2C_MULTI_BUS
|
||||
#define CFG_SYS_I2C_NOPROBES {{0,0x50},{0,0x68},{1,0x54}}
|
||||
|
||||
will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on bus 1
|
||||
|
||||
CFG_SYS_RTC_BUS_NUM
|
||||
|
||||
If defined, then this indicates the I2C bus number for the RTC.
|
||||
|
15
cmd/i2c.c
15
cmd/i2c.c
@ -98,7 +98,7 @@ static uint i2c_mm_last_alen;
|
||||
* pairs. The following macros take care of this */
|
||||
|
||||
#if defined(CFG_SYS_I2C_NOPROBES)
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CONFIG_I2C_MULTI_BUS)
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
|
||||
static struct
|
||||
{
|
||||
uchar bus;
|
||||
@ -1764,8 +1764,7 @@ static int do_i2c_show_bus(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
|
||||
* on error.
|
||||
*/
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CONFIG_I2C_MULTI_BUS) || \
|
||||
CONFIG_IS_ENABLED(DM_I2C)
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || CONFIG_IS_ENABLED(DM_I2C)
|
||||
static int do_i2c_bus_num(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
@ -1915,10 +1914,9 @@ static struct cmd_tbl cmd_i2c_sub[] = {
|
||||
U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""),
|
||||
#endif
|
||||
U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""),
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || \
|
||||
defined(CONFIG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C)
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || CONFIG_IS_ENABLED(DM_I2C)
|
||||
U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""),
|
||||
#endif /* CONFIG_I2C_MULTI_BUS */
|
||||
#endif
|
||||
#if defined(CONFIG_I2C_EDID)
|
||||
U_BOOT_CMD_MKENT(edid, 1, 1, do_edid, "", ""),
|
||||
#endif /* CONFIG_I2C_EDID */
|
||||
@ -1992,10 +1990,9 @@ static char i2c_help_text[] =
|
||||
"i2c " /* That's the prefix for the crc32 command below. */
|
||||
#endif
|
||||
"crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || \
|
||||
defined(CONFIG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C)
|
||||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || CONFIG_IS_ENABLED(DM_I2C)
|
||||
"i2c dev [dev] - show or set current I2C bus\n"
|
||||
#endif /* CONFIG_I2C_MULTI_BUS */
|
||||
#endif
|
||||
#if defined(CONFIG_I2C_EDID)
|
||||
"i2c edid chip - print EDID configuration information\n"
|
||||
#endif /* CONFIG_I2C_EDID */
|
||||
|
@ -374,45 +374,12 @@ static int __i2c_write(struct mv_i2c *base, uchar chip, u8 *addr, int alen,
|
||||
|
||||
static struct mv_i2c *base_glob;
|
||||
|
||||
#ifdef CONFIG_I2C_MULTI_BUS
|
||||
static unsigned long i2c_regs[CONFIG_MV_I2C_NUM] = CONFIG_MV_I2C_REG;
|
||||
static unsigned int bus_initialized[CONFIG_MV_I2C_NUM];
|
||||
static unsigned int current_bus;
|
||||
|
||||
int i2c_set_bus_num(unsigned int bus)
|
||||
{
|
||||
if ((bus < 0) || (bus >= CONFIG_MV_I2C_NUM)) {
|
||||
printf("Bad bus: %d\n", bus);
|
||||
return -1;
|
||||
}
|
||||
|
||||
base_glob = (struct mv_i2c *)i2c_regs[bus];
|
||||
current_bus = bus;
|
||||
|
||||
if (!bus_initialized[current_bus]) {
|
||||
bus_initialized[current_bus] = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int i2c_get_bus_num(void)
|
||||
{
|
||||
return current_bus;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* API Functions */
|
||||
void i2c_init(int speed, int slaveaddr)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
#ifdef CONFIG_I2C_MULTI_BUS
|
||||
current_bus = 0;
|
||||
base_glob = (struct mv_i2c *)i2c_regs[current_bus];
|
||||
#else
|
||||
base_glob = (struct mv_i2c *)CONFIG_MV_I2C_REG;
|
||||
#endif
|
||||
|
||||
if (speed > I2C_SPEED_STANDARD_RATE)
|
||||
val = ICR_FM;
|
||||
|
@ -36,9 +36,6 @@
|
||||
|
||||
#define CONFIG_MXC_UART_BASE UART5_BASE
|
||||
|
||||
/* I2C Configs */
|
||||
#define CONFIG_I2C_MULTI_BUS
|
||||
|
||||
/* MMC Configs */
|
||||
#define CFG_SYS_FSL_ESDHC_ADDR 0
|
||||
#define CFG_SYS_FSL_USDHC_NUM 2
|
||||
|
@ -149,7 +149,6 @@
|
||||
* I2C
|
||||
*/
|
||||
|
||||
#define CONFIG_I2C_MULTI_BUS
|
||||
#define CFG_SYS_I2C_MAX_HOPS 1
|
||||
#define CFG_SYS_NUM_I2C_BUSES 3
|
||||
#define I2C_MUX_PCA_ADDR 0x70
|
||||
|
@ -33,9 +33,6 @@
|
||||
#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
|
||||
#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
|
||||
|
||||
/* I2C */
|
||||
#define CONFIG_I2C_MULTI_BUS
|
||||
|
||||
/* I2C EEPROM */
|
||||
|
||||
/* MMC Configs */
|
||||
|
Loading…
Reference in New Issue
Block a user