xemu/hw/arm
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
..
Kconfig hw/fsi: Aspeed APB2OPB & On-chip peripheral bus 2024-02-01 08:33:18 +01:00
allwinner-a10.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
allwinner-h3.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
allwinner-r40.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
armsse.c hw: Simplify accesses to the CPUState::'start-powered-off' property 2024-01-05 16:20:15 +01:00
armv7m.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
aspeed.c hw/arm/aspeed: Check for CPU types in machine_run_board_init() 2024-02-01 08:13:30 +01:00
aspeed_ast10x0.c hw/arm/aspeed: Check for CPU types in machine_run_board_init() 2024-02-01 08:13:30 +01:00
aspeed_ast2400.c hw/arm/aspeed: Check for CPU types in machine_run_board_init() 2024-02-01 08:13:30 +01:00
aspeed_ast2600.c hw/arm: Hook up FSI module in AST2600 2024-02-01 08:33:18 +01:00
aspeed_eeprom.c hw/arm/aspeed: Add VPD data for Rainier machine 2023-06-15 18:35:57 +02:00
aspeed_eeprom.h hw/arm/aspeed: Add VPD data for Rainier machine 2023-06-15 18:35:57 +02:00
aspeed_soc_common.c hw/arm/aspeed: Check for CPU types in machine_run_board_init() 2024-02-01 08:13:30 +01:00
b-l475e-iot01a.c hw/arm: Add minimal support for the B-L475E-IOT01A board 2024-01-09 14:42:40 +00:00
bananapi_m2u.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
bcm2835_peripherals.c hw/arm/bcm2835_property: Implement "get command line" message 2023-05-02 15:47:40 +01:00
bcm2836.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
boot.c target/arm/arm-powerctl: Correctly init CPUs when powered on to lower EL 2023-10-19 14:32:13 +01:00
collie.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
cubieboard.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
digic.c arm/digic: replace snprintf() with g_strdup_printf() 2022-04-21 17:03:51 +04:00
digic_boards.c hw/arm: Don't include qemu-common.h unnecessarily 2021-12-15 10:35:26 +00:00
exynos4_boards.c hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable 2023-10-27 12:50:12 +01:00
exynos4210.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
fby35.c hw/arm/aspeed: Move AspeedSoCState::a7mpcore to Aspeed2600SoCState 2023-10-25 09:52:44 +02:00
fsl-imx6.c hw/arm: add PCIe to Freescale i.MX6 2024-01-26 12:23:04 +00:00
fsl-imx6ul.c fsl-imx6ul: Add various missing unimplemented devices 2024-01-26 11:30:49 +00:00
fsl-imx7.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
fsl-imx25.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
fsl-imx31.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
gumstix.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
highbank.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
imx25_pdk.c hw/arm/fsl-imx25: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
integratorcp.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
kzm.c hw/arm/fsl-imx31: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
mainstone.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
mcimx6ul-evk.c hw/arm/fsl-imx6ul: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
mcimx7d-sabre.c hw/arm/fsl-imx7: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
meson.build hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
microbit.c target/arm: Make boards pass base address to armv7m_load_kernel() 2022-09-14 11:19:40 +01:00
mps2-tz.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
mps2.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
msf2-soc.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
msf2-som.c hw/arm: Add missing QOM parent for v7-M SoCs 2024-01-09 14:42:40 +00:00
musca.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
musicpal.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
netduino2.c hw/arm: Add missing QOM parent for v7-M SoCs 2024-01-09 14:42:40 +00:00
netduinoplus2.c hw/arm: Add missing QOM parent for v7-M SoCs 2024-01-09 14:42:40 +00:00
npcm7xx.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
npcm7xx_boards.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
nrf51_soc.c hw: Simplify memory_region_init_ram() calls 2024-01-05 16:20:15 +01:00
nseries.c hw/arm/nseries: Unconditionally map the TUSB6010 USB Host controller 2024-01-26 11:30:47 +00:00
olimex-stm32-h405.c hw/arm: Add missing QOM parent for v7-M SoCs 2024-01-09 14:42:40 +00:00
omap1.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
omap2.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
omap_sx1.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
orangepi.c hw/arm: Check CPU type in machine_run_board_init() 2024-01-05 16:20:15 +01:00
palm.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
pxa2xx.c hw/arm: Constify VMState 2023-12-29 11:17:30 +11:00
pxa2xx_gpio.c hw/arm: Constify VMState 2023-12-29 11:17:30 +11:00
pxa2xx_pic.c hw/arm: Constify VMState 2023-12-29 11:17:30 +11:00
raspi.c hw/arm/raspi: Use arm_write_bootloader() to write boot code 2023-05-02 15:47:41 +01:00
realview.c target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
sabrelite.c hw/arm/fsl-imx6: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
sbsa-ref.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
smmu-common.c hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps 2023-11-03 09:20:31 +01:00
smmu-internal.h hw/arm/smmuv3: Add VMID to TLB tagging 2023-05-30 15:50:16 +01:00
smmuv3-internal.h hw/arm/smmuv3: Include missing 'hw/registerfields.h' header 2024-01-26 11:30:48 +00:00
smmuv3.c hw/arm: Constify VMState 2023-12-29 11:17:30 +11:00
spitz.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
stellaris.c hw/arm/socs: configure priority bits for existing SOCs 2024-01-09 14:42:40 +00:00
stm32f100_soc.c hw/arm/socs: configure priority bits for existing SOCs 2024-01-09 14:42:40 +00:00
stm32f205_soc.c hw/arm/socs: configure priority bits for existing SOCs 2024-01-09 14:42:40 +00:00
stm32f405_soc.c hw/arm/socs: configure priority bits for existing SOCs 2024-01-09 14:42:40 +00:00
stm32l4x5_soc.c hw/arm: Connect STM32L4x5 SYSCFG to STM32L4x5 SoC 2024-01-15 17:12:22 +00:00
stm32vldiscovery.c hw/arm: Add missing QOM parent for v7-M SoCs 2024-01-09 14:42:40 +00:00
strongarm.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
strongarm.h hw/arm/collie: Create the RAM in the board 2019-10-22 17:44:01 +01:00
tosa.c hw/arm/pxa2xx: Simplify pxa255_init() 2023-01-12 17:03:14 +00:00
trace-events hw/arm/smmuv3: Add stage-2 support in iova notifier 2023-05-30 15:50:16 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
versatilepb.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
vexpress.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
virt-acpi-build.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
virt.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
xen_arm.c Xen: Fix xen_set_irq() and xendevicemodel_set_irq_level() 2023-11-07 13:03:19 -08:00
xilinx_zynq.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
xlnx-versal-virt.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00
xlnx-versal.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
xlnx-zcu102.c hw/arm/xlnx-zynqmp: Remove 'hw/arm/boot.h' from header 2023-10-27 12:42:13 +01:00
xlnx-zynqmp.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
z2.c hw/arm: Build various units only once 2024-01-26 11:30:49 +00:00