Skip to contentSkip to conversation

hw/pci-bridge: Create PLX Virtual Switch Device

PATCH Superseded Patrick Leis 1 participant 1 message Dec 18, 2024 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/pci-bridge: Create PLX Virtual Switch Device

From: Nabih Estefan <[email protected]>

Create a PLX PEX PCIe Virtual Switch implementation that can be used for modeling trays. This is a generalized version of the xio3130 switch where we can set the PCI information on creation, allowing us to model different trays without creating specific devices for all of them. It is used the same way the xio3130 switch is used + the PCI Signature information

---
 hw/pci-bridge/Kconfig                  |   5 +
 hw/pci-bridge/meson.build              |   1 +
 hw/pci-bridge/plx_vswitch_downstream.c | 187 +++++++++++++++++++++++++
 hw/pci-bridge/plx_vswitch_upstream.c   | 177 +++++++++++++++++++++++
 include/hw/pci-bridge/plx_vswitch.h    |  41 ++++++
 5 files changed, 411 insertions(+)
 create mode 100644 hw/pci-bridge/plx_vswitch_downstream.c
 create mode 100644 hw/pci-bridge/plx_vswitch_upstream.c
 create mode 100644 include/hw/pci-bridge/plx_vswitch.h
hw/pci-bridge/Kconfig +5 -0
index 449ec98643..dbba09d8b3 100644
@@ -27,6 +27,11 @@ config IOH3420
     default y if PCI_DEVICES
     depends on PCI_EXPRESS && MSI_NONBROKEN
 
+config PLX_VSWITCH
+    bool
+    default y if PCI_DEVICES
+    depends on PCI_EXPRESS && MSI_NONBROKEN
+
 config I82801B11
     bool
     default y if PCI_DEVICES
hw/pci-bridge/meson.build +1 -0
index 2e0eb0d233..02c18558bd 100644
@@ -7,6 +7,7 @@ pci_ss.add(when: 'CONFIG_PCIE_PCI_BRIDGE', if_true: files('pcie_pci_bridge.c'))
 pci_ss.add(when: 'CONFIG_PXB', if_true: files('pci_expander_bridge.c'),
                                if_false: files('pci_expander_bridge_stubs.c'))
 pci_ss.add(when: 'CONFIG_XIO3130', if_true: files('xio3130_upstream.c', 'xio3130_downstream.c'))
+pci_ss.add(when: 'CONFIG_PLX_VSWITCH', if_true: files('plx_vswitch_upstream.c', 'plx_vswitch_downstream.c'))
 pci_ss.add(when: 'CONFIG_CXL', if_true: files('cxl_root_port.c', 'cxl_upstream.c', 'cxl_downstream.c'))
 
 # Sun4u
hw/pci-bridge/plx_vswitch_downstream.c new file +187 -0

187 lines not on this page · raw message

hw/pci-bridge/plx_vswitch_upstream.c new file +177 -0

177 lines not on this page · raw message

include/hw/pci-bridge/plx_vswitch.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog