Skip to content

Commit fde14ee

Browse files
committed
Merge branch 'pci/bridge-class-codes'
- Add and use #defines for normal and subtractive PCI bridges (Pali Rohár) - Set all 24 bits of PCI class code for iproc (Pali Rohár) * pci/bridge-class-codes: PCI: iproc: Set all 24 bits of PCI class code PCI: Add defines for normal and subtractive PCI bridges
2 parents 05ca7e5 + fe66581 commit fde14ee

24 files changed

Lines changed: 42 additions & 42 deletions

arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,8 +1380,6 @@
13801380

13811381
#define PCIE_IDVAL3_REG 0x43c
13821382
#define IDVAL3_CLASS_CODE_MASK 0xffffff
1383-
#define IDVAL3_SUBCLASS_SHIFT 8
1384-
#define IDVAL3_CLASS_SHIFT 16
13851383

13861384
#define PCIE_DLSTATUS_REG 0x1048
13871385
#define DLSTATUS_PHYLINKUP (1 << 13)

arch/mips/pci/fixup-sb1250.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_PCI,
7575
*/
7676
static void quirk_sb1250_ht(struct pci_dev *dev)
7777
{
78-
dev->class = PCI_CLASS_BRIDGE_PCI << 8;
78+
dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL;
7979
}
8080
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_HT,
8181
quirk_sb1250_ht);

arch/mips/pci/pci-bcm63xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int __init bcm63xx_register_pcie(void)
186186
/* setup class code as bridge */
187187
val = bcm_pcie_readl(PCIE_IDVAL3_REG);
188188
val &= ~IDVAL3_CLASS_CODE_MASK;
189-
val |= (PCI_CLASS_BRIDGE_PCI << IDVAL3_SUBCLASS_SHIFT);
189+
val |= PCI_CLASS_BRIDGE_PCI_NORMAL;
190190
bcm_pcie_writel(val, PCIE_IDVAL3_REG);
191191

192192
/* disable bar1 size */

arch/powerpc/platforms/powernv/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ void pnv_pci_shutdown(void)
815815
/* Fixup wrong class code in p7ioc and p8 root complex */
816816
static void pnv_p7ioc_rc_quirk(struct pci_dev *dev)
817817
{
818-
dev->class = PCI_CLASS_BRIDGE_PCI << 8;
818+
dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL;
819819
}
820820
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, pnv_p7ioc_rc_quirk);
821821

arch/powerpc/sysdev/fsl_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void quirk_fsl_pcie_early(struct pci_dev *dev)
5555
if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE)
5656
return;
5757

58-
dev->class = PCI_CLASS_BRIDGE_PCI << 8;
58+
dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL;
5959
fsl_pcie_bus_fixup = 1;
6060
return;
6161
}

arch/sh/drivers/pci/pcie-sh7786.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
314314
* class to match. Hardware takes care of propagating the IDSETR
315315
* settings, so there is no need to bother with a quirk.
316316
*/
317-
pci_write_reg(chan, PCI_CLASS_BRIDGE_PCI << 16, SH4A_PCIEIDSETR1);
317+
pci_write_reg(chan, PCI_CLASS_BRIDGE_PCI_NORMAL << 8, SH4A_PCIEIDSETR1);
318318

319319
/* Initialize default capabilities. */
320320
data = pci_read_reg(chan, SH4A_PCIEEXPCAP0);

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,13 @@ static void ks_pcie_quirk(struct pci_dev *dev)
531531
struct pci_dev *bridge;
532532
static const struct pci_device_id rc_pci_devids[] = {
533533
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2HK),
534-
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
534+
.class = PCI_CLASS_BRIDGE_PCI_NORMAL, .class_mask = ~0, },
535535
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2E),
536-
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
536+
.class = PCI_CLASS_BRIDGE_PCI_NORMAL, .class_mask = ~0, },
537537
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2L),
538-
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
538+
.class = PCI_CLASS_BRIDGE_PCI_NORMAL, .class_mask = ~0, },
539539
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2G),
540-
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
540+
.class = PCI_CLASS_BRIDGE_PCI_NORMAL, .class_mask = ~0, },
541541
{ 0, },
542542
};
543543

drivers/pci/controller/dwc/pci-meson.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,14 @@ static int meson_pcie_rd_own_conf(struct pci_bus *bus, u32 devfn,
313313
* cannot program the PCI_CLASS_DEVICE register, so we must fabricate
314314
* the return value in the config accessors.
315315
*/
316-
if (where == PCI_CLASS_REVISION && size == 4)
317-
*val = (PCI_CLASS_BRIDGE_PCI << 16) | (*val & 0xffff);
318-
else if (where == PCI_CLASS_DEVICE && size == 2)
319-
*val = PCI_CLASS_BRIDGE_PCI;
320-
else if (where == PCI_CLASS_DEVICE && size == 1)
321-
*val = PCI_CLASS_BRIDGE_PCI & 0xff;
322-
else if (where == PCI_CLASS_DEVICE + 1 && size == 1)
323-
*val = (PCI_CLASS_BRIDGE_PCI >> 8) & 0xff;
316+
if ((where & ~3) == PCI_CLASS_REVISION) {
317+
if (size <= 2)
318+
*val = (*val & ((1 << (size * 8)) - 1)) << (8 * (where & 3));
319+
*val &= ~0xffffff00;
320+
*val |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
321+
if (size <= 2)
322+
*val = (*val >> (8 * (where & 3))) & ((1 << (size * 8)) - 1);
323+
}
324324

325325
return PCIBIOS_SUCCESSFUL;
326326
}

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ static const struct of_device_id qcom_pcie_match[] = {
16341634

16351635
static void qcom_fixup_class(struct pci_dev *dev)
16361636
{
1637-
dev->class = PCI_CLASS_BRIDGE_PCI << 8;
1637+
dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL;
16381638
}
16391639
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0101, qcom_fixup_class);
16401640
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, 0x0104, qcom_fixup_class);

drivers/pci/controller/mobiveil/pcie-mobiveil-host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit)
295295
/* fixup for PCIe class register */
296296
value = mobiveil_csr_readl(pcie, PAB_INTP_AXI_PIO_CLASS);
297297
value &= 0xff;
298-
value |= (PCI_CLASS_BRIDGE_PCI << 16);
298+
value |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
299299
mobiveil_csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS);
300300

301301
return 0;

0 commit comments

Comments
 (0)