OpenAMP / open-amp

The main OpenAMP library implementing RPMSG, Virtio, and Remoteproc for RTOS etc
https://www.openampproject.org/
Other
678 stars 278 forks source link

RFC: virtio MMIO device: added initial support for, platform agnostic, virtio device side over MMIO transport #538

Closed uLipe closed 6 months ago

uLipe commented 7 months ago

Based on the original Idea from Nicolas Granger from ST: nicolas.granger01@st.com with cosmetics adjustment and some adaptations to get also other devices to work, using AMP Virtio driver side, this RFC is an initial effort to bring the Virtio over MMIO transport generic device infrastructure, Nicolas worked on I2C device side, and I did work on the serial device side.

The I2C and Serial devices are respectively here:

https://github.com/Nicolas62x/zephyr_stm32mp1/tree/virtio_mmio_i2c/samples/subsys/ipc/openamp_virtio_i2c

https://github.com/uLipe/virtio-mmio-serial-rtos-to-rtos

Both use the AMP Virtio approach, not the native one, and the generic infrastructure allow the target platform to implement their hardware specifics like: cross-core interrupt, shared memory management.

The original work was placed the i2c device on the open-amp repository, since the devices are very closed coupled to the target OS, I removed from there and will send the reference device implementations (I2C and Serial) to the open-amp system references repository, under Zephyr examples.

Please notice this RFC just bring the common code for implementing device side, the target platform (OS or bare metal, needs to provide things like placement of the virtio_mmio configuration table, IPC handling and bindings to the platform actual device).

uLipe commented 7 months ago

@arnopo @wmamills @tnmysh @danmilea please have a look.

uLipe commented 7 months ago

Thank you for the initial review @arnopo , it seems I messed something when rebasing this PR against virtio-exp.

uLipe commented 7 months ago

Added all files and changes I lost during rebase, the PR is now bulding again

uLipe commented 7 months ago

Thanks @danmilea I'll address the comments you pointed :)

uLipe commented 6 months ago

@arnopo @danmilea just addressed all the comments, please check if it we can proceed :)