Skip to content

PCI: Add support to the Cadence PCIe controller

Cyrille Pitchen linux-devicetree linux-pci lkml 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest11 patches 0 repliesNew
  2. v511 patches 4 repliesSuperseded
  3. v47 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v36 patches7 repliesSuperseded
v29 patches18 repliesSuperseded
v15 patches33 repliesSuperseded

Changes in v6 from the cover letter

- rebase on linux-pci/master (v4.15-rc4) + Kishon's patch from linux-pci/next:
"PCI: endpoint: Use EPC's device in dma_alloc_coherent()/dma_free_coherent()"
- all patches unchanged

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11PCI: Regroup all PCI related entries into drivers/pci/Makefiledrivers/Makefile drivers/pci/Kconfig drivers/pci/Makefile +2 more+16 -70 replies
2/11PCI: OF: Add generic function to parse and allocate PCI resourcesdrivers/pci/host/pci-host-common.c drivers/pci/of.c include/linux/pci.h+62 -470 replies
3/11PCI: generic: fix missing call of pci_free_resource_list()drivers/pci/host/pci-host-common.c+1 -00 replies
4/11PCI: Add generic function to probe PCI host controllersdrivers/pci/host/pci-host-common.c drivers/pci/probe.c include/linux/pci.h+35 -210 replies
5/11PCI: Add vendor ID for Cadenceinclude/linux/pci_ids.h+2 -00 replies
6/11dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controllerDocumentation/devicetree/bindings/pci/cdns,cdns-pcie-host.txt+60 -00 replies
7/11PCI: cadence: Add host driver for Cadence PCIe controllerMAINTAINERS drivers/pci/host/Kconfig drivers/pci/host/Makefile +2 more+604 -00 replies
8/11PCI: endpoint: Add the function number as argument to EPC opsdrivers/pci/dwc/pcie-designware-ep.c drivers/pci/endpoint/functions/pci-epf-test.c drivers/pci/endpoint/pci-epc-core.c +1 more+96 -700 replies
9/11PCI: endpoint: Fix EPF device name to support multi-function devicesdrivers/pci/endpoint/pci-ep-cfs.c+44 -20 replies
10/11dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controllerDocumentation/devicetree/bindings/pci/cdns,cdns-pcie-ep.txt+22 -00 replies
11/11PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controllerMAINTAINERS drivers/pci/Kconfig drivers/pci/Makefile +8 more+826 -750 replies

Reviews trailers per patch

2 of 11 patches have a Reviewed-by or Acked-by.

PatchRob Herring
1/11
2/11
3/11
4/11
5/11
6/11R-b
7/11
8/11
9/11
10/11R-b
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 00/11] PCI: Add support to the Cadence PCIe controller

Hi all,

this series of patches adds support to the Cadence PCIe controller. It was tested on a ARM64 platform emulated by a Palladium running the pci-next kernel.

The host mode was tested with some PCIe devices connected to the Palladium through a speed-bridge. Some of those devices were a USB host controller and a SATA controller. The PCIe host controller was also tested with a second controller configured in endpoint mode and connected back to back to the first controller.

The EndPoint Controller (EPC) driver was tested with 2 PCI functions, both handled by the pci-epf-test driver, using the pcitest userspace program. I used the "-D" optional command line parameter to select the proper PCI function.

For linux-pci/master, I applied this series on top of Kishon's patch ("PCI: endpoint: Use EPC's device in dma_alloc_coherent/dma_free_coherent") otherwise dma_alloc_coherent() fails when called by pci_epf_alloc_space().

Best regards,

Cyrille

ChangeLog

v5 -> v6:
- rebase on linux-pci/master (v4.15-rc4) + Kishon's patch from linux-pci/next:
"PCI: endpoint: Use EPC's device in dma_alloc_coherent()/dma_free_coherent()"
- all patches unchanged

v4 -> v5:
- rebase on today's (20180128) linux-pci/next
- add again the endpoint driver

- Patch 7:
move host driver from drivers/pci/cadence into drivers/pci/host and remove all references to the endpoint mode, as requested by Lorenzo. The host driver will be moved back into drivers/pci/cadence by Patch 11

- Patch 8:
fix comparison of func_no to BAR5: compare to epc->max_functions

- Patch 9:
add new patch to fix support of PCI multi-function devices

- Patch 10:
change the 'cdns,max-outbound-regions' from optional to mandatory as requested by Kishon.

- Patch 11:
take Kishon's comments into account as much as I could.

- Other patches: unchanged

v3 -> v4:
- split patch 3 from v3 into patches 3 and 4.
- remove unused cdns_pcie_reset_outbound_region() from old patch 6 (new patch 7).
- other patches are unchanged.

v2 -> v3:

- rebase on today's linux-pci/next (20180110)

patch1:
- rework the commit message of patch 1 and add two new comments on why endpoint library users must be linked after the endpoint library itself and why the dwc rule uses obj-y instead of obj-$(CONFIG_PCIE_CONFIG_DW).
- update patch 1 to add missing ifdef CONFIG_PCI / endif in drivers/pci/dwc/Makefile around the obj-$(CONFIG_ARM64) += pcie-hisi.o rule, like for the other obj-$(CONFIG_ARM64) rules in drivers/pci/host/Makefile.

patch2: unchanged

patch3:
- update patch 3 so the bridge hooks/members initialization is left to the host bridges probe routines.

patch4: unchanged

patch5:
- collect 'Reviewed-by' tag from Rob Herring for the DT bindings.

patch6:
- remove explanation in the commit message on why obj-$(CONFIG_PCIE_CANDENCE) is placed after obj-$(CONFIG_PCI_ENDPOINT) in drivers/pci/Makefile since a comment on it has been added into patch1.
- remove menuconfig PCI_CADENCE in drivers/pci/cadence/Kconfig to match drivers/pci/dwc/Kconfig.
- adapt patch6 to the changes done in patch3 for the pci_host_probe() function.

v1 -> v2:
- add new properties in the device-tree bindings: 'cdns,max-outbound-regions' and 'cdns,no-bar-match-nbits'.
- add a new patch to regroup all makefile rules in drivers/pci/Makefile, hence cleaning drivers/Makefile up.
- change the license text to use the recommanded format:
// SPDX-License-Identifier: GPL-2.0
- add a new patch updating the API of the EPC library to add support to multi-function devices.
- add a 2 new patches to share more common code between host controller drivers
- remove some useless tests
- add more comments in both drivers.
- fix DT bindings examples
- remove useless init of the primary, secondary and sub-ordinate bus numbers in the PCI configuration space of the root port.
- remove cdns_pcie_ep_stop() function and rework cdns_pcie_ep_start() function

Cyrille Pitchen (10):
PCI: Regroup all PCI related entries into drivers/pci/Makefile
PCI: OF: Add generic function to parse and allocate PCI resources
PCI: generic: fix missing call of pci_free_resource_list()
PCI: Add generic function to probe PCI host controllers
PCI: Add vendor ID for Cadence
PCI: cadence: Add host driver for Cadence PCIe controller
PCI: endpoint: Add the function number as argument to EPC ops
PCI: endpoint: Fix EPF device name to support multi-function devices
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint
controller
PCI: cadence: Add EndPoint Controller driver for Cadence PCIe
controller

Scott Telford (1):
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host
controller

 .../devicetree/bindings/pci/cdns,cdns-pcie-ep.txt  |  22 +
 .../bindings/pci/cdns,cdns-pcie-host.txt           |  60 +++
 MAINTAINERS                                        |   7 +
 drivers/Makefile                                   |   5 +-
 drivers/pci/Kconfig                                |   2 +
 drivers/pci/Makefile                               |  14 +-
 drivers/pci/cadence/Kconfig                        |  27 +
 drivers/pci/cadence/Makefile                       |   4 +
 drivers/pci/cadence/pcie-cadence-ep.c              | 542 +++++++++++++++++++++
 drivers/pci/cadence/pcie-cadence-host.c            | 336 +++++++++++++
 drivers/pci/cadence/pcie-cadence.c                 | 126 +++++
 drivers/pci/cadence/pcie-cadence.h                 | 311 ++++++++++++
 drivers/pci/dwc/Makefile                           |   2 +
 drivers/pci/dwc/pcie-designware-ep.c               |  20 +-
 drivers/pci/endpoint/functions/pci-epf-test.c      |  41 +-
 drivers/pci/endpoint/pci-ep-cfs.c                  |  46 +-
 drivers/pci/endpoint/pci-epc-core.c                |  62 ++-
 drivers/pci/host/Makefile                          |   2 +
 drivers/pci/host/pci-host-common.c                 |  72 +--
 drivers/pci/of.c                                   |  51 ++
 drivers/pci/probe.c                                |  33 ++
 include/linux/pci-epc.h                            |  43 +-
 include/linux/pci.h                                |  10 +
 include/linux/pci_ids.h                            |   2 +
 24 files changed, 1693 insertions(+), 147 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pci/cdns,cdns-pcie-ep.txt
 create mode 100644 Documentation/devicetree/bindings/pci/cdns,cdns-pcie-host.txt
 create mode 100644 drivers/pci/cadence/Kconfig
 create mode 100644 drivers/pci/cadence/Makefile
 create mode 100644 drivers/pci/cadence/pcie-cadence-ep.c
 create mode 100644 drivers/pci/cadence/pcie-cadence-host.c
 create mode 100644 drivers/pci/cadence/pcie-cadence.c
 create mode 100644 drivers/pci/cadence/pcie-cadence.h
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html