Skip to content

RFC Introduce GPIO transmitter and connect to NPCM7xx

Joe Komlodi qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/gpio/gpio_transmitter: Add Devicehw/gpio/Kconfig hw/gpio/google_gpio_transmitter.c include/hw/gpio/google_gpio_transmitter.h+176 -00 replies
2/6hw/gpio/gpio_transmitter: Add allowlisthw/gpio/google_gpio_transmitter.c include/hw/gpio/google_gpio_transmitter.h+142 -00 replies
3/6hw/gpio/npcm7xx: Number controllershw/arm/npcm7xx.c hw/gpio/npcm7xx_gpio.c include/hw/gpio/npcm7xx_gpio.h+4 -00 replies
4/6hw/arm/npcm7xx: gpio: Add GPIO transmitterhw/arm/Kconfig hw/arm/npcm7xx.c hw/gpio/meson.build +3 more+28 -00 replies
5/6hw/gpio/npcm7xx: init GPIO transmitter allowlisthw/gpio/npcm7xx_gpio.c+9 -00 replies
6/6qtests/gpio_transmitter: Add testtests/qtest/google_gpio_tx-test.c tests/qtest/meson.build+217 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/6] Introduce GPIO transmitter and connect to NPCM7xx

Hi all,

This series introduces a GPIO transmitter, which allows the transmission of GPIO controller pin state over chardev, and attaches it to the NPCM7xx GPIO controller.

The GPIO transmitter takes in a GPIO controller number and a bitfield containing the GPIO state of that controller, then formats a packet and sends it via chardev to whomever is listening for it.
The purpose of this is for external software to receive the packet and interpret it so it can do any actions it needs to, based on GPIO state.

For example, in our use case, we have a VM manager managing an x86 guest and an ARM (NPCM7xx) guest. On real hardware, the ARM SoC is a BMC which has some power control over the x86 SoC.
Because of this, we need to relay GPIO power events from the BMC to the x86 machine (i.e. reset, power off, etc), so we have software read in the GPIO transmitter packets, keep track of what power state the x86 machine is in based on the GPIO state of the BMC, and notify the VM manager of any important changes.
The VM manager can then power up/down and reset the x86 machine as needed.

Thanks!
Joe

Joe Komlodi (6):
hw/gpio/gpio_transmitter: Add Device hw/gpio/gpio_transmitter: Add allowlist hw/gpio/npcm7xx: Number controllers hw/arm/npcm7xx: gpio: Add GPIO transmitter hw/gpio/npcm7xx: init GPIO transmitter allowlist qtests/gpio_transmitter: Add test

 hw/arm/Kconfig                            |   1 +
 hw/arm/npcm7xx.c                          |   8 +
 hw/gpio/Kconfig                           |   3 +
 hw/gpio/google_gpio_transmitter.c         | 249 ++++++++++++++++++++++
 hw/gpio/meson.build                       |   1 +
 hw/gpio/npcm7xx_gpio.c                    |  25 +++
 include/hw/arm/npcm7xx.h                  |   2 +
 include/hw/gpio/google_gpio_transmitter.h |  66 ++++++
 include/hw/gpio/npcm7xx_gpio.h            |   4 +
 tests/qtest/google_gpio_tx-test.c         | 216 +++++++++++++++++++
 tests/qtest/meson.build                   |   1 +
 11 files changed, 576 insertions(+)
 create mode 100644 hw/gpio/google_gpio_transmitter.c
 create mode 100644 include/hw/gpio/google_gpio_transmitter.h
 create mode 100644 tests/qtest/google_gpio_tx-test.c
Signature · 1 line
2.34.1.173.g76aa8bc2d0-goog