4960f084 | 02-Jun-2017 |
Cédric Le Goater <clg@kaod.org> |
aspeed/i2c: introduce a state machine
The Aspeed I2C controller maintains a state machine in the command register, which is mostly used for debug.
Let's start adding a few states to handle abnormal
aspeed/i2c: introduce a state machine
The Aspeed I2C controller maintains a state machine in the command register, which is mostly used for debug.
Let's start adding a few states to handle abnormal STOP commands. Today, the model uses the busy status of the bus as a condition to do so but it is not precise enough.
Also remove the ABNORMAL bit for failing TX commands. This is incorrect with respect to the specs.
Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-id: 1494827476-1487-4-git-send-email-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
d0efdc16 | 02-Jun-2017 |
Cédric Le Goater <clg@kaod.org> |
aspeed/i2c: handle LAST command under the RX command
Today, the LAST command is handled with the STOP command but this is incorrect. Also nack the I2C bus when a LAST is issued.
Signed-off-by: Cédr
aspeed/i2c: handle LAST command under the RX command
Today, the LAST command is handled with the STOP command but this is incorrect. Also nack the I2C bus when a LAST is issued.
Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-id: 1494827476-1487-3-git-send-email-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
cc083d8a | 24-Oct-2016 |
Corey Minyard <cminyard@mvista.com> |
i2c: Add asserts for second smbus i2c_start_transfer()
Some SMBus operations restart the transfer to convert from write to read mode without an intervening i2c_end_transfer(). The second call cannot
i2c: Add asserts for second smbus i2c_start_transfer()
Some SMBus operations restart the transfer to convert from write to read mode without an intervening i2c_end_transfer(). The second call cannot fail, so the return code is unchecked, but this causes Coverity to complain. So add some asserts and documentation about this.
Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
056fca7b | 14-Jun-2016 |
Peter Crosthwaite <crosthwaitepeter@gmail.com> |
i2c: Factor our send() and recv() common logic
Most of the control flow logic between send and recv (error checking etc) is the same. Factor this out into a common send_recv() API. This is then usab
i2c: Factor our send() and recv() common logic
Most of the control flow logic between send and recv (error checking etc) is the same. Factor this out into a common send_recv() API. This is then usable by clients, where the control logic for send and receive differs only by a boolean. E.g.
if (send) i2c_send(...): else i2c_recv(...);
becomes:
i2c_send_recv(... , send);
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1465833014-21982-4-git-send-email-fred.konrad@greensocs.com Changes from FK: * Rebased on master. * Rebased on my i2c broadcast patch. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
2293c27f | 14-Jun-2016 |
KONRAD Frederic <fred.konrad@greensocs.com> |
i2c: implement broadcast write
This does a write to every slaves when the I2C bus get a write to address 0.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Alistair Francis
i2c: implement broadcast write
This does a write to every slaves when the I2C bus get a write to address 0.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Tested-By: Hyun Kwon <hyun.kwon@xilinx.com> Message-id: 1465833014-21982-3-git-send-email-fred.konrad@greensocs.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|