Hi,
The following code snippet in selectI2CInstance in demo/pmic.c for evmAM335x and evmskAM335x is wrong:
/* Modify reg value */
i2cInstance = (dataFromSlave[I2C_0][0] & PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL) |
(i2cInstance << PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL_SHIFT);
It should be AND'ing with the inverted bitmask, like so:
& (~PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL)
the same way it's done in bl_platform.c.
Thanks,
Orjan