Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pali Rohár and committed by
Bjorn Helgaas
fe665816 904b10fb

+4 -5
+4 -5
drivers/pci/controller/pcie-iproc.c
··· 789 789 return -EFAULT; 790 790 } 791 791 792 - /* force class to PCI_CLASS_BRIDGE_PCI (0x0604) */ 792 + /* force class to PCI_CLASS_BRIDGE_PCI_NORMAL (0x060400) */ 793 793 #define PCI_BRIDGE_CTRL_REG_OFFSET 0x43c 794 - #define PCI_CLASS_BRIDGE_MASK 0xffff00 795 - #define PCI_CLASS_BRIDGE_SHIFT 8 794 + #define PCI_BRIDGE_CTRL_REG_CLASS_MASK 0xffffff 796 795 iproc_pci_raw_config_read32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET, 797 796 4, &class); 798 - class &= ~PCI_CLASS_BRIDGE_MASK; 799 - class |= (PCI_CLASS_BRIDGE_PCI << PCI_CLASS_BRIDGE_SHIFT); 797 + class &= ~PCI_BRIDGE_CTRL_REG_CLASS_MASK; 798 + class |= PCI_CLASS_BRIDGE_PCI_NORMAL; 800 799 iproc_pci_raw_config_write32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET, 801 800 4, class); 802 801