hw/i2c/aspeed: Fix old reg slave receive
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | hw/i2c/aspeed: Fix old reg slave receivehw/ include/ | +6 | 5 replies |
Reviews trailers per patch
The patch has a Reviewed-by or Acked-by.
| Patch | Klaus Jensen |
|---|---|
| 1/1 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/1] hw/i2c/aspeed: Fix old reg slave receive
Hey everyone,
I haven't gotten a chance to work on the Aspeed I2C controller in a little while, but I finally started looking at it again and noticed the old-register mode slave receive function (master-send-to-slave) does the wrong thing for the first byte. See the commit message for details.
I noticed this because I have a qtest for slave mode rx in old-register mode downstream [1] (I'm also working on a version of the test that can be upstreamed) that broke when I updated our QEMU branch to the 7.1 release. Previously I was using Klaus's original slave I2C patches from [2].
An example of the test running successfully with this change is pasted below, for whatever that's worth.
Thanks,
Peter
[1]: https://github.com/facebook/openbmc/blob/helium/common/recipes-devtools/qemu/qemu/0008-hw-misc-Add-byte-by-byte-i2c-network-device.patch
[2]: https://lore.kernel.org/qemu-devel/[email protected]/
# random seed: R02S5d2728d1347dc8b50533a0d85ebb1b02 # starting QEMU: exec build/qemu-system-arm -qtest unix:/tmp/qtest-711521.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-711521.qmp,id=char0 -mon chardev=char0,mode=control -display none -machine fby35-bmc -netdev socket,id=socket0,udp=127.0.0.1:5000,localaddr=127.0.0.1:6000 -device i2c-netdev2,bus=aspeed.i2c.bus.0,address=0x32,netdev=socket0 -accel qtest i2c_netdev2_class_init i2c_netdev2_realize i2c_netdev2_can_receive 1..2 # Start of arm tests # Start of ast2600 tests # Start of i2c tests i2c_netdev2_handle_event: 1 ../hw/misc/i2c-netdev2.c: tx [64, 00, 00] ../hw/misc/i2c-netdev2.c: tx [de] ../hw/misc/i2c-netdev2.c: tx [ad] ../hw/misc/i2c-netdev2.c: tx [be] ../hw/misc/i2c-netdev2.c: tx [ef] i2c_netdev2_handle_event: 3 ../hw/misc/i2c-netdev2.c: tx [00, 00, 00, 00] i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [01, 00] i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [01, 00] i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [01, 00] i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [01, 00] i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [01, 00] ok 1 /arm/ast2600/i2c/write_in_old_byte_mode i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [20, 00, 00] prev rx_buf: [00, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [20, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=3 i2c_netdev2_slave_mode_rx: rx_len=3 i2c_netdev2_slave_mode_rx: guest OS ack rx, clearing rx_len i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [de] prev rx_buf: [20, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [de, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: guest OS ack rx, clearing rx_len i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [ad] prev rx_buf: [de, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [ad, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: guest OS ack rx, clearing rx_len i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [be] prev rx_buf: [ad, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [be, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: guest OS ack rx, clearing rx_len i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [ef] prev rx_buf: [be, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [ef, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: rx_len=1 i2c_netdev2_slave_mode_rx: guest OS ack rx, clearing rx_len i2c_netdev2_can_receive ../hw/misc/i2c-netdev2.c: rx [ef, 00, 00, 00] prev rx_buf: [ef, 00, 00, 00, 00, 00, 00, 00, 00, 00] next rx_buf: [ef, 00, 00, 00, 00, 00, 00, 00, 00, 00] i2c_netdev2_slave_mode_rx: rx_len=4 ok 2 /arm/ast2600/i2c/slave_mode_rx_byte_buf # End of i2c tests # End of ast2600 tests # End of arm tests i2c_netdev2_nic_cleanup
Peter Delevoryas (1):
hw/i2c/aspeed: Fix old reg slave receive
hw/i2c/aspeed_i2c.c | 8 +++++--- include/hw/i2c/aspeed_i2c.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.37.1