Bjorn Helgaas
43f25adf9f
Merge branch 'pci/controller/artpec6'
...
- Correct the artpec6_pcie_cpu_addr_fixup() parameter name, which takes a
CPU address but called it "pci_addr" (Niklas Cassel)
* pci/controller/artpec6:
PCI: artpec6: Fix artpec6_pcie_cpu_addr_fixup() parameter name
2024-07-19 10:10:26 -05:00
Manivannan Sadhasivam
245b9ebf7b
PCI: dwc: ep: Remove dw_pcie_ep_init_notify() wrapper
...
Currently dw_pcie_ep_init_notify() wrapper just calls pci_epc_init_notify()
directly, so this wrapper provides no benefit to the glue drivers.
Remove it and call pci_epc_init_notify() directly from glue drivers.
Suggested-by: Bjorn Helgaas <helgaas@kernel.org >
Link: https://lore.kernel.org/linux-pci/20240606-pci-deinit-v1-1-4395534520dc@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com >
Reviewed-by: Frank Li <Frank.Li@nxp.com >
Reviewed-by: Niklas Cassel <cassel@kernel.org >
2024-07-09 18:20:21 -05:00
Niklas Cassel
7903ffa440
PCI: artpec6: Fix artpec6_pcie_cpu_addr_fixup() parameter name
...
The function pointer declaration for the cpu_addr_fixup() callback uses
"cpu_addr" as parameter name.
Likewise, the argument that is supplied to the function pointer when the
function is actually called is "cpu_addr".
Rename the artpec6_pcie_cpu_addr_fixup() parameter name to match
reality.
[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20240430071054.248008-4-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
2024-05-28 11:14:35 -05:00
Manivannan Sadhasivam
a01e7214be
PCI: endpoint: Remove "core_init_notifier" flag
...
"core_init_notifier" flag is set by the glue drivers requiring refclk from
the host to complete the DWC core initialization. Also, those drivers will
send a notification to the EPF drivers once the initialization is fully
completed using the pci_epc_init_notify() API. Only then, the EPF drivers
will start functioning.
For the rest of the drivers generating refclk locally, EPF drivers will
start functioning post binding with them. EPF drivers rely on the
'core_init_notifier' flag to differentiate between the drivers.
Unfortunately, this creates two different flows for the EPF drivers.
So to avoid that, let's get rid of the "core_init_notifier" flag and follow
a single initialization flow for the EPF drivers. This is done by calling
the dw_pcie_ep_init_notify() from all glue drivers after the completion of
dw_pcie_ep_init_registers() API. This will allow all the glue drivers to
send the notification to the EPF drivers once the initialization is fully
completed.
Only difference here is that, the drivers requiring refclk from host will
send the notification once refclk is received, while others will send it
during probe time itself.
But this also requires the EPC core driver to deliver the notification
after EPF driver bind. Because, the glue driver can send the notification
before the EPF drivers bind() and in those cases the EPF drivers will miss
the event. To accommodate this, EPC core is now caching the state of the
EPC initialization in 'init_complete' flag and pci-ep-cfs driver sends the
notification to EPF drivers based on that after each EPF driver bind.
Link: https://lore.kernel.org/linux-pci/20240327-pci-dbi-rework-v12-8-082625472414@linaro.org
Tested-by: Niklas Cassel <cassel@kernel.org >
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Reviewed-by: Frank Li <Frank.Li@nxp.com >
Reviewed-by: Niklas Cassel <cassel@kernel.org >
2024-04-10 17:52:42 +00:00
Manivannan Sadhasivam
df69e17ccc
PCI: dwc: ep: Call dw_pcie_ep_init_registers() API directly from all glue drivers
...
Currently, dw_pcie_ep_init_registers() API is directly called by the glue
drivers requiring active refclk from host. But for the other drivers, it is
getting called implicitly by dw_pcie_ep_init(). This is due to the fact
that this API initializes DWC EP specific registers and that requires an
active refclk (either from host or generated locally by endpoint itsef).
But, this causes a discrepancy among the glue drivers. So to avoid this
confusion, let's call this API directly from all glue drivers irrespective
of refclk dependency. Only difference here is that the drivers requiring
refclk from host will call this API only after the refclk is received and
other drivers without refclk dependency will call this API right after
dw_pcie_ep_init().
With this change, the check for 'core_init_notifier' flag can now be
dropped from dw_pcie_ep_init() API. This will also allow us to remove the
'core_init_notifier' flag completely in the later commits.
Link: https://lore.kernel.org/linux-pci/20240327-pci-dbi-rework-v12-7-082625472414@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Reviewed-by: Frank Li <Frank.Li@nxp.com >
Reviewed-by: Niklas Cassel <cassel@kernel.org >
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
2024-04-10 17:52:11 +00:00
Bjorn Helgaas
dc14155d46
Merge branch 'pci/irq-clean-up'
...
- Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX to be more explicit and match spec
terminology (Bjorn Helgaas)
- Use existing PCI_IRQ_INTX, PCI_IRQ_MSI, PCI_IRQ_MSIX in artpec6, cadence,
designware, designware-plat, dra7xx, imx6, keembay, keystone, layerscape,
mhi, ntb, qcom, rcar, rcar-gen4, rockchip, tegra194, uniphier, vntb; drop
the redundant pci_epc_irq_type enum with the same values (Damien Le Moal)
- Use "intx" instead of "leg" or "legacy" when describing INTx interrupts
in endpoint core, endpoint tests, cadence, dra7xx, designware,
dw-rockchip, dwc core, imx6, keystone, layerscape, qcom, rcar-gen4,
rockchip, tegra194, uniphier, xilinx-nwl (Damien Le Moal)
* pci/irq-clean-up:
PCI: xilinx-nwl: Use INTX instead of legacy
PCI: rockchip-host: Rename rockchip_pcie_legacy_int_handler()
PCI: rockchip-ep: Use INTX instead of legacy
PCI: uniphier: Use INTX instead of legacy
PCI: tegra194: Use INTX instead of legacy
PCI: dw-rockchip: Rename rockchip_pcie_legacy_int_handler()
PCI: keystone: Use INTX instead of legacy
PCI: dwc: Rename dw_pcie_ep_raise_legacy_irq()
PCI: cadence: Use INTX instead of legacy
PCI: dra7xx: Rename dra7xx_pcie_raise_legacy_irq()
misc: pci_endpoint_test: Use INTX instead of LEGACY
PCI: endpoint: Rename LEGACY to INTX in test function driver
PCI: endpoint: Use INTX instead of legacy
PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
2024-01-15 12:10:40 -06:00
Yoshihiro Shimoda
756dcb5a82
PCI: dwc: Rename .ep_init to .init in struct dw_pcie_ep_ops
...
Since the name of the dw_pcie_ep_ops struct makes it obvious that it's
for the PCIe Endpoint, rename the struct member .ep_init to .init.
[kwilczynski: commit log]
Suggested-by: Serge Semin <fancer.lancer@gmail.com >
Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/linux-pci/20231220053829.1921187-3-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Reviewed-by: Serge Semin <fancer.lancer@gmail.com >
Reviewed-by: Srikanth Thokala <srikanth.thokala@intel.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
2024-01-06 07:51:08 +00:00
Yoshihiro Shimoda
aea370b2ae
PCI: dwc: Drop host prefix from struct dw_pcie_host_ops members
...
Since the name of the dw_pcie_host_ops struct makes it obvious that it's
for the PCIe Host, drop the host prefix from the struct members.
[kwilczynski: commit log]
Suggested-by: Serge Semin <fancer.lancer@gmail.com >
Link: https://lore.kernel.org/linux-pci/20231220053829.1921187-2-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Reviewed-by: Serge Semin <fancer.lancer@gmail.com >
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Acked-by: Heiko Stuebner <heiko@sntech.de >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
Acked-by: Lei Chuanhua <lchuanhua@maxlinear.com >
Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp >
2024-01-06 07:51:08 +00:00
Damien Le Moal
74955cb8cc
PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
...
linux/pci.h defines the IRQ flags PCI_IRQ_INTX, PCI_IRQ_MSI and
PCI_IRQ_MSIX. Let's use these flags directly instead of the endpoint
definitions provided by enum pci_epc_irq_type. This removes the need
for defining this enum type completely.
Link: https://lore.kernel.org/r/20231122060406.14695-3-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org >
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org >
Reviewed-by: Serge Semin <fancer.lancer@gmail.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
2023-12-18 11:55:56 +01:00
Rob Herring
c925cfaf09
PCI: Explicitly include correct DT includes
...
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus. As
part of that merge prepping Arm DT support 13 years ago, they "temporarily"
include each other. They also include platform_device.h and of.h. As a
result, there's a pretty much random mix of those include files used
throughout the tree. In order to detangle these headers and replace the
implicit includes with struct declarations, users need to explicitly
include the correct includes.
Link: https://lore.kernel.org/r/20230714174827.4061572-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
2023-07-18 14:33:17 -05:00
Serge Semin
60b3c27fb9
PCI: dwc: Rename struct pcie_port to dw_pcie_rp
...
All of the DW PCIe core driver entities except the pcie_port struct have
names with the "dw_" prefix to distinguish local and common PCIe name
spaces, and endpoint-related entities have an "_ep" suffix.
Rename struct pcie_port to dw_pcie_rp to make it more consistent with other
names.
[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20220624143428.8334-16-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
2022-07-05 19:00:52 -05:00
Fan Fei
7073f2ceca
PCI: artpec6: Prefer of_device_get_match_data()
...
The artpec6 driver only needs the device data, not the whole struct
of_device_id. Use of_device_get_match_data() instead of of_match_device().
No functional change intended.
[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20211223011054.1227810-3-helgaas@kernel.org
Signed-off-by: Fan Fei <ffclaire1224@gmail.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
2022-01-03 15:00:55 -06:00
Krzysztof Wilczyński
30492c12d2
PCI: artpec6: Remove local code block from switch statement
...
The switch statement in the artpec6_pcie_probe() has a local code block
where "val" is defined and immediately used by the artpec6_pcie_readl().
This extra code block adds brackets at the same indentation level as the
switch statement itself which can hinder readability of the code.
Move the "val" declaration to the top of the function and remove
the extra code block from the switch statement.
Suggested-by: Bjorn Helgaas <bhelgaas@google.com >
Link: https://lore.kernel.org/r/20210701204401.1636562-2-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
2021-08-31 14:54:33 -05:00
Krzysztof Wilczyński
ee6f85683e
PCI: artpec6: Remove surplus break statement after return
...
As part of code refactoring completed in a0fd361db8 ("PCI: dwc: Move
"dbi", "dbi2", and "addr_space" resource setup into common code"),
artpec6_add_pcie_ep() was removed and the call to the dw_pcie_ep_init()
was moved into artpec6_pcie_probe().
This left a break statement behind that is not needed any more as
artpec6_pcie_probe() returns immediately after calling dw_pcie_ep_init().
Remove this surplus break statement that became dead code.
Link: https://lore.kernel.org/r/20210701204401.1636562-1-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
2021-08-31 14:53:06 -05:00
Rob Herring
60f5b73fa0
PCI: dwc: Remove unnecessary wrappers around dw_pcie_host_init()
...
Many calls to dw_pcie_host_init() are in a wrapper function with
nothing else now. Let's remove the pointless extra layer.
Link: https://lore.kernel.org/r/20201105211159.1814485-14-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 >
Cc: Richard Zhu <hongxing.zhu@nxp.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
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: Jonathan Chocron <jonnyc@amazon.com >
Cc: Jesper Nilsson <jesper.nilsson@axis.com >
Cc: Xiaowei Song <songxiaowei@hisilicon.com >
Cc: Binghui Wang <wangbinghui@hisilicon.com >
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
2020-11-19 10:51:41 +00:00
Rob Herring
b9ac0f9dc8
PCI: dwc: Move dw_pcie_setup_rc() to DWC common code
...
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
2020-11-19 10:51:41 +00:00
Rob Herring
59fbab1ae4
PCI: dwc: Move dw_pcie_msi_init() into core
...
The host drivers which call dw_pcie_msi_init() are all the ones using
the built-in MSI controller, so let's move it into the common DWC code.
Link: https://lore.kernel.org/r/20201105211159.1814485-12-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: 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: 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: Stanimir Varbanov <svarbanov@mm-sol.com >
Cc: Andy Gross <agross@kernel.org >
Cc: Bjorn Andersson <bjorn.andersson@linaro.org >
Cc: Pratyush Anand <pratyush.anand@gmail.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.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: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
2020-11-19 10:51:41 +00:00
Rob Herring
886a9c1347
PCI: dwc: Move link handling into common code
...
All the DWC drivers do link setup and checks at roughly the same time.
Let's use the existing .start_link() hook (currently only used in EP
mode) and move the link handling to the core code.
The behavior for a link down was inconsistent as some drivers would fail
probe in that case while others succeed. Let's standardize this to
succeed as there are usecases where devices (and the link) appear later
even without hotplug. For example, a reconfigured FPGA device.
Link: https://lore.kernel.org/r/20201105211159.1814485-11-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: 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: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.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: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
2020-11-19 10:51:41 +00:00
Rob Herring
5bcb1757e6
PCI: dwc: Move MSI interrupt setup into DWC common code
...
Platforms using the built-in DWC MSI controller all have a dedicated
interrupt with "msi" name or at index 0, so let's move setting up the
interrupt to the common DWC code.
spear13xx and dra7xx are the 2 oddballs with muxed interrupts, so
we need to prevent configuring the MSI interrupt by setting msi_irq
to negative.
Link: https://lore.kernel.org/r/20201105211159.1814485-9-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: 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: 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: 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: Stanimir Varbanov <svarbanov@mm-sol.com >
Cc: Andy Gross <agross@kernel.org >
Cc: Bjorn Andersson <bjorn.andersson@linaro.org >
Cc: Pratyush Anand <pratyush.anand@gmail.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.com >
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
2020-11-19 10:51:41 +00:00
Rob Herring
a0fd361db8
PCI: dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common code
...
Most DWC drivers use the common register resource names "dbi", "dbi2", and
"addr_space", so let's move their setup into the DWC common code.
This means 'dbi_base' in particular is setup later, but it looks like no
drivers touch DBI registers before dw_pcie_host_init or dw_pcie_ep_init.
Link: https://lore.kernel.org/r/20201105211159.1814485-4-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: 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: Jonathan Chocron <jonnyc@amazon.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: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.com >
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: linux-omap@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
2020-11-19 10:51:40 +00:00
Rob Herring
aeaa0bfe89
PCI: dwc: Move N_FTS setup to common setup
...
The Designware controller has common registers to set number of fast
training sequence ordered sets. The Artpec6, Intel, and Tegra driver
initialize these register fields. Let's move the initialization to the
common setup code and drivers just have to provide the value.
There's a slight change in that the common clock mode N_FTS field is
now initialized. Previously only the Intel driver set this. It's not
clear from the code if common clock mode is used in the Artpec6 or Tegra
driver. It depends on the DWC configuration. Given the field is not
initialized while the others are, it seems unlikely common clock mode
is used.
Link: https://lore.kernel.org/r/20200821035420.380495-40-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Jesper Nilsson <jesper.nilsson@axis.com >
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Jingoo Han <jingoohan1@gmail.com >
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.com >
Cc: linux-tegra@vger.kernel.org
2020-09-10 16:50:53 +01:00
Rob Herring
cf627713e3
PCI: dwc: Check CONFIG_PCI_MSI inside dw_pcie_msi_init()
...
Move the IS_ENABLED(CONFIG_PCI_MSI) check into dw_pcie_msi_init()
instead of duplicating it in all the drivers.
Link: https://lore.kernel.org/r/20200821035420.380495-22-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Richard Zhu <hongxing.zhu@nxp.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
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: Yue Wang <yue.wang@Amlogic.com >
Cc: Kevin Hilman <khilman@baylibre.com >
Cc: Jesper Nilsson <jesper.nilsson@axis.com >
Cc: Jingoo Han <jingoohan1@gmail.com >
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com >
Cc: Xiaowei Song <songxiaowei@hisilicon.com >
Cc: Binghui Wang <wangbinghui@hisilicon.com >
Cc: Stanimir Varbanov <svarbanov@mm-sol.com >
Cc: Andy Gross <agross@kernel.org >
Cc: Bjorn Andersson <bjorn.andersson@linaro.org >
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@axis.com
Cc: linux-arm-msm@vger.kernel.org
2020-09-08 16:37:02 +01:00
Bjorn Helgaas
6f119ec8d9
Merge branch 'pci/irq-error'
...
- Remove redundant logging for platform_get_irq() errors (Krzysztof
Wilczyński)
* pci/irq-error:
PCI: Remove dev_err() when handing an error from platform_get_irq()
2020-08-05 18:24:22 -05:00
Krzysztof Wilczyński
caecb05c80
PCI: Remove dev_err() when handing an error from platform_get_irq()
...
There is no need to call the dev_err() function directly to print a
custom message when handling an error from either the platform_get_irq() or
platform_get_irq_byname() functions as both are going to display an
appropriate error message in case of a failure.
This change is as per suggestions from Coccinelle, e.g.,
drivers/pci/controller/dwc/pcie-armada8k.c:252:2-9: line 252 is
redundant because platform_get_irq() already prints an error
[bhelgaas: squashed into one commit]
Suggested-by: Bjorn Helgaas <bhelgaas@google.com >
Link: https://lore.kernel.org/r/20200802142601.1635926-2-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-3-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-4-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-5-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-6-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-7-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-8-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-9-kw@linux.com
Link: https://lore.kernel.org/r/20200802142601.1635926-10-kw@linux.com
Link: https://lore.kernel.org/r/20200803071040.1663662-1-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com > # altera
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com > # dwc
2020-08-03 09:26:03 -05:00
Dejin Zheng
936fa5cd7b
PCI: dwc: Convert to devm_platform_ioremap_resource_byname()
...
Use devm_platform_ioremap_resource_byname() to simplify the code
since it contains platform_get_resource_byname() and
devm_ioremap_resource() respectively.
Link: https://lore.kernel.org/r/20200708164013.5076-1-zhengdejin5@gmail.com
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Reviewed-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com >
Reviewed-by: Rob Herring <robh@kernel.org >
2020-07-17 17:15:08 +01:00
Dilip Kota
6fd622c226
PCI: artpec6: Configure FTS with dwc helper function
...
Use DesignWare helper functions to configure Fast Training
Sequence. Drop the respective code in the driver.
Signed-off-by: Dilip Kota <eswara.kota@linux.intel.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Reviewed-by: Andrew Murray <andrew.murray@arm.com >
2020-01-09 11:57:29 +00:00
Denis Efremov
c9c13ba428
PCI: Add PCI_STD_NUM_BARS for the number of standard BARs
...
Code that iterates over all standard PCI BARs typically uses
PCI_STD_RESOURCE_END. However, that requires the unusual test
"i <= PCI_STD_RESOURCE_END" rather than something the typical
"i < PCI_STD_NUM_BARS".
Add a definition for PCI_STD_NUM_BARS and change loops to use the more
idiomatic C style to help avoid fencepost errors.
Link: https://lore.kernel.org/r/20190927234026.23342-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190927234308.23935-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190916204158.6889-3-efremov@linux.com
Signed-off-by: Denis Efremov <efremov@linux.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Acked-by: Sebastian Ott <sebott@linux.ibm.com > # arch/s390/
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com > # video/fbdev/
Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com > # pci/controller/dwc/
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com > # scsi/pm8001/
Acked-by: Martin K. Petersen <martin.petersen@oracle.com > # scsi/pm8001/
Acked-by: Ulf Hansson <ulf.hansson@linaro.org > # memstick/
2019-10-14 10:22:26 -05:00
Kishon Vijay Abraham I
626961dd6d
PCI: dwc: Add const qualifier to struct dw_pcie_ep_ops
...
Add const qualifier to struct dw_pcie_ep_ops member of
struct dw_pcie_ep.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
2019-04-15 13:24:02 +01:00
Gustavo Pimentel
d3c70a98d7
PCI: Update xxx_pcie_ep_raise_irq() and pci_epc_raise_irq() signatures
...
Change {cdns, dra7xx, artpec6, dw, rockchip}_pcie_ep_raise_irq() and
pci_epc_raise_irq() signature, namely the interrupt_num variable type
from u8 to u16 to accommodate 2048 maximum MSI-X interrupts.
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Acked-by: Alan Douglas <adouglas@cadence.com >
Acked-by: Shawn Lin <shawn.lin@rock-chips.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
Acked-by: Joao Pinto <jpinto@synopsys.com >
Acked-by: Kishon Vijay Abraham I <kishon@ti.com >
2018-07-19 11:34:42 +01:00
Shawn Guo
84b8821955
PCI: artpec6: Drop unnecessary root_bus_nr setting
...
Function dw_pcie_host_init() already initializes the root_bus_nr field
of 'struct pcie_port', so the -1 assignment prior to calling
dw_pcie_host_init() in platform specific driver is not really needed.
Drop it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com >
Cc: Jesper Nilsson <jesper.nilsson@axis.com >
2018-07-13 14:08:47 +01:00
Shawn Lin
6e0832fa43
PCI: Collect all native drivers under drivers/pci/controller/
...
Native PCI drivers for root complex devices were originally all in
drivers/pci/host/. Some of these devices can also be operated in endpoint
mode. Drivers for endpoint mode didn't seem to fit in the "host"
directory, so we put both the root complex and endpoint drivers in
per-device directories, e.g., drivers/pci/dwc/, drivers/pci/cadence/, etc.
These per-device directories contain trivial Kconfig and Makefiles and
clutter drivers/pci/. Make a new drivers/pci/controllers/ directory and
collect all the device-specific drivers there.
No functional change intended.
Link: https://lkml.kernel.org/r/1520304202-232891-1-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com >
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
2018-06-08 07:50:11 -05:00