mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-31 03:21:27 +02:00
ppc4xx: Fix problem with I2C bus >= 1 initialization
This patch fixes a problem introduced with patch eb5eb2b0 [ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C base address to the "i2c" pointer inside of the controller loop. Otherwise controller 0 is initialized multiple times instead of initializing each I2C controller sequentially. Tested on Katmai. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
060f28532b
commit
1a332da61d
@ -93,7 +93,7 @@ static void _i2c_bus_reset(void)
|
|||||||
|
|
||||||
void i2c_init(int speed, int slaveaddr)
|
void i2c_init(int speed, int slaveaddr)
|
||||||
{
|
{
|
||||||
struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
|
struct ppc4xx_i2c *i2c;
|
||||||
int val, divisor;
|
int val, divisor;
|
||||||
int bus;
|
int bus;
|
||||||
|
|
||||||
@ -109,6 +109,9 @@ void i2c_init(int speed, int slaveaddr)
|
|||||||
for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
|
for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
|
||||||
I2C_SET_BUS(bus);
|
I2C_SET_BUS(bus);
|
||||||
|
|
||||||
|
/* Set i2c pointer after calling I2C_SET_BUS() */
|
||||||
|
i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
|
||||||
|
|
||||||
/* Handle possible failed I2C state */
|
/* Handle possible failed I2C state */
|
||||||
/* FIXME: put this into i2c_init_board()? */
|
/* FIXME: put this into i2c_init_board()? */
|
||||||
_i2c_bus_reset();
|
_i2c_bus_reset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user