This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

demo/pmic.c: bad DEVCTRL value masking

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 (to clear the existing value before or'ing the new value), like so:

& (~PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL)

the same way it's done in bl_platform.c.

Thanks,

Orjan