Skip to content

Commit 8ea673a

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: pci-bridge-emul: Add definitions for missing capabilities registers
pci-bridge-emul driver already allocates buffer for capabilities up to the PCI_EXP_SLTSTA2 register, but does not define bit access behavior for these registers. Add these missing definitions. Link: https://lore.kernel.org/r/20211130172913.9727-3-kabel@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 9319230 commit 8ea673a

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

drivers/pci/pci-bridge-emul.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,49 @@ struct pci_bridge_reg_behavior pcie_cap_regs_behavior[PCI_CAP_PCIE_SIZEOF / 4] =
251251
.ro = GENMASK(15, 0) | PCI_EXP_RTSTA_PENDING,
252252
.w1c = PCI_EXP_RTSTA_PME,
253253
},
254+
255+
[PCI_EXP_DEVCAP2 / 4] = {
256+
/*
257+
* Device capabilities 2 register has reserved bits [30:27].
258+
* Also bits [26:24] are reserved for non-upstream ports.
259+
*/
260+
.ro = BIT(31) | GENMASK(23, 0),
261+
},
262+
263+
[PCI_EXP_DEVCTL2 / 4] = {
264+
/*
265+
* Device control 2 register is RW. Bit 11 is reserved for
266+
* non-upstream ports.
267+
*
268+
* Device status 2 register is reserved.
269+
*/
270+
.rw = GENMASK(15, 12) | GENMASK(10, 0),
271+
},
272+
273+
[PCI_EXP_LNKCAP2 / 4] = {
274+
/* Link capabilities 2 register has reserved bits [30:25] and 0. */
275+
.ro = BIT(31) | GENMASK(24, 1),
276+
},
277+
278+
[PCI_EXP_LNKCTL2 / 4] = {
279+
/*
280+
* Link control 2 register is RW.
281+
*
282+
* Link status 2 register has bits 5, 15 W1C;
283+
* bits 10, 11 reserved and others are RO.
284+
*/
285+
.rw = GENMASK(15, 0),
286+
.w1c = (BIT(15) | BIT(5)) << 16,
287+
.ro = (GENMASK(14, 12) | GENMASK(9, 6) | GENMASK(4, 0)) << 16,
288+
},
289+
290+
[PCI_EXP_SLTCAP2 / 4] = {
291+
/* Slot capabilities 2 register is reserved. */
292+
},
293+
294+
[PCI_EXP_SLTCTL2 / 4] = {
295+
/* Both Slot control 2 and Slot status 2 registers are reserved. */
296+
},
254297
};
255298

256299
/*

0 commit comments

Comments
 (0)