]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
PCI: dwc: Move dw_pcie_setup_rc() to DWC common code
authorRob Herring <robh@kernel.org>
Thu, 5 Nov 2020 21:11:55 +0000 (15:11 -0600)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 19 Nov 2020 10:51:41 +0000 (10:51 +0000)
All RC complex drivers must call dw_pcie_setup_rc(). The ordering of the
call shouldn't be too important other than being after any RC resets.

There's a few calls of dw_pcie_setup_rc() left as drivers implementing
suspend/resume need it.

Link: https://lore.kernel.org/r/20201105211159.1814485-13-robh@kernel.org
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Minghuan Lian <minghuan.Lian@nxp.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Roy Zang <roy.zang@nxp.com>
Cc: Yue Wang <yue.wang@Amlogic.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Cc: Xiaowei Song <songxiaowei@hisilicon.com>
Cc: Binghui Wang <wangbinghui@hisilicon.com>
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
15 files changed:
drivers/pci/controller/dwc/pci-dra7xx.c
drivers/pci/controller/dwc/pci-exynos.c
drivers/pci/controller/dwc/pci-imx6.c
drivers/pci/controller/dwc/pci-keystone.c
drivers/pci/controller/dwc/pci-layerscape.c
drivers/pci/controller/dwc/pci-meson.c
drivers/pci/controller/dwc/pcie-armada8k.c
drivers/pci/controller/dwc/pcie-artpec6.c
drivers/pci/controller/dwc/pcie-designware-host.c
drivers/pci/controller/dwc/pcie-designware-plat.c
drivers/pci/controller/dwc/pcie-histb.c
drivers/pci/controller/dwc/pcie-kirin.c
drivers/pci/controller/dwc/pcie-qcom.c
drivers/pci/controller/dwc/pcie-spear13xx.c
drivers/pci/controller/dwc/pcie-uniphier.c

index 72a5a2bf933bc7b15989b266bcba2ff3c27a92e1..b105af63854a3da082b4a43b6aa97292abf3b9a4 100644 (file)
@@ -181,7 +181,6 @@ static int dra7xx_pcie_host_init(struct pcie_port *pp)
        struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
        struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
 
-       dw_pcie_setup_rc(pp);
        dra7xx_pcie_enable_interrupts(dra7xx);
 
        return 0;
index 3939fe22e8a2069a5aed5b13775674def5c91781..5c10a5432896cad3827d661b156ab6e88c62af14 100644 (file)
@@ -372,7 +372,6 @@ static int exynos_pcie_host_init(struct pcie_port *pp)
        phy_init(ep->phy);
 
        exynos_pcie_deassert_core_reset(ep);
-       dw_pcie_setup_rc(pp);
        exynos_pcie_assert_reset(ep);
 
        exynos_pcie_enable_interrupts(ep);
index 9e30fbf4efbe5c2deaf0729673edf810620e972d..f9547bb2cf1bd0c36be83d8a1ff8c08d2d7997c4 100644 (file)
@@ -834,7 +834,6 @@ static int imx6_pcie_host_init(struct pcie_port *pp)
        imx6_pcie_init_phy(imx6_pcie);
        imx6_pcie_deassert_core_reset(imx6_pcie);
        imx6_setup_phy_mpll(imx6_pcie);
-       dw_pcie_setup_rc(pp);
 
        return 0;
 }
index 90b222b020a39962d24317c108f5417282666a05..5a4bcc2b1ddb5b1a3f0ae47553540c9e0ed24d01 100644 (file)
@@ -807,8 +807,6 @@ static int __init ks_pcie_host_init(struct pcie_port *pp)
        if (ret)
                return ret;
 
-       dw_pcie_setup_rc(pp);
-
        ks_pcie_stop_link(pci);
        ks_pcie_setup_rc_app_regs(ks_pcie);
        writew(PCI_IO_RANGE_TYPE_32 | (PCI_IO_RANGE_TYPE_32 << 8),
index 0d84986c4c164f670b0e7f8c76d2fd195d82e19f..400ebbebd00f40237880622f0694c70d071088cd 100644 (file)
@@ -136,8 +136,6 @@ static int ls_pcie_host_init(struct pcie_port *pp)
 
        ls_pcie_drop_msg_tlp(pcie);
 
-       dw_pcie_setup_rc(pp);
-
        return 0;
 }
 
index 2df0adcf0bf228a58761318b9f163b0780c619fc..04589f0decb235bbe46e983c5bbabc0e997db2c3 100644 (file)
@@ -380,8 +380,6 @@ static int meson_pcie_host_init(struct pcie_port *pp)
        meson_set_max_payload(mp, MAX_PAYLOAD_SIZE);
        meson_set_max_rd_req_size(mp, MAX_READ_REQ_SIZE);
 
-       dw_pcie_setup_rc(pp);
-
        return 0;
 }
 
index dd2926bbb9017fa1cbb7948a66a1032a320bfa3b..4e2552dcf982775e4c5d2c1c39b4003bce4a5460 100644 (file)
@@ -171,8 +171,6 @@ static int armada8k_pcie_host_init(struct pcie_port *pp)
        u32 reg;
        struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
 
-       dw_pcie_setup_rc(pp);
-
        if (!dw_pcie_link_up(pci)) {
                /* Disable LTSSM state machine to enable configuration */
                reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG);
index 7ee8f3c83f8f3f5b15737275bff1061bb21cd6a0..fcba9915a6067f1a516abedf631139205207a0e2 100644 (file)
@@ -328,7 +328,6 @@ static int artpec6_pcie_host_init(struct pcie_port *pp)
        artpec6_pcie_init_phy(artpec6_pcie);
        artpec6_pcie_deassert_core_reset(artpec6_pcie);
        artpec6_pcie_wait_for_phy(artpec6_pcie);
-       dw_pcie_setup_rc(pp);
 
        return 0;
 }
index ebea2c8144488e1a7980b7b3485b7f2c976de5c3..f2b0a15ad72baf672c27cb034b0f7fd1ccb2e134 100644 (file)
@@ -422,6 +422,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
                        goto err_free_msi;
        }
 
+       dw_pcie_setup_rc(pp);
        dw_pcie_msi_init(pp);
 
        if (!dw_pcie_link_up(pci) && pci->ops->start_link) {
index dec24e595c3e09e7f0f5e6b7a4d6d3478c2e814a..9b397c807261ccbdbdbacae72f00e38cbf1fd662 100644 (file)
@@ -33,15 +33,7 @@ struct dw_plat_pcie_of_data {
 
 static const struct of_device_id dw_plat_pcie_of_match[];
 
-static int dw_plat_pcie_host_init(struct pcie_port *pp)
-{
-       dw_pcie_setup_rc(pp);
-
-       return 0;
-}
-
 static const struct dw_pcie_host_ops dw_plat_pcie_host_ops = {
-       .host_init = dw_plat_pcie_host_init,
 };
 
 static int dw_plat_pcie_establish_link(struct dw_pcie *pci)
index 210777c793ea050518dc8f8a63a026728b290360..86f9d16c50d75f85976cfb1f3dccb846a0512ef4 100644 (file)
@@ -196,9 +196,6 @@ static int histb_pcie_host_init(struct pcie_port *pp)
        regval |= PCIE_WM_RC;
        histb_pcie_writel(hipcie, PCIE_SYS_CTRL0, regval);
 
-       /* setup root complex */
-       dw_pcie_setup_rc(pp);
-
        return 0;
 }
 
index f84ac1b36b2cc6c662c2bcc8e4dd1ac9ccfde217..ac4bbdaf53245a0bb9afd73d3e320599444f17d9 100644 (file)
@@ -405,8 +405,6 @@ static int kirin_pcie_host_init(struct pcie_port *pp)
 {
        pp->bridge->ops = &kirin_pci_ops;
 
-       dw_pcie_setup_rc(pp);
-
        return 0;
 }
 
index eb107179d5445d6ff6713c9bd430d58330d67de7..e49791c4f846505afcf70d4684587ead5c23ea49 100644 (file)
@@ -1280,7 +1280,6 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
                        goto err_disable_phy;
        }
 
-       dw_pcie_setup_rc(pp);
        qcom_ep_reset_deassert(pcie);
 
        return 0;
index 31475e4493a707ac84bab657c4b01d0c84768328..1a9e353bef554f6beadd6fe74c5c18f654081b5b 100644 (file)
@@ -130,8 +130,6 @@ static int spear13xx_pcie_host_init(struct pcie_port *pp)
 
        spear13xx_pcie->app_base = pci->dbi_base + 0x2000;
 
-       dw_pcie_setup_rc(pp);
-
        /*
         * this controller support only 128 bytes read size, however its
         * default value in capability register is 512 bytes. So force
index e6616408a29c166e88f27d99007905ce53b0376e..2457e9dd098deba00a7731896f3cab13e2050493 100644 (file)
@@ -314,8 +314,6 @@ static int uniphier_pcie_host_init(struct pcie_port *pp)
 
        uniphier_pcie_irq_enable(priv);
 
-       dw_pcie_setup_rc(pp);
-
        return 0;
 }