Skip to content

rust/hw: Add the I2C and the first GPIO device

ChenMiao qemu-devel qemu-rust 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest4 patches 0 repliesNew

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4rust/hw/core: Add the BusState of rust versionrust/hw/core/meson.build rust/hw/core/src/bus.rs rust/hw/core/src/lib.rs+48 -00 replies
2/4rust/hw/core: Add rust bindings/funcs for i2c busrust/hw/core/meson.build rust/hw/core/src/i2c.rs rust/hw/core/src/lib.rs +1 more+308 -00 replies
3/4rust/hw/core: Provide some interfaces for the GPIO devicerust/hw/core/src/qdev.rs+14 -30 replies
4/4rust/hw/gpio: Add the the first gpio device pcf8574hw/gpio/Kconfig hw/gpio/meson.build rust/Cargo.lock +8 more+272 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] rust/hw: Add the I2C and the first GPIO device

From: Chen Miao <[email protected]>

We have implemented I2C and the first GPIO device in Rust for QEMU. Additionally, in the respective patches, we have shared our insights and experiences regarding the use of Rust for device modeling within QEMU.

1. The first patch implements the BusState for the I2CBus infrastructure.
2. The second patch implements the I2CBus and I2CSlave infrastructure, along with a discussion of the challenges encountered during the implementation.
3. The third patch provides a set of necessary helper functions for the PCF8574 GPIO device.
4. The fourth patch implements the PCF8574 GPIO device, along with a discussion of the issues and considerations addressed during the implementation.

---

Due to issues with the email service provider, the previous PATCH series was not properly displayed as a thread. Subsequently, the resent emails were accidentally merged into a single thread, making the review process difficult. Therefore, resending it and hope to receive review.

chenmiao (4):
rust/hw/core: Add the BusState of rust version rust/hw/core: Add rust bindings/funcs for i2c bus rust/hw/core: Provide some interfaces for the GPIO device rust/hw/gpio: Add the the first gpio device pcf8574

 hw/gpio/Kconfig                  |   5 +
 hw/gpio/meson.build              |   2 +-
 rust/Cargo.lock                  |  18 +-
 rust/Cargo.toml                  |   1 +
 rust/hw/Kconfig                  |   1 +
 rust/hw/core/meson.build         |   2 +
 rust/hw/core/src/bus.rs          |  44 +++++
 rust/hw/core/src/i2c.rs          | 303 +++++++++++++++++++++++++++++++
 rust/hw/core/src/lib.rs          |   6 +
 rust/hw/core/src/qdev.rs         |  17 +-
 rust/hw/core/wrapper.h           |   1 +
 rust/hw/gpio/Kconfig             |   2 +
 rust/hw/gpio/meson.build         |   1 +
 rust/hw/gpio/pcf8574/Cargo.toml  |  28 +++
 rust/hw/gpio/pcf8574/meson.build |  37 ++++
 rust/hw/gpio/pcf8574/src/lib.rs  | 178 ++++++++++++++++++
 rust/hw/meson.build              |   1 +
 17 files changed, 642 insertions(+), 5 deletions(-)
 create mode 100644 rust/hw/core/src/bus.rs
 create mode 100644 rust/hw/core/src/i2c.rs
 create mode 100644 rust/hw/gpio/Kconfig
 create mode 100644 rust/hw/gpio/meson.build
 create mode 100644 rust/hw/gpio/pcf8574/Cargo.toml
 create mode 100644 rust/hw/gpio/pcf8574/meson.build
 create mode 100644 rust/hw/gpio/pcf8574/src/lib.rs
Signature · 1 line
2.43.0