101
102
pci_bridge_reset(qdev);
103
pcie_cap_deverr_reset(d);
104
- pcie_cap_fill_link_ep_usp(d, usp->width, usp->speed);
104
+ pcie_cap_fill_link_ep_usp(d, usp->width, usp->speed, usp->flitmode);
105
latch_registers(usp);
106
}
107
108
-static void build_dvsecs(CXLComponentState *cxl)
108
+static void build_dvsecs(CXLUpstreamPort *usp)
109
{
110
+ CXLComponentState *cxl_cstate = &usp->cxl_cstate;
111
uint8_t *dvsec;
112
113
dvsec = (uint8_t *)&(CXLDVSECPortExt){
114
.status = 0x1, /* Port Power Management Init Complete */
115
};
115
- cxl_component_create_dvsec(cxl, CXL2_UPSTREAM_PORT,
116
+ cxl_component_create_dvsec(cxl_cstate, CXL2_UPSTREAM_PORT,
117
EXTENSIONS_PORT_DVSEC_LENGTH,
118
EXTENSIONS_PORT_DVSEC,
119
EXTENSIONS_PORT_DVSEC_REVID, dvsec);
120
dvsec = (uint8_t *)&(CXLDVSECPortFlexBus){
121
.cap = 0x27, /* Cache, IO, Mem, non-MLD */
122
.ctrl = 0x27, /* Cache, IO, Mem */
122
- .status = 0x26, /* same */
123
+ .status = usp->flitmode ? 0x6 : 0x26, /* lack of 68B */
124
.rcvd_mod_ts_data_phase1 = 0xef, /* WTF? */
125
};
125
- cxl_component_create_dvsec(cxl, CXL2_UPSTREAM_PORT,
126
+ cxl_component_create_dvsec(cxl_cstate, CXL2_UPSTREAM_PORT,
127
PCIE_CXL3_FLEXBUS_PORT_DVSEC_LENGTH,
128
PCIE_FLEXBUS_PORT_DVSEC,
129
PCIE_CXL3_FLEXBUS_PORT_DVSEC_REVID, dvsec);
133
.reg0_base_lo = RBI_COMPONENT_REG | CXL_COMPONENT_REG_BAR_IDX,
134
.reg0_base_hi = 0,
135
};
135
- cxl_component_create_dvsec(cxl, CXL2_UPSTREAM_PORT,
136
+ cxl_component_create_dvsec(cxl_cstate, CXL2_UPSTREAM_PORT,
137
REG_LOC_DVSEC_LENGTH, REG_LOC_DVSEC,
138
REG_LOC_DVSEC_REVID, dvsec);
139
}
328
}
329
cxl_cstate->dvsec_offset = CXL_UPSTREAM_PORT_DVSEC_OFFSET;
330
cxl_cstate->pdev = d;
330
- build_dvsecs(cxl_cstate);
331
+ build_dvsecs(usp);
332
cxl_component_register_block_init(OBJECT(d), cxl_cstate, TYPE_CXL_USP);
333
pci_register_bar(d, CXL_COMPONENT_REG_BAR_IDX,
334
PCI_BASE_ADDRESS_SPACE_MEMORY |
370
speed, PCIE_LINK_SPEED_32),
371
DEFINE_PROP_PCIE_LINK_WIDTH("x-width", CXLUpstreamPort,
372
width, PCIE_LINK_WIDTH_16),
373
+ DEFINE_PROP_BOOL("x-256b-flit", CXLUpstreamPort, flitmode, false),
374
};
375
376
static void cxl_upstream_class_init(ObjectClass *oc, const void *data)