Skip to content

Add platform bus

Alexander Graf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9PlatBus: Add Platform Bushw/platbus/platbus.c include/hw/platbus/platbus.h+193 -00 replies
2/9PlatBus: Add abstract Platform Devicehw/platbus/device.c include/hw/platbus/device.h+264 -00 replies
3/9PlatBus: Add Sysbus/Platform bridge devicehw/platbus/bridge.c include/hw/platbus/bridge.h+96 -00 replies
4/9PlatBus: Hook up into Makefile systemhw/Makefile.objs hw/platbus/Makefile.objs+2 -00 replies
5/9PPC: Add platform bus to the default compile setdefault-configs/ppc-softmmu.mak default-configs/ppc64-softmmu.mak default-configs/ppcemb-softmmu.mak+3 -00 replies
6/9PlatBus: Add serial-platbus devicehw/char/Makefile.objs hw/char/serial-platbus.c include/hw/char/serial-platbus.h+157 -04 replies
7/9PPC: Add PlatBus Serial to default configsdefault-configs/ppc-softmmu.mak default-configs/ppc64-softmmu.mak default-configs/ppcemb-softmmu.mak+3 -00 replies
8/9PPC: E500: Spawn PlatBus bridge for ppce500 machinehw/ppc/e500.c hw/ppc/e500.h hw/ppc/e500plat.c+23 -00 replies
9/9PPC: E500: Add PlatBus device tree walkerhw/ppc/e500.c+50 -40 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/9] Add platform bus

Platforms without ISA and/or PCI have had a seriously hard time in the dynamic device creation world of QEMU. Devices on these were modeled as SysBus devices which can only be instantiated in machine files, not through -device.

Why is that so?

Well, SysBus is trying to be incredibly generic. It allows you to plug any interrupt sender into any other interrupt receiver. It allows you to map a device's memory regions into any other random memory region. All of that only works from C code.

But do we need that level of complexity for normal devices usually? In a normal platform world (SoCs, PV machines) we have a flat memory layout we can plug our device memory into. We also have a flat IRQ model where we can plug our device IRQs into.

This platform bus creates a simple bus that models the easy world. It allows for dynamic device creation through -device. A device may or may not explictly request to be mapped at a specific IRQ and/or memory address. If no explicit mapping is requested, platform devices just get mapped at convenient places.

This goes hand in hand with automatic device tree generation. When QEMU places devices somewhere and also generates a device tree to tell the guest where exactly those devices are, we close the cycle and everyone knows everything and lives happily ever after.

The actual pressing issue this solves is that today it's impossible to spawn serial ports from the command line. With this patch set, it's possible to do so. But it lays the groundwork for much more...

Alex

Alexander Graf (9):
PlatBus: Add Platform Bus
PlatBus: Add abstract Platform Device
PlatBus: Add Sysbus/Platform bridge device
PlatBus: Hook up into Makefile system
PPC: Add platform bus to the default compile set
PlatBus: Add serial-platbus device
PPC: Add PlatBus Serial to default configs
PPC: E500: Spawn PlatBus bridge for ppce500 machine
PPC: E500: Add PlatBus device tree walker

 default-configs/ppc-softmmu.mak    |   2 +
 default-configs/ppc64-softmmu.mak  |   2 +
 default-configs/ppcemb-softmmu.mak |   2 +
 hw/Makefile.objs                   |   1 +
 hw/char/Makefile.objs              |   1 +
 hw/char/serial-platbus.c           | 100 +++++++++++++++++++++++
 hw/platbus/Makefile.objs           |   1 +
 hw/platbus/bridge.c                |  64 +++++++++++++++
 hw/platbus/device.c                | 162 +++++++++++++++++++++++++++++++++++++
 hw/platbus/platbus.c               | 107 ++++++++++++++++++++++++
 hw/ppc/e500.c                      |  75 ++++++++++++++++-
 hw/ppc/e500.h                      |   1 +
 hw/ppc/e500plat.c                  |   1 +
 include/hw/char/serial-platbus.h   |  56 +++++++++++++
 include/hw/platbus/bridge.h        |  32 ++++++++
 include/hw/platbus/device.h        | 102 +++++++++++++++++++++++
 include/hw/platbus/platbus.h       |  86 ++++++++++++++++++++
 17 files changed, 791 insertions(+), 4 deletions(-)
 create mode 100644 hw/char/serial-platbus.c
 create mode 100644 hw/platbus/Makefile.objs
 create mode 100644 hw/platbus/bridge.c
 create mode 100644 hw/platbus/device.c
 create mode 100644 hw/platbus/platbus.c
 create mode 100644 include/hw/char/serial-platbus.h
 create mode 100644 include/hw/platbus/bridge.h
 create mode 100644 include/hw/platbus/device.h
 create mode 100644 include/hw/platbus/platbus.h
Signature · 1 line
1.8.1.4