[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/65] hw/pci-bridge/cxl_upstream: Provide x-speed and x-width pro
From: |
Michael S. Tsirkin |
Subject: |
[PULL 16/65] hw/pci-bridge/cxl_upstream: Provide x-speed and x-width properties. |
Date: |
Mon, 4 Nov 2024 16:06:32 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Copied from gen_pcie_root_port.c
Drop the previous code that ensured a valid value in s->width, s->speed
as now a default is provided so this will always be set.
Note this changes the default settings but it is unlikely to have a negative
effect on software as will only affect ports with now downstream device.
All other ports will use the settings from that device.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240916173518.1843023-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/pci-bridge/cxl_downstream.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/hw/pci-bridge/cxl_downstream.c b/hw/pci-bridge/cxl_downstream.c
index 4b42984360..c347ac06f3 100644
--- a/hw/pci-bridge/cxl_downstream.c
+++ b/hw/pci-bridge/cxl_downstream.c
@@ -13,6 +13,8 @@
#include "hw/pci/msi.h"
#include "hw/pci/pcie.h"
#include "hw/pci/pcie_port.h"
+#include "hw/qdev-properties.h"
+#include "hw/qdev-properties-system.h"
#include "hw/cxl/cxl.h"
#include "qapi/error.h"
@@ -210,24 +212,20 @@ static void cxl_dsp_exitfn(PCIDevice *d)
pci_bridge_exitfn(d);
}
-static void cxl_dsp_instance_post_init(Object *obj)
-{
- PCIESlot *s = PCIE_SLOT(obj);
-
- if (!s->speed) {
- s->speed = QEMU_PCI_EXP_LNK_2_5GT;
- }
-
- if (!s->width) {
- s->width = QEMU_PCI_EXP_LNK_X1;
- }
-}
+static Property cxl_dsp_props[] = {
+ DEFINE_PROP_PCIE_LINK_SPEED("x-speed", PCIESlot,
+ speed, PCIE_LINK_SPEED_64),
+ DEFINE_PROP_PCIE_LINK_WIDTH("x-width", PCIESlot,
+ width, PCIE_LINK_WIDTH_16),
+ DEFINE_PROP_END_OF_LIST()
+};
static void cxl_dsp_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
PCIDeviceClass *k = PCI_DEVICE_CLASS(oc);
+ device_class_set_props(dc, cxl_dsp_props);
k->config_write = cxl_dsp_config_write;
k->realize = cxl_dsp_realize;
k->exit = cxl_dsp_exitfn;
@@ -243,7 +241,6 @@ static const TypeInfo cxl_dsp_info = {
.name = TYPE_CXL_DSP,
.instance_size = sizeof(CXLDownstreamPort),
.parent = TYPE_PCIE_SLOT,
- .instance_post_init = cxl_dsp_instance_post_init,
.class_init = cxl_dsp_class_init,
.interfaces = (InterfaceInfo[]) {
{ INTERFACE_PCIE_DEVICE },
--
MST
- [PULL 08/65] acpi/pci: Move Generic Initiator object handling into acpi/pci.*, (continued)
- [PULL 08/65] acpi/pci: Move Generic Initiator object handling into acpi/pci.*, Michael S. Tsirkin, 2024/11/04
- [PULL 09/65] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS, Michael S. Tsirkin, 2024/11/04
- [PULL 10/65] hw/i386/acpi: Use TYPE_PXB_BUS property acpi_uid for DSDT, Michael S. Tsirkin, 2024/11/04
- [PULL 11/65] hw/pci-host/gpex-acpi: Use acpi_uid property., Michael S. Tsirkin, 2024/11/04
- [PULL 12/65] hw/acpi: Generic Port Affinity Structure support, Michael S. Tsirkin, 2024/11/04
- [PULL 13/65] hw/acpi: Make storage of node id uint32_t to reduce fragility, Michael S. Tsirkin, 2024/11/04
- [PULL 14/65] hw/acpi: Generic Initiator - add missing object class property descriptions., Michael S. Tsirkin, 2024/11/04
- [PULL 15/65] hw/pci-bridge/cxl_root_port: Provide x-speed and x-width properties., Michael S. Tsirkin, 2024/11/04
- [PULL 16/65] hw/pci-bridge/cxl_upstream: Provide x-speed and x-width properties.,
Michael S. Tsirkin <=
- [PULL 17/65] hw/pcie: Factor out PCI Express link register filling common to EP., Michael S. Tsirkin, 2024/11/04
- [PULL 18/65] hw/pcie: Provide a utility function for control of EP / SW USP link, Michael S. Tsirkin, 2024/11/04
- [PULL 19/65] hw/mem/cxl-type3: Add properties to control link speed and width, Michael S. Tsirkin, 2024/11/04
- [PULL 20/65] hw/pci-bridge/cxl-upstream: Add properties to control link speed and width, Michael S. Tsirkin, 2024/11/04
- [PULL 21/65] qdev-monitor: add option to report GenericError from find_device_state, Michael S. Tsirkin, 2024/11/04
- [PULL 22/65] vhost-user-blk: split vhost_user_blk_sync_config(), Michael S. Tsirkin, 2024/11/04
- [PULL 23/65] qapi: introduce device-sync-config, Michael S. Tsirkin, 2024/11/04
- [PULL 24/65] acpi/disassemle-aml.sh: fix up after dir reorg, Michael S. Tsirkin, 2024/11/04