]> git.baikalelectronics.ru Git - uboot.git/commitdiff
pci: Add defines for normal and subtractive PCI bridges
authorPali Rohár <pali@kernel.org>
Fri, 18 Feb 2022 12:18:40 +0000 (13:18 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 25 Mar 2022 17:35:50 +0000 (13:35 -0400)
Add following two new PCI class codes defines into pci_ids.h include file:

  PCI_CLASS_BRIDGE_PCI_NORMAL
  PCI_CLASS_BRIDGE_PCI_SUBTRACTIVE

And use these defines in all U-Boot code for describing PCI class codes for
normal and subtractive PCI bridges.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
board/armltd/vexpress64/pcie.c
drivers/pci/pci-aardvark.c
drivers/pci/pci-rcar-gen3.c
drivers/pci/pci_mvebu.c
drivers/pci/pci_tegra.c
drivers/pci/pcie_dw_mvebu.c
drivers/pci/pcie_fsl.c
drivers/pci/pcie_imx.c
drivers/pci/pcie_iproc.c
drivers/pci/pcie_rockchip.c
include/pci_ids.h

index 1e74158630b5e9b9a7dc557b28060842c4947cb3..e553da86e0e04feb7a1324630ded77f81d7755da 100644 (file)
@@ -150,7 +150,7 @@ static void xr3pci_init(void)
        /* allow ECRC */
        writel(0x6006, XR3_CONFIG_BASE + XR3PCI_PEX_SPC2);
        /* setup the correct class code for the host bridge */
-       writel(PCI_CLASS_BRIDGE_PCI << 16, XR3_CONFIG_BASE + XR3PCI_BRIDGE_PCI_IDS);
+       writel(PCI_CLASS_BRIDGE_PCI_NORMAL << 8, XR3_CONFIG_BASE + XR3PCI_BRIDGE_PCI_IDS);
 
        /* reset phy and root complex */
        writel(JUNO_RESET_CTRL_PHY | JUNO_RESET_CTRL_RC,
index 4f7e61ecf166263deda69ef973799ec0051943f6..b0fc9caabbec70fd0232a31ce714124ef23f6a09 100644 (file)
@@ -800,7 +800,7 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie)
         */
        reg = advk_readl(pcie, ADVK_ROOT_PORT_PCI_CFG_OFF + PCI_CLASS_REVISION);
        reg &= ~0xffffff00;
-       reg |= (PCI_CLASS_BRIDGE_PCI << 8) << 8;
+       reg |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
        advk_writel(pcie, reg, ADVK_ROOT_PORT_PCI_CFG_OFF + PCI_CLASS_REVISION);
 
        /* Enable generation and checking of ECRC on PCIe Root Port */
index 34a561ef8b4beb50e4d0df261f6da62df7821435..49029238d350c8241f85e860b3ea1ff6be9f774d 100644 (file)
@@ -289,7 +289,7 @@ static int rcar_gen3_pcie_hw_init(struct udevice *dev)
         * class to match. Hardware takes care of propagating the IDSETR
         * settings, so there is no need to bother with a quirk.
         */
-       writel(PCI_CLASS_BRIDGE_PCI << 16, priv->regs + IDSETR1);
+       writel(PCI_CLASS_BRIDGE_PCI_NORMAL << 8, priv->regs + IDSETR1);
 
        /*
         * Setup Secondary Bus Number & Subordinate Bus Number, even though
index f07669374d703673a4961a22c8bcf9ef99bf497f..d80f87e0cfc60cc15389cc85a6bec4a803accd06 100644 (file)
@@ -440,7 +440,7 @@ static int mvebu_pcie_probe(struct udevice *dev)
         */
        reg = readl(pcie->base + MVPCIE_ROOT_PORT_PCI_CFG_OFF + PCI_CLASS_REVISION);
        reg &= ~0xffffff00;
-       reg |= (PCI_CLASS_BRIDGE_PCI << 8) << 8;
+       reg |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
        writel(reg, pcie->base + MVPCIE_ROOT_PORT_PCI_CFG_OFF + PCI_CLASS_REVISION);
 
        /*
index fc05ee00f1fcdb0f837c9e73afa5bb6ff2506b86..f8d66c0e1c6a8528490a61f699a1dcc2f9564b1d 100644 (file)
@@ -325,8 +325,8 @@ static int pci_tegra_read_config(const struct udevice *bus, pci_dev_t bdf,
        /* fixup root port class */
        if (PCI_BUS(bdf) == 0) {
                if ((offset & ~3) == PCI_CLASS_REVISION) {
-                       value &= ~0x00ff0000;
-                       value |= PCI_CLASS_BRIDGE_PCI << 16;
+                       value &= ~0x00ffff00;
+                       value |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
                }
        }
 #endif
index 0490fd3377052cde1d262dbac9af96d1632b4ac1..99891dce61d57b6656ea26cb4c2457a46f272acf 100644 (file)
@@ -539,9 +539,9 @@ static int pcie_dw_mvebu_probe(struct udevice *dev)
                                  PCIE_ATU_TYPE_MEM, pcie->mem.phys_start,
                                  pcie->mem.bus_start, pcie->mem.size);
 
-       /* Set the CLASS_REV of RC CFG header to PCI_CLASS_BRIDGE_PCI */
+       /* Set the CLASS_REV of RC CFG header to PCI_CLASS_BRIDGE_PCI_NORMAL */
        clrsetbits_le32(pcie->ctrl_base + PCI_CLASS_REVISION,
-                       0xffff << 16, PCI_CLASS_BRIDGE_PCI << 16);
+                       0xffffff << 8, PCI_CLASS_BRIDGE_PCI_NORMAL << 8);
 
        pcie_dw_set_host_bars(pcie->ctrl_base);
 
index cc6efdd5b464cacced02593c43232b3169337429..f5ba34970f15dfb6db52db9b4ca6c9e520e62ed4 100644 (file)
@@ -532,7 +532,7 @@ static int fsl_pcie_fixup_classcode(struct fsl_pcie *pcie)
 
        fsl_pcie_hose_read_config_dword(pcie, classcode_reg, &val);
        val &= 0xff;
-       val |= PCI_CLASS_BRIDGE_PCI << 16;
+       val |= PCI_CLASS_BRIDGE_PCI_NORMAL << 8;
        fsl_pcie_hose_write_config_dword(pcie, classcode_reg, val);
 
        if (pcie->block_rev >= PEX_IP_BLK_REV_3_0)
index 756166fd3eaa08c7ecbe7de461c4a087cc359466..2cec3900e9adeb0901123011d4b965c29c4afa9b 100644 (file)
@@ -300,9 +300,9 @@ static int imx_pcie_regions_setup(struct imx_pcie_priv *priv)
        setbits_le32(priv->dbi_base + PCI_COMMAND,
                     PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
 
-       /* Set the CLASS_REV of RC CFG header to PCI_CLASS_BRIDGE_PCI */
+       /* Set the CLASS_REV of RC CFG header to PCI_CLASS_BRIDGE_PCI_NORMAL */
        setbits_le32(priv->dbi_base + PCI_CLASS_REVISION,
-                    PCI_CLASS_BRIDGE_PCI << 16);
+                    PCI_CLASS_BRIDGE_PCI_NORMAL << 8);
 
        /* Region #0 is used for Outbound CFG space access. */
        writel(0, priv->dbi_base + PCIE_ATU_VIEWPORT);
index 85dfab5c720f41d23a4614e9141241f8a136d935..d6d3a9e202505d00d09152c8223e6fa93b6e6779 100644 (file)
@@ -1123,7 +1123,7 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie)
                                    PCI_BRIDGE_CTRL_REG_OFFSET,
                                    4, &class);
        class &= ~PCI_BRIDGE_CTRL_REG_CLASS_MASK;
-       class |= (PCI_CLASS_BRIDGE_PCI << 8);
+       class |= PCI_CLASS_BRIDGE_PCI_NORMAL;
        iproc_pci_raw_config_write32(pcie, 0,
                                     PCI_BRIDGE_CTRL_REG_OFFSET,
                                     4, class);
index 67039d2a29f8197c460c5f002abbbe524185aa65..72b41398f27bcd2e085799fa93b8954131b2c7fd 100644 (file)
@@ -351,7 +351,7 @@ static int rockchip_pcie_init_port(struct udevice *dev)
 
        /* Initialize Root Complex registers. */
        writel(PCIE_LM_VENDOR_ROCKCHIP, priv->apb_base + PCIE_LM_VENDOR_ID);
-       writel(PCI_CLASS_BRIDGE_PCI << 16,
+       writel(PCI_CLASS_BRIDGE_PCI_NORMAL << 8,
               priv->apb_base + PCIE_RC_BASE + PCI_CLASS_REVISION);
        writel(PCIE_LM_RCBARPIE | PCIE_LM_RCBARPIS,
               priv->apb_base + PCIE_LM_RCBAR);
index 3c5434c0eda89590906cba1306d774ef63394d66..88b0a640458537da86ab4fc8e5423c4df1bb46df 100644 (file)
@@ -55,6 +55,8 @@
 #define PCI_CLASS_BRIDGE_EISA          0x0602
 #define PCI_CLASS_BRIDGE_MC            0x0603
 #define PCI_CLASS_BRIDGE_PCI           0x0604
+#define PCI_CLASS_BRIDGE_PCI_NORMAL            0x060400
+#define PCI_CLASS_BRIDGE_PCI_SUBTRACTIVE       0x060401
 #define PCI_CLASS_BRIDGE_PCMCIA                0x0605
 #define PCI_CLASS_BRIDGE_NUBUS         0x0606
 #define PCI_CLASS_BRIDGE_CARDBUS       0x0607