summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/pcie-iproc.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-02-14 14:41:09 +0300
committerBjorn Helgaas <bhelgaas@google.com>2022-02-18 00:30:01 +0300
commitfe665816e0d4ff4945c8ca720278023a4d05a6b3 (patch)
tree9f870458e6d2be584b045e5ee9ad002a07940905 /drivers/pci/controller/pcie-iproc.c
parent904b10fb189cc15376e9bfce1ef0282e68b0b004 (diff)
downloadlinux-fe665816e0d4ff4945c8ca720278023a4d05a6b3.tar.xz
PCI: iproc: Set all 24 bits of PCI class code
Register 0x43c in its low 24 bits contains PCI class code. Update code to set all 24 bits of PCI class code and not only upper 16 bits of PCI class code. Use a new macro PCI_CLASS_BRIDGE_PCI_NORMAL which represents whole 24 bits of normal PCI bridge class. Link: https://lore.kernel.org/r/20220214114109.26809-2-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Roman Bacik <roman.bacik@broadcom.com> Acked-by: Ray Jui <ray.jui@broadcom.com>
Diffstat (limited to 'drivers/pci/controller/pcie-iproc.c')
-rw-r--r--drivers/pci/controller/pcie-iproc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c
index 3df4ab209253..2519201b0e51 100644
--- a/drivers/pci/controller/pcie-iproc.c
+++ b/drivers/pci/controller/pcie-iproc.c
@@ -789,14 +789,13 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie)
return -EFAULT;
}
- /* force class to PCI_CLASS_BRIDGE_PCI (0x0604) */
+ /* force class to PCI_CLASS_BRIDGE_PCI_NORMAL (0x060400) */
#define PCI_BRIDGE_CTRL_REG_OFFSET 0x43c
-#define PCI_CLASS_BRIDGE_MASK 0xffff00
-#define PCI_CLASS_BRIDGE_SHIFT 8
+#define PCI_BRIDGE_CTRL_REG_CLASS_MASK 0xffffff
iproc_pci_raw_config_read32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET,
4, &class);
- class &= ~PCI_CLASS_BRIDGE_MASK;
- class |= (PCI_CLASS_BRIDGE_PCI << PCI_CLASS_BRIDGE_SHIFT);
+ class &= ~PCI_BRIDGE_CTRL_REG_CLASS_MASK;
+ class |= PCI_CLASS_BRIDGE_PCI_NORMAL;
iproc_pci_raw_config_write32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET,
4, class);