qemu/hw
Ninad Palsule 3fd941f3f1 hw/arm: Hook up FSI module in AST2600
This patchset introduces IBM's Flexible Service Interface(FSI).

Time for some fun with inter-processor buses. FSI allows a service
processor access to the internal buses of a host POWER processor to
perform configuration or debugging.

FSI has long existed in POWER processes and so comes with some baggage,
including how it has been integrated into the ASPEED SoC.

Working backwards from the POWER processor, the fundamental pieces of
interest for the implementation are:

1. The Common FRU Access Macro (CFAM), an address space containing
   various "engines" that drive accesses on buses internal and external
   to the POWER chip. Examples include the SBEFIFO and I2C masters. The
   engines hang off of an internal Local Bus (LBUS) which is described
   by the CFAM configuration block.

2. The FSI slave: The slave is the terminal point of the FSI bus for
   FSI symbols addressed to it. Slaves can be cascaded off of one
   another. The slave's configuration registers appear in address space
   of the CFAM to which it is attached.

3. The FSI master: A controller in the platform service processor (e.g.
   BMC) driving CFAM engine accesses into the POWER chip. At the
   hardware level FSI is a bit-based protocol supporting synchronous and
   DMA-driven accesses of engines in a CFAM.

4. The On-Chip Peripheral Bus (OPB): A low-speed bus typically found in
   POWER processors. This now makes an appearance in the ASPEED SoC due
   to tight integration of the FSI master IP with the OPB, mainly the
   existence of an MMIO-mapping of the CFAM address straight onto a
   sub-region of the OPB address space.

5. An APB-to-OPB bridge enabling access to the OPB from the ARM core in
   the AST2600. Hardware limitations prevent the OPB from being directly
   mapped into APB, so all accesses are indirect through the bridge.

The implementation appears as following in the qemu device tree:

    (qemu) info qtree
    bus: main-system-bus
      type System
      ...
      dev: aspeed.apb2opb, id ""
        gpio-out "sysbus-irq" 1
        mmio 000000001e79b000/0000000000001000
        bus: opb.1
          type opb
          dev: fsi.master, id ""
            bus: fsi.bus.1
              type fsi.bus
              dev: cfam.config, id ""
              dev: cfam, id ""
                bus: fsi.lbus.1
                  type lbus
                  dev: scratchpad, id ""
                    address = 0 (0x0)
        bus: opb.0
          type opb
          dev: fsi.master, id ""
            bus: fsi.bus.0
              type fsi.bus
              dev: cfam.config, id ""
              dev: cfam, id ""
                bus: fsi.lbus.0
                  type lbus
                  dev: scratchpad, id ""
                    address = 0 (0x0)

The LBUS is modelled to maintain the qdev bus hierarchy and to take
advantage of the object model to automatically generate the CFAM
configuration block. The configuration block presents engines in the
order they are attached to the CFAM's LBUS. Engine implementations
should subclass the LBusDevice and set the 'config' member of
LBusDeviceClass to match the engine's type.

CFAM designs offer a lot of flexibility, for instance it is possible for
a CFAM to be simultaneously driven from multiple FSI links. The modeling
is not so complete; it's assumed that each CFAM is attached to a single
FSI slave (as a consequence the CFAM subclasses the FSI slave).

As for FSI, its symbols and wire-protocol are not modelled at all. This
is not necessary to get FSI off the ground thanks to the mapping of the
CFAM address space onto the OPB address space - the models follow this
directly and map the CFAM memory region into the OPB's memory region.
Future work includes supporting more advanced accesses that drive the
FSI master directly rather than indirectly via the CFAM mapping, which
will require implementing the FSI state machine and methods for each of
the FSI symbols on the slave. Further down the track we can also look at
supporting the bitbanged SoftFSI drivers in Linux by extending the FSI
slave model to resolve sequences of GPIO IRQs into FSI symbols, and
calling the associated symbol method on the slave to map the access onto
the CFAM.

Testing:
    Tested by reading cfam config address 0 on rainier machine type.

    root@p10bmc:~# pdbg -a getcfam 0x0
    p0: 0x0 = 0xc0022d15

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Ninad Palsule <ninad@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2024-02-01 08:33:18 +01:00
..
9pfs * configure: use a native non-cross compiler for linux-user 2024-01-04 19:55:20 +00:00
acpi * configure: use a native non-cross compiler for linux-user 2024-01-04 19:55:20 +00:00
adc hw/adc: Constify VMState 2023-12-29 11:17:30 +11:00
alpha hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps 2023-11-03 09:20:31 +01:00
arm hw/arm: Hook up FSI module in AST2600 2024-02-01 08:33:18 +01:00
audio hw/audio/sb16: Do not migrate qdev properties 2024-01-05 16:20:15 +01:00
avr hw/avr/atmega: Fix wrong initial value of stack pointer 2023-11-28 14:27:12 +01:00
block virtio-blk: always set ioeventfd during startup 2024-01-26 11:16:58 +01:00
char hw/char/imx_serial: Implement receive FIFO and ageing timer 2024-01-26 11:34:21 +00:00
core accel/tcg: Move perf and debuginfo support to tcg/ 2024-01-29 21:04:10 +10:00
cpu target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
cris
cxl meson: remove CONFIG_ALL 2023-12-31 09:11:28 +01:00
display vga: sort-of implement word and double-word access modes 2024-01-18 10:43:14 +01:00
dma hw/dma: Constify VMState 2023-12-29 11:17:30 +11:00
fsi hw/fsi: Aspeed APB2OPB & On-chip peripheral bus 2024-02-01 08:33:18 +01:00
gpio hw/gpio: Constify VMState 2023-12-29 11:17:30 +11:00
hppa hw/hppa: Move software power button address back into PDC 2024-01-13 06:48:14 +01:00
hyperv hw/hyperv: Constify VMState 2023-12-29 11:17:30 +11:00
i2c hw/i2c: Constify VMState 2023-12-29 11:17:30 +11:00
i386 - Fix s390x ISM reset 2024-01-20 17:22:16 +00:00
ide hw/ide: Constify VMState 2023-12-29 11:17:30 +11:00
input hw/input: Constify VMState 2023-12-29 11:17:30 +11:00
intc pull-loongarch-20240111 2024-01-11 15:19:14 +00:00
ipack hw/ipack: Constify VMState 2023-12-29 11:17:30 +11:00
ipmi hw/ipmi: Constify VMState 2023-12-29 11:17:30 +11:00
isa hw/isa: Constify VMState 2023-12-29 11:17:30 +11:00
loongarch hw/intc/loongarch_extioi: Add dynamic cpu number support 2024-01-11 19:22:47 +08:00
m68k q800: move dp8393x_prom memory region to Q800MachineState 2024-01-11 11:39:26 +01:00
mem meson: remove CONFIG_ALL 2023-12-31 09:11:28 +01:00
microblaze hw/microblaze: Clean up local variable shadowing 2023-09-29 10:07:16 +02:00
mips qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to BQL_LOCK_GUARD 2024-01-08 10:45:43 -05:00
misc hw/misc/xlnx-versal-crl: Build it only once 2024-01-26 11:30:49 +00:00
net virtio-net: correctly copy vnet header when flushing TX 2024-01-25 14:58:00 +08:00
nios2 target/nios2: Deprecate the Nios II architecture 2023-11-23 14:10:04 +00:00
nubus trace-events: Fix the name of the tracing.rst file 2023-09-08 13:08:51 +03:00
nvme hw/nvme: Clean up local variable shadowing in nvme_ns_init() 2023-09-29 10:07:20 +02:00
nvram hw/arm/virt-acpi-build.c: Migrate fw_cfg creation to common location 2024-01-10 18:47:46 +10:00
openrisc hw/openrisc: Constify VMState 2023-12-30 07:38:06 +11:00
pci * configure: use a native non-cross compiler for linux-user 2024-01-04 19:55:20 +00:00
pci-bridge * configure: use a native non-cross compiler for linux-user 2024-01-04 19:55:20 +00:00
pci-host target/hppa qemu v8.2 regression fixes 2024-01-16 14:24:42 +00:00
pcmcia hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() 2023-10-27 12:48:57 +01:00
ppc qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql() 2024-01-08 10:45:43 -05:00
rdma hw/rdma/vmw/pvrdma_cmd: Use correct struct in query_port() 2023-10-21 15:00:22 +03:00
remote Replace "iothread lock" with "BQL" in comments 2024-01-08 10:45:43 -05:00
riscv target/riscv: add zicbop extension flag 2024-01-10 18:47:47 +10:00
rtc hw/rtc: Constify VMState 2023-12-30 07:38:06 +11:00
rx hw/rx/rx62n: Use qdev_prop_set_array() 2023-11-10 18:19:13 +01:00
s390x - Fix s390x ISM reset 2024-01-20 17:22:16 +00:00
scsi hw/scsi/esp-pci: set DMA_STAT_BCMBLT when BLAST command issued 2024-01-19 12:28:59 +01:00
sd hw/sd: Constify VMState 2023-12-30 07:38:06 +11:00
sensor hw/sensor: Constify VMState 2023-12-30 07:38:06 +11:00
sh4 target/sh4: Deprecate the shix machine 2024-01-19 12:28:59 +01:00
smbios meson: remove CONFIG_ALL 2023-12-31 09:11:28 +01:00
sparc target/sparc: Simplify qemu_irq_ack 2024-01-05 16:20:15 +01:00
sparc64 hw/sparc: Simplify memory_region_init_ram_nomigrate() calls 2024-01-05 16:20:15 +01:00
ssi hw/ssi: Constify VMState 2023-12-30 07:38:06 +11:00
timer hw/timer/hpet: Convert DPRINTF to trace events 2024-01-19 12:28:10 +01:00
tpm hw/tpm: Constify VMState 2023-12-30 07:38:06 +11:00
tricore hw/tricore: Log failing test in testdevice 2023-09-29 08:28:02 +02:00
ufs hw/ufs: avoid generating the same ID string for different LU devices 2023-12-05 13:57:18 +09:00
usb migration 1st pull for 9.0 2024-01-05 13:35:25 +00:00
vfio vfio/pci: Clear MSI-X IRQ index always 2024-01-29 08:26:25 +01:00
virtio hw/arm/virt-acpi-build.c: Migrate virtio creation to common location 2024-01-10 18:47:46 +10:00
watchdog hw/watchdog: Constify VMState 2023-12-30 07:38:06 +11:00
xen cpus: check running not RUN_STATE_RUNNING 2024-01-04 09:52:42 +08:00
xenpv hw/xen: update Xen PV NIC to XenDevice model 2023-11-07 08:54:20 +00:00
xtensa trivial: Simplify the spots that use TARGET_BIG_ENDIAN as a numeric value 2023-09-08 13:08:52 +03:00
Kconfig hw/fsi: Introduce IBM's Local bus 2024-02-01 08:13:30 +01:00
meson.build hw/fsi: Introduce IBM's Local bus 2024-02-01 08:13:30 +01:00