Integration project for the work on the QEMU i2c chardev device. Motivated by work for OpenPRoT.
In the scope of the OpenPRoT project we needed a QEMU with an I2C device that can support an external application and also allow MCTP over I2C communication.
While the implementation in QEMU should be generic enough. The integration focuses on testing/developing this with MCTP via I2C in mind.
The project uses Task for build automation. Available tasks can be viewed with task --list.
To test the MCTP over I2C communication:
-
Start the echo server (host side):
task test-echo
This starts the host MCTP I2C echo server that listens on a Unix socket (
vi2c_bus.sock). -
Run QEMU (in another terminal):
task run-qemu
This starts QEMU with the AST2600 EVB configuration and connects to the echo server via the chardev.
-
Connect to the serial console (in another terminal):
task run-serial
This connects to the QEMU serial console.
-
Run the MCTP echo test inside QEMU:
- Login as
root(no password required) - Run the MCTP echo application:
mctp-echo
- Login as
-
Connect to QEMU monitor:
task run-monitor
-
Run QEMU with debug tracing (chardev_i2c traces):
task run-qemu-debug
-
Rebuild custom packages (mctp-echo, mctp-init):
task rebuild-packages
This project uses the following submodules:
- QEMU:
git@github.com:9elements/qemu.git(branch:groenke/wip/i2c_chardev) - Buildroot:
git@github.com:mynetz/buildroot.git(branch:feat/ast2600-nvme-mi) - Host MCTP I2C Tools: Rust-based tools for testing MCTP over I2C (see
host-mctp-i2c-tools/)
This repository contains these components:
- QEMU i2c chardev device implementation (via
qemusubmodule) - A buildroot environment to run inside QEMU (target) for tests and development
(via
buildrootsubmodule) - Tests and programs for the i2c chardev device for the host and target side
- See
br2-externalfor the buildroot external tree with custom packages - Host tools in
host-mctp-i2c-tools/(echo and initiator)
- See
- Documentation and examples for using the i2c chardev device
- Task - Build automation tool
- Rust toolchain (for host MCTP I2C tools)
- Standard build tools (gcc, make, etc.)
- QEMU build dependencies
-
Initialize submodules:
task init-submodules
-
Build QEMU:
task build-qemu
Builds
qemu-system-armwith the I2C chardev device support. -
Build Host MCTP I2C Tools:
task build-host-mctp-i2c-tools
Builds the
echoandinitiatorbinaries inhost-mctp-i2c-tools/target/release/. -
Build Buildroot:
task build-buildroot
Builds the Linux kernel, rootfs, and device tree for the AST2600 EVB target.
Note: Building QEMU and Buildroot can take 10-20 minutes on a fast machine. The buildroot build includes building a complete toolchain as the prebuild toolchain from Bootlin lacks the kernel headers required for MCTP tooling.
task clean-qemu- Clean QEMU build artifactstask clean-buildroot- Clean Buildroot build artifactstask clean- Clean all build artifacts
The br2-external directory contains a Buildroot external tree with custom packages and
configurations:
- mctp-echo: A simple test application that currently prints a hello world message. Will be
- extended to support MCTP over I2C testing.
- The dependency on the custom
buildrootcan probably be droppen, if the custom changes are moved to the external tree in this repository. Right now we re-use some previuosly done work for another project. - The buildroot project does not check the hashes for the downloaded archives right now. something in the u-boot build triggered a wrong hash check and broke the build.
- The available mctp devices should look like this
mctp l dev lo index 1 address 00:00:00:00:00:00 net 1 mtu 65536 up dev mctpi2c1 index 6 address 0x10 net 1 mtu 254 down dev mctpi2c2 index 7 address 0x20 net 1 mtu 254 down