devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] PCI: Add support to the Cadence PCIe controller
@ 2018-01-10 22:47 Cyrille Pitchen
  2018-01-10 22:47 ` [PATCH v3 1/6] PCI: Regroup all PCI related entries into drivers/pci/Makefile Cyrille Pitchen
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Cyrille Pitchen @ 2018-01-10 22:47 UTC (permalink / raw)
  To: bhelgaas, kishon, lorenzo.pieralisi, linux-pci
  Cc: adouglas, stelford, dgary, kgopi, eandrews, thomas.petazzoni,
	sureshp, nsekhar, linux-kernel, robh, devicetree,
	Cyrille Pitchen

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 removed only because I didn't
have time to take all Kishon's comments into account. However, using a
fixed patch based on patch 7 of the v2 series + another patch fixing
the EPF device name chosen by pci_epf_make(), I was abled to probe
both function 0 and function 1 of the of the 2nd Cadence PCIe controller
configured in endpoint mode (new hardware design since v2 so function 1
is now available).

Currently I'm facing 2 issues, which I didn't have enough time to
investigate and to fix yet:

1 - when the vendor:device IDs are set to 104c:b500 for both functions,
then I remove both devfn (echo 1 > /sys/bus/pci/devices/$BDF/remove)
before scanning the PCI bus again (echo 1 > /sys/bus/pci/rescan),
the PCI enumeration fails reporting that the PCI memory is exhausted.

2 - when I set the vendor:device IDs to 104c:0100 for function 0 and
104c:b500 and remove only function 1 before scanning the PCI bus again,
I now pass the PCI enumeration. I also pass the 'pcitest -b <BAR>' test
but I fail on the MSI test ('pcitest -m <MSI>').

I'm still investigating on those issues.

Best regards,

Cyrille

ChangeLog

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 (5):
  PCI: Regroup all PCI related entries into drivers/pci/Makefile
  PCI: OF: Add generic function to parse and allocate PCI resources
  PCI: Add generic function to probe PCI host controllers
  PCI: Add vendor ID for Cadence
  PCI: cadence: Add host driver for Cadence PCIe controller

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

 .../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                        |  16 +
 drivers/pci/cadence/Makefile                       |   3 +
 drivers/pci/cadence/pcie-cadence-host.c            | 336 +++++++++++++++++++++
 drivers/pci/cadence/pcie-cadence.c                 |  68 +++++
 drivers/pci/cadence/pcie-cadence.h                 | 196 ++++++++++++
 drivers/pci/dwc/Makefile                           |   2 +
 drivers/pci/host/Makefile                          |   2 +
 drivers/pci/host/pci-host-common.c                 |  74 +----
 drivers/pci/of.c                                   |  51 ++++
 drivers/pci/probe.c                                |  33 ++
 include/linux/pci.h                                |  10 +
 include/linux/pci_ids.h                            |   2 +
 17 files changed, 805 insertions(+), 76 deletions(-)
 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-host.c
 create mode 100644 drivers/pci/cadence/pcie-cadence.c
 create mode 100644 drivers/pci/cadence/pcie-cadence.h

-- 
2.11.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-01-18 23:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 22:47 [PATCH v3 0/6] PCI: Add support to the Cadence PCIe controller Cyrille Pitchen
2018-01-10 22:47 ` [PATCH v3 1/6] PCI: Regroup all PCI related entries into drivers/pci/Makefile Cyrille Pitchen
     [not found] ` <cover.1515621150.git.cyrille.pitchen-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2018-01-10 22:47   ` [PATCH v3 2/6] PCI: OF: Add generic function to parse and allocate PCI resources Cyrille Pitchen
2018-01-10 22:47 ` [PATCH v3 3/6] PCI: Add generic function to probe PCI host controllers Cyrille Pitchen
2018-01-16 15:25   ` Lorenzo Pieralisi
2018-01-18 22:58     ` Cyrille Pitchen
2018-01-10 22:47 ` [PATCH v3 4/6] PCI: Add vendor ID for Cadence Cyrille Pitchen
2018-01-10 22:47 ` [PATCH v3 5/6] dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller Cyrille Pitchen
2018-01-10 22:47 ` [PATCH v3 6/6] PCI: cadence: Add host driver for Cadence PCIe controller Cyrille Pitchen
2018-01-16 11:16   ` Kishon Vijay Abraham I
     [not found]     ` <e3d88d5b-e770-d2e5-20b2-62551d5f4f8f-l0cyMroinI0@public.gmane.org>
2018-01-16 15:09       ` Lorenzo Pieralisi
2018-01-18 23:13       ` Cyrille Pitchen
2018-01-16 16:07   ` Lorenzo Pieralisi
     [not found]     ` <20180116160733.GA3644-4tUPXFaYRHv6sAKXYmQ0tx/iLCjYCKR+VpNB7YpNyf8@public.gmane.org>
2018-01-18 23:23       ` Cyrille Pitchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).