[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 53/63] hw/pci-bridge/cxl_downstream: Set default link width and li
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL 53/63] hw/pci-bridge/cxl_downstream: Set default link width and link speed |
|
Date: |
Tue, 7 Nov 2023 05:13:22 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Without these being set the PCIE Link Capabilities register has
invalid values in these two fields.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20231023160806.13206-10-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 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/pci-bridge/cxl_downstream.c b/hw/pci-bridge/cxl_downstream.c
index 8d99e1e96d..405a133eef 100644
--- a/hw/pci-bridge/cxl_downstream.c
+++ b/hw/pci-bridge/cxl_downstream.c
@@ -210,6 +210,19 @@ 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 void cxl_dsp_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
@@ -230,6 +243,7 @@ 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 38/63] tests: bios-tables-test: Add test for smbios type4 thread count2, (continued)
- [PULL 38/63] tests: bios-tables-test: Add test for smbios type4 thread count2, Michael S. Tsirkin, 2023/11/07
- [PULL 43/63] hw/cxl: Line length reductions, Michael S. Tsirkin, 2023/11/07
- [PULL 42/63] hw/cxl: CXLDVSECPortExtensions renamed to CXLDVSECPortExt, Michael S. Tsirkin, 2023/11/07
- [PULL 45/63] hw/cxl/mbox: Pull the payload out of struct cxl_cmd and make instances constant, Michael S. Tsirkin, 2023/11/07
- [PULL 44/63] hw/cxl: Fix a QEMU_BUILD_BUG_ON() in switch statement scope issue., Michael S. Tsirkin, 2023/11/07
- [PULL 47/63] hw/cxl/mbox: Pull the CCI definition out of the CXLDeviceState, Michael S. Tsirkin, 2023/11/07
- [PULL 46/63] hw/cxl/mbox: Split mailbox command payload into separate input and output, Michael S. Tsirkin, 2023/11/07
- [PULL 49/63] hw/pci-bridge/cxl_upstream: Move defintion of device to header., Michael S. Tsirkin, 2023/11/07
- [PULL 50/63] hw/cxl: Add a switch mailbox CCI function, Michael S. Tsirkin, 2023/11/07
- [PULL 48/63] hw/cxl/mbox: Generalize the CCI command processing, Michael S. Tsirkin, 2023/11/07
- [PULL 53/63] hw/pci-bridge/cxl_downstream: Set default link width and link speed,
Michael S. Tsirkin <=
- [PULL 52/63] hw/cxl/mbox: Add Physical Switch Identify command., Michael S. Tsirkin, 2023/11/07
- [PULL 54/63] hw/cxl: Implement Physical Ports status retrieval, Michael S. Tsirkin, 2023/11/07
- [PULL 51/63] hw/cxl/mbox: Add Information and Status / Identify command, Michael S. Tsirkin, 2023/11/07
- [PULL 55/63] hw/cxl/mbox: Add support for background operations, Michael S. Tsirkin, 2023/11/07
- [PULL 56/63] hw/cxl/mbox: Wire up interrupts for background completion, Michael S. Tsirkin, 2023/11/07
- [PULL 57/63] hw/cxl: Add support for device sanitation, Michael S. Tsirkin, 2023/11/07