qemu-e2k/hw/ppc
Benjamin Herrenschmidt 4f9924c4d4 ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge
These changes introduces models for the PCIe Host Bridge (PHB4) of the
POWER9 processor. It includes the PowerBus logic interface (PBCQ),
IOMMU support, a single PCIe Gen.4 Root Complex, and support for MSI
and LSI interrupt sources as found on a POWER9 system using the XIVE
interrupt controller.

POWER9 processor comes with 3 PHB4 PEC (PCI Express Controller) and
each PEC can have several PHBs. By default,

  * PEC0 provides 1 PHB  (PHB0)
  * PEC1 provides 2 PHBs (PHB1 and PHB2)
  * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5)

Each PEC has a set  "global" registers and some "per-stack" (per-PHB)
registers. Those are organized in two XSCOM ranges, the "Nest" range
and the "PCI" range, each range contains both some "PEC" registers and
some "per-stack" registers.

No default device layout is provided and PCI devices can be added on
any of the available PCIe Root Port (pcie.0 .. 2 of a Power9 chip)
with address 0x0 as the firwware (skiboot) only accepts a single
device per root port. To run a simple system with a network and a
storage adapters, use a command line options such as :

  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0
  -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0

  -device megasas,id=scsi0,bus=pcie.1,addr=0x0
  -drive file=$disk,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none
  -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2

If more are needed, include a bridge.

Multi chip is supported, each chip adding its set of PHB4 controllers
and its PCI busses. The model doesn't emulate the EEH error handling.

This model is not ready for hotplug yet.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ clg: - numerous cleanups
       - commit log
       - fix for broken LSI support
       - PHB pic printinfo
       - large QOM rework ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200127144506.11132-2-clg@kaod.org>
[dwg: Use device_class_set_props()]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-02-02 14:07:57 +11:00
..
Kconfig ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge 2020-02-02 14:07:57 +11:00
Makefile.objs hw/ppc/Kconfig: Only select FDT helper for machines using it 2020-01-07 12:08:39 +01:00
e500-ccsr.h ppc: do not use ../ in include files 2013-03-01 13:57:33 +01:00
e500.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
e500.h platform-bus-device: use device plug callback instead of machine_done notifier 2018-05-10 18:10:56 +01:00
e500plat.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
fdt.c target/ppc: Split page size information into a separate allocation 2018-04-27 18:05:22 +10:00
fw_cfg.c hw/ppc: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
mac.h ide: Include hw/ide/internal a bit less outside hw/ide/ 2019-08-16 13:31:52 +02:00
mac_newworld.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
mac_oldworld.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
mpc8544_guts.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
mpc8544ds.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
pnv.c ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge 2020-02-02 14:07:57 +11:00
pnv_bmc.c ppc/pnv: Add a "pnor" const link property to the BMC internal simulator 2020-01-08 11:01:59 +11:00
pnv_core.c ppc/pnv: Add support for "hostboot" mode 2020-02-02 14:07:57 +11:00
pnv_homer.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pnv_lpc.c ppc/pnv: Add support for "hostboot" mode 2020-02-02 14:07:57 +11:00
pnv_occ.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pnv_pnor.c ppc/pnv: improve error logging when a PNOR update fails 2020-02-02 14:07:57 +11:00
pnv_psi.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pnv_xscom.c ppc/pnv: Introduce PnvChipClass::xscom_pcba() method 2019-12-17 10:59:11 +11:00
ppc.c hw/ppc/prep: Remove the deprecated "prep" machine and the OpenHackware BIOS 2020-02-02 14:07:57 +11:00
ppc4xx_devs.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc4xx_pci.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc405.h ppc4xx: Export ECB and PLB emulation 2017-09-08 09:30:55 +10:00
ppc405_boards.c hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:20:45 +02:00
ppc405_uc.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
ppc440.h ppc440_uc: Basic emulation of PPC440 DMA controller 2018-07-03 09:56:52 +10:00
ppc440_bamboo.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
ppc440_pcix.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc440_uc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ppc_booke.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
ppce500_spin.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
prep.c hw/ppc/prep: Remove the deprecated "prep" machine and the OpenHackware BIOS 2020-02-02 14:07:57 +11:00
prep_systemio.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
rs6000_mc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
sam460ex.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
spapr.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
spapr_caps.c ppc: fix memory leak in spapr_caps_add_properties 2019-08-21 17:17:11 +10:00
spapr_cpu_core.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
spapr_drc.c vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
spapr_events.c ppc/spapr_events: fix potential NULL pointer dereference in rtas_event_log_dequeue 2019-11-26 10:12:58 +11:00
spapr_hcall.c spapr: Don't allow multiple active vCPUs at CAS 2020-02-02 14:07:57 +11:00
spapr_iommu.c vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
spapr_irq.c spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router 2020-01-08 11:01:59 +11:00
spapr_ovec.c spapr: Simplify ovec diff 2019-12-17 10:39:48 +11:00
spapr_pci.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
spapr_pci_nvlink2.c error: Clean up unusual names of Error * variables 2019-12-18 08:36:15 +01:00
spapr_pci_vfio.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
spapr_rng.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
spapr_rtas.c hw/ppc/spapr_rtas: Remove local variable 2020-01-24 20:59:11 +01:00
spapr_rtas_ddw.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
spapr_rtc.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
spapr_tpm_proxy.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
spapr_vio.c spapr: Implement get_dt_compatible() callback 2020-02-02 14:07:57 +11:00
trace-events spapr: Remove unhelpful tracepoints from spapr_irq_free_xics() 2019-10-04 19:08:22 +10:00
virtex_ml507.c ppc:virtex_ml507: remove unused arguments 2020-02-02 14:07:57 +11:00