[PATCH 0/2] hw/i2c: Add Cadence I2C controller model for AX3005

Ratan Lal Dondi posted 2 patches 4 days, 9 hours ago
hw/arm/Kconfig               |   1 +
hw/arm/ax3005-soc.c          |  62 ++++++
hw/i2c/Kconfig               |   3 +
hw/i2c/cadence_i2c.c         | 358 +++++++++++++++++++++++++++++++++++
hw/i2c/meson.build           |   3 +-
hw/i2c/trace-events          |  12 ++
include/hw/arm/ax3005-soc.h  |  77 +++++++-
include/hw/i2c/cadence_i2c.h | 118 ++++++++++++
8 files changed, 632 insertions(+), 2 deletions(-)
create mode 100644 hw/i2c/cadence_i2c.c
create mode 100644 include/hw/i2c/cadence_i2c.h
[PATCH 0/2] hw/i2c: Add Cadence I2C controller model for AX3005
Posted by Ratan Lal Dondi 4 days, 9 hours ago
This patchset introduces a Cadence I2C controller model
and connects it to the AX3005 SoC.

The Cadence I2C controller model is based on hw/i2c/cadence_i2c.c from
the Xilinx QEMU fork (https://github.com/Xilinx/qemu, commit da85c8631e68),
originally written by Peter Crosthwaite.

Changes from original:
 - Move the fifo_* API to fifo8_ (e.g. fifo_is_empty to fifo8_is_empty).
 - Remove DB_PRINT debug macros, replaced with trace events 
   in hw/i2c/trace-events.

Refer to the Axiado website for more product information
https://axiado.com/products/

Testing
-------

Linux enumerates the I2C devices; the tmp105 sensor reads the temperature 
from hwmon, and at24c EEPROM read and write operations work.

qemu-system-aarch64 -nographic \
    -M ax3005-evb \
    -device loader,file=bl31.bin,addr=0x88300000 \
    -device loader,file=tee-raw.bin,addr=0x88400000 \
    -device loader,file=u-boot.bin,addr=0x80000000 \
    -device loader,file=fitImage,addr=0x80100000 \
    -device loader,file=obmc-phosphor-image-evk-ax3005-qemu.squashfs-xz,addr=0x80B00000 \
    -device loader,cpu-num=0,addr=0x88300000 \
    -device loader,cpu-num=1,addr=0x88300000 \
    -device loader,cpu-num=2,addr=0x88300000 \
    -device loader,cpu-num=3,addr=0x88300000 \
    -serial null \
    -serial null \
    -serial null \
    -serial mon:stdio \
    -drive if=sd,file=obmc-phosphor-image-evk-ax3005-qemu.wic.qcow2,format=qcow2 \
    -device tmp105,bus=cadence.i2c.16,address=0x48 \
    -device at24c-eeprom,bus=cadence.i2c.16,address=0x50,rom-size=256

Based-on: <20261119071355.3520249-1-kchiu@axiado.com>

Ratan Lal Dondi (2):
  hw/i2c: Add Cadence I2C controller model
  hw/arm: Wire up the Cadence I2C controller in AX3005 SoCs

 hw/arm/Kconfig               |   1 +
 hw/arm/ax3005-soc.c          |  62 ++++++
 hw/i2c/Kconfig               |   3 +
 hw/i2c/cadence_i2c.c         | 358 +++++++++++++++++++++++++++++++++++
 hw/i2c/meson.build           |   3 +-
 hw/i2c/trace-events          |  12 ++
 include/hw/arm/ax3005-soc.h  |  77 +++++++-
 include/hw/i2c/cadence_i2c.h | 118 ++++++++++++
 8 files changed, 632 insertions(+), 2 deletions(-)
 create mode 100644 hw/i2c/cadence_i2c.c
 create mode 100644 include/hw/i2c/cadence_i2c.h

-- 
2.34.1