Commit Graph

9 Commits

Author SHA1 Message Date
Myron Stowe e574df2e02 PCI: xilinx-cpm: Move IRQ definitions to a common header
JIRA: https://issues.redhat.com/browse/RHEL-26162
Upstream Status: a977ee945e9490fabd33dcc33399e992252598cf

commit a977ee945e9490fabd33dcc33399e992252598cf
Author: Thippeswamy Havalige <thippeswamy.havalige@amd.com>
Date:   Tue Oct 3 23:04:51 2023 +0530

    PCI: xilinx-cpm: Move IRQ definitions to a common header

    Move the interrupt bit definitions to the pcie-xilinx-common.h file,
    which then can be shared between pcie-xilinx-cpm and the new xilinx-xdma
    drivers.

    While at it, also rename them so these definitions are not CPM-specific.

    No functional change intended.

    [kwilczynski: commit log]
    Link: https://lore.kernel.org/linux-pci/20231003173453.938190-2-thippeswamy.havalige@amd.com
    Signed-off-by: Thippeswamy Havalige <thippeswamy.havalige@amd.com>
    Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@amd.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-02-25 08:38:09 -07:00
Myron Stowe fed96fd48d PCI: Remove unnecessary <linux/of_irq.h> includes
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2166398
Upstream Status: 277004d7a4a348de185fb4149ff29a651e994ff4

commit 277004d7a4a348de185fb4149ff29a651e994ff4
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Mon Oct 31 10:39:54 2022 -0500

    PCI: Remove unnecessary <linux/of_irq.h> includes

    Many host controller drivers #include <linux/of_irq.h> even though they
    don't need it.  Remove the unnecessary #includes.

    Link: https://lore.kernel.org/r/20221031153954.1163623-6-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Roy Zang <roy.zang@nxp.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-03-07 18:02:03 -07:00
Myron Stowe 1b33f5567f PCI: xilinx-cpm: Add support for Versal CPM5 Root Port
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2124638
Upstream Status: 51f1ffc00d95e3e6bb53af456d2716d2a07f2d99

commit 51f1ffc00d95e3e6bb53af456d2716d2a07f2d99
Author: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Date:   Tue Jul 5 16:26:46 2022 +0530

    PCI: xilinx-cpm: Add support for Versal CPM5 Root Port

    The Xilinx Versal Premium series has CPM5 block which supports Root Port
    functioning at Gen5 speed.

    Xilinx Versal CPM5 has a few changes from the existing CPM block:

      - CPM5 has dedicated register space for control and status registers.

      - CPM5 legacy interrupt handling needs additional register bit to enable
        and handle legacy interrupts.

    Add support for the new CPM5 features.

    [bhelgaas: compare variant->version with CPM5 explicitly]
    Link: https://lore.kernel.org/r/20220705105646.16980-3-bharat.kumar.gogada@xilinx.com
    Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-10-02 07:34:17 -06:00
Myron Stowe 95970e53e8 PCI: xilinx-cpm: Rename xilinx_cpm_pcie_port to xilinx_cpm_pcie
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066898
Upstream Status: dacee5872d896b1aaec982829f3b4a3e8e14e53c

commit dacee5872d896b1aaec982829f3b4a3e8e14e53c
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Wed Dec 22 19:10:54 2021 -0600

    PCI: xilinx-cpm: Rename xilinx_cpm_pcie_port to xilinx_cpm_pcie

    Rename struct xilinx_cpm_pcie_port to xilinx_cpm_pcie to match the
    convention of <driver>_pcie. No functional change intended.

    Link: https://lore.kernel.org/r/20211223011054.1227810-24-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Michal Simek <michal.simek@xilinx.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-04-20 10:14:11 -06:00
Myron Stowe cc06255630 PCI: Bulk conversion to generic_handle_domain_irq()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2045254
Upstream Status: d21faba11693c10072ce3b96b696445175f49be2

commit d21faba11693c10072ce3b96b696445175f49be2
Author: Marc Zyngier <maz@kernel.org>
Date:   Mon Aug 2 17:26:19 2021 +0100

    PCI: Bulk conversion to generic_handle_domain_irq()

    Wherever possible, replace constructs that match either
    generic_handle_irq(irq_find_mapping()) or
    generic_handle_irq(irq_linear_revmap()) to a single call to
    generic_handle_domain_irq().

    Link: https://lore.kernel.org/r/20210802162630.2219813-4-maz@kernel.org
    Signed-off-by: Marc Zyngier <maz@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-03-03 20:43:32 -07:00
Pan Bian ae191d2e51 PCI: xilinx-cpm: Fix reference count leak on error path
Also drop the reference count of the node on error path.

Link: https://lore.kernel.org/r/20210120143745.699-1-bianpan2016@163.com
Fixes: 508f610648 ("PCI: xilinx-cpm: Add Versal CPM Root Port driver")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2021-01-25 17:27:41 +00:00
Lorenzo Pieralisi 7d69b117c3 PCI: xilinx-cpm: Remove leftover bridge initialization
Some fields in the host bridge structure are now initialized
by default in the PCI/OF core functions therefore their
initialization in the host controller driver is superfluous.

Remove it.

Link: https://lore.kernel.org/r/20200904142710.8018-1-lorenzo.pieralisi@arm.com
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Rob Herring <robh@kernel.org>
2020-09-07 10:53:49 +01:00
Bjorn Helgaas 49e427e6bd Merge branch 'pci/host-probe-refactor'
- Use pci_host_bridge.windows list directly instead of splicing in a
  temporary list for cadence, mvebu, host-common (Rob Herring)

- Use pci_host_probe() instead of open-coding all the pieces for altera,
  brcmstb, iproc, mobiveil, rcar, rockchip, tegra, v3, versatile, xgene,
  xilinx, xilinx-nwl (Rob Herring)

- Convert to devm_platform_ioremap_resource_byname() instead of open-coding
  platform_get_resource_byname() and devm_ioremap_resource() for altera,
  cadence, mediatek, rockchip, tegra, xgene (Dejin Zheng)

- Convert to devm_platform_ioremap_resource() instead of open-coding
  platform_get_resource() and devm_ioremap_resource() for aardvark,
  brcmstb, exynos, ftpci100, versatile (Dejin Zheng)

- Remove redundant error messages from devm_pci_remap_cfg_resource()
  callers (Dejin Zheng)

- Drop useless PCI_ENABLE_PROC_DOMAINS from versatile driver (Rob Herring)

- Default host bridge parent device to the platform device (Rob Herring)

- Drop unnecessary zeroing of host bridge fields (Rob Herring)

- Use pci_is_root_bus() instead of tracking root bus number separately in
  aardvark, designware (imx6, keystone, designware-host), mobiveil,
  xilinx-nwl, xilinx, rockchip, rcar (Rob Herring)

- Set host bridge bus number in pci_scan_root_bus_bridge() instead of each
  driver for aardvark, designware-host, host-common, mediatek, rcar, tegra,
  v3-semi (Rob Herring)

- Use bridge resources instead of parsing DT 'ranges' again for cadence
  (Rob Herring)

- Remove private bus number and range from cadence (Rob Herring)

- Use devm_pci_alloc_host_bridge() to simplify rcar (Rob Herring)

- Use struct pci_host_bridge.windows list directly rather than a temporary
  (Rob Herring)

- Reduce OF "missing non-prefetchable window" from error to warning message
  (Rob Herring)

- Convert rcar-gen2 from old Arm-specific pci_common_init_dev() to new
  arch-independent interfaces (Rob Herring)

- Move DT resource setup into devm_pci_alloc_host_bridge() (Rob Herring)

- Set bridge map_irq and swizzle_irq to default functions; drivers that
  don't support legacy IRQs (iproc) need to undo this (Rob Herring)

* pci/host-probe-refactor:
  PCI: Set bridge map_irq and swizzle_irq to default functions
  PCI: Move DT resource setup into devm_pci_alloc_host_bridge()
  PCI: rcar-gen2: Convert to use modern host bridge probe functions
  PCI: of: Reduce missing non-prefetchable memory region to a warning
  PCI: rcar: Use struct pci_host_bridge.windows list directly
  PCI: rcar: Use devm_pci_alloc_host_bridge()
  PCI: cadence: Remove private bus number and range storage
  PCI: cadence: Use bridge resources for outbound window setup
  PCI: Move setting pci_host_bridge.busnr out of host drivers
  PCI: rcar: Use pci_is_root_bus() to check if bus is root bus
  PCI: rockchip: Use pci_is_root_bus() to check if bus is root bus
  PCI: xilinx: Use pci_is_root_bus() to check if bus is root bus
  PCI: xilinx-nwl: Use pci_is_root_bus() to check if bus is root bus
  PCI: mobiveil: Use pci_is_root_bus() to check if bus is root bus
  PCI: designware: Use pci_is_root_bus() to check if bus is root bus
  PCI: aardvark: Use pci_is_root_bus() to check if bus is root bus
  PCI: Drop unnecessary zeroing of bridge fields
  PCI: Set default bridge parent device
  PCI: versatile: Drop flag PCI_ENABLE_PROC_DOMAINS
  PCI: controller: Remove duplicate error message
  PCI: controller: Convert to devm_platform_ioremap_resource()
  PCI: controller: Convert to devm_platform_ioremap_resource_byname()
  PCI: xilinx: Use pci_host_probe() to register host
  PCI: xilinx-nwl: Use pci_host_probe() to register host
  PCI: rockchip: Use pci_host_probe() to register host
  PCI: rcar: Use pci_host_probe() to register host
  PCI: iproc: Use pci_host_probe() to register host
  PCI: altera: Use pci_host_probe() to register host
  PCI: xgene: Use pci_host_probe() to register host
  PCI: versatile: Use pci_host_probe() to register host
  PCI: v3: Use pci_host_probe() to register host
  PCI: tegra: Use pci_host_probe() to register host
  PCI: mobiveil: Use pci_host_probe() to register host
  PCI: brcmstb: Use pci_host_probe() to register host
  PCI: host-common: Use struct pci_host_bridge.windows list directly
  PCI: mvebu: Use struct pci_host_bridge.windows list directly
  PCI: cadence: Use struct pci_host_bridge.windows list directly

# Conflicts:
#	drivers/pci/controller/cadence/pcie-cadence-host.c
2020-08-05 18:24:21 -05:00
Bharat Kumar Gogada 508f610648 PCI: xilinx-cpm: Add Versal CPM Root Port driver
Add support for Versal CPM as Root Port.

The Versal ACAP devices include CCIX-PCIe Module (CPM). The integrated
block for CPM along with the integrated bridge can function as PCIe Root
Port.

Bridge error and legacy interrupts in Versal CPM are handled using Versal
CPM specific interrupt line.

[bhelgaas: fold in kerneldoc fix from
https://lore.kernel.org/linux-acpi/20200729201224.26799-7-krzk@kernel.org/]
Link: https://lore.kernel.org/r/1592312214-9347-3-git-send-email-bharat.kumar.gogada@xilinx.com
Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2020-08-05 17:09:15 -05:00