Skip to content

PCI: brcmstb: Add Broadcom Settopbox PCIe support (resend)

Jim Quinlan linux-arm-kernel linux-devicetree linux-mips linux-pci lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest posting 2/212 patches 23 repliesIn review
  2. v5 posting 1/212 patches 9 repliesSuperseded
  3. v48 patches 13 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v38 patches15 repliesSuperseded
v18 patches16 repliesSuperseded

Changes in v5 from the cover letter

- V4 had its own DMA ops structure in the PCIe driver which would override/coexist with the default arch DMA ops. This approach was scrapped, and this version instead essentially implements custom definitions of the __phys_to_dma and __dma_to_phys operations for the three target arches: MIPs, ARM64, ARM. This was the course suggested by one of the V4 reviewers (ChristophH).

Patches in v5 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12soc: bcm: brcmstb: add memory APIdrivers/soc/bcm/brcmstb/Makefile drivers/soc/bcm/brcmstb/memory.c include/soc/brcmstb/memory_api.h+185 -10 replies
2/12dt-bindings: pci: add DT docs for Brcmstb PCIe deviceDocumentation/devicetree/bindings/pci/brcmstb-pcie.txt+59 -02 replies
3/12PCI: brcmstb: add Broadcom STB PCIe host controller driverdrivers/pci/controller/Kconfig drivers/pci/controller/Makefile drivers/pci/controller/pcie-brcmstb.c+1112 -00 replies
4/12PCI: brcmstb: add dma-range mapping for inbound trafficdrivers/pci/controller/pcie-brcmstb.c include/soc/brcmstb/common.h+133 -1314 replies
5/12PCI: brcmstb: add MSI capabilitydrivers/pci/controller/Kconfig drivers/pci/controller/pcie-brcmstb.c+351 -120 replies
6/12MIPS: BMIPS: add dma remap for BrcmSTB PCIearch/mips/bmips/dma.c+9 -02 replies
7/12PCI/MSI: enable PCI_MSI_IRQ_DOMAIN support for MIPSdrivers/pci/Kconfig+1 -10 replies
8/12MIPS: BMIPS: add PCI bindings for 7425, 7435arch/mips/boot/dts/brcm/bcm7425.dtsi arch/mips/boot/dts/brcm/bcm7435.dtsi arch/mips/boot/dts/brcm/bcm97425svmb.dts +1 more+64 -00 replies
9/12MIPS: BMIPS: enable PCIarch/mips/Kconfig+3 -00 replies
10/12ARM64: declare __phys_to_dma on ARCH_HAS_PHYS_TO_DMAarch/arm64/include/asm/dma-direct.h+16 -01 reply
11/12ARM64: add dma remap for BrcmSTB PCIedrivers/pci/controller/Kconfig drivers/pci/controller/pcie-brcmstb.c+13 -02 replies
12/12ARM: add dma remap for BrcmSTB PCIearch/arm/Kconfig arch/arm/configs/brcmstb_defconfig arch/arm/configs/multi_v7_defconfig +5 more+296 -230 replies

Reviews trailers per patch

1 of 12 patches has a Reviewed-by or Acked-by.

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

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

Read the v5 thread

Cover letter [PATCH v5 00/12] PCI: brcmstb: Add Broadcom Settopbox PCIe support (resend)

This patch series adds support for the Broadcom Settopbox PCIe host controller. It is targeted to Broadcom Settopbox chips running on ARM, ARM64, and MIPS platforms.

V5 Changes:
- V4 had its own DMA ops structure in the PCIe driver which would override/coexist with the default arch DMA ops. This approach was scrapped, and this version instead essentially implements custom definitions of the __phys_to_dma and __dma_to_phys operations for the three target arches: MIPs, ARM64, ARM. This was the course suggested by one of the V4 reviewers (ChristophH).

For MIPs and ARM64, the DMA remapping is easily accomplished by having custom definitions of __phys_to_dma and __dma_to_phys. For MIPs/BMIPs, ARCH_HAS_PHYS_TO_DMA is already selected and the two functions are just modified. For ARM64, this driver selects ARCH_HAS_PHYS_TO_DMA and declares and defines __phys_to_dma() and __dma_to_phys(). For ARM, things were not so simple. The default functions like __arch_pfn_to_dma() had to be overridden by custom ones defined in arch/arm/mach-bcm/include/mach/memory.h. For these functions to be "seen", we had to declare our own brcmstb_defconfig and no longer use multi_v7_defconfig. This is unfortunate.

- Commits have been better organized to first implement the main driver, then add features (MSI, DMA remap infrastructure), and then add the DMA remapping modifications for MIPs, ARM64, and ARM.

V4 Changes:
- Merged all BrcmSTB PCIe controller files into a single file.
- All new files now have the SPDX identifier.
- Removed the list of PCIe controllers.
- Removed "link-up" race.
- Removed probe of msi psuedo-device.
- Multiple comment text changes, as requested.
- "SSC" => "Spread Spectrum Clocking".
- Set 'memc' variable.
- Unnecessary variable initializations removed (eg rc_bar2_size).
- Added comment on "L23" link state.
- Removed use of "__refdata".
- Formatting of structure elements.

V3 Changes:
- Fold pcie-brcmstb-msi.c into pcie-brcmstb.c
- Use PCI_XXX constants for PCIe capability registers
- Removal of any unused constants
- Change s/pci/pcie/ for filenames, comment text
- Config space access now uses 8/16/32 read/writes
- Use proper multi-line comment style
- Use function names, structure that are common in other host drivers
- DT binding 'brcm,ssc' is now 'brcm,enable-ssc'
- Dropped DT binding 'xyz-supply'
- Not setting CRS support as Linux does it if it is advertised.
- Removed code that was considered "debug code".
- Use of_get_pcie_domain_nr()
- Variable 'bridge_setup_done' removed.

V2 Changes:
* Patch brcmstb-add-memory-API:
- fix DT_PROP_DATA_TO_U32 macro.
- dropped one EXPORT_SYMBOL, changed the other to GPL.
* Patch DT-docs-for-Brcmstb-PCIe:
- change 'brcm,gen' prop to standard 'max-link-speed'.
- rewrite bindings commit to omit standard prop defs.
- change props "supplies", "supply-names" to "xyz-supply"
* Patch removed: export-symbol-arch_setup_dma_ops [4/9]
* Patch brcmstb-add-dma-ranges:
- use get_dma_ops(); also use a const dma_map_ops structure.
- rewrite map_sg(), unmap_sg(), other calls like syng_sg_*()
- omit brcm_mapping_error(), but added code in brcm_dma_supported()
- put all of the notifier code in one compilation unit.

Florian Fainelli (1):
soc: bcm: brcmstb: add memory API

Jim Quinlan (11):
dt-bindings: pci: add DT docs for Brcmstb PCIe device
PCI: brcmstb: add Broadcom STB PCIe host controller driver
PCI: brcmstb: add dma-range mapping for inbound traffic
PCI: brcmstb: add MSI capability
MIPS: BMIPS: add dma remap for BrcmSTB PCIe PCI/MSI: enable PCI_MSI_IRQ_DOMAIN support for MIPS
MIPS: BMIPS: add PCI bindings for 7425, 7435
MIPS: BMIPS: enable PCI
ARM64: declare __phys_to_dma on ARCH_HAS_PHYS_TO_DMA
ARM64: add dma remap for BrcmSTB PCIe
ARM: add dma remap for BrcmSTB PCIe

 .../devicetree/bindings/pci/brcmstb-pcie.txt       |   59 +
 arch/arm/Kconfig                                   |   33 +
 arch/arm/configs/brcmstb_defconfig                 |  204 +++
 arch/arm/configs/multi_v7_defconfig                |    3 -
 arch/arm/mach-bcm/Kconfig                          |   21 +-
 arch/arm/mach-bcm/Makefile.boot                    |    0
 arch/arm/mach-bcm/include/mach/irqs.h              |    3 +
 arch/arm/mach-bcm/include/mach/memory.h            |   47 +
 arch/arm/mach-bcm/include/mach/uncompress.h        |    8 +
 arch/arm64/include/asm/dma-direct.h                |   16 +
 arch/mips/Kconfig                                  |    3 +
 arch/mips/bmips/dma.c                              |    9 +
 arch/mips/boot/dts/brcm/bcm7425.dtsi               |   28 +
 arch/mips/boot/dts/brcm/bcm7435.dtsi               |   28 +
 arch/mips/boot/dts/brcm/bcm97425svmb.dts           |    4 +
 arch/mips/boot/dts/brcm/bcm97435svmb.dts           |    4 +
 drivers/pci/Kconfig                                |    2 +-
 drivers/pci/controller/Kconfig                     |   13 +
 drivers/pci/controller/Makefile                    |    1 +
 drivers/pci/controller/pcie-brcmstb.c              | 1554 ++++++++++++++++++++
 drivers/soc/bcm/brcmstb/Makefile                   |    2 +-
 drivers/soc/bcm/brcmstb/memory.c                   |  158 ++
 include/soc/brcmstb/common.h                       |   16 +
 include/soc/brcmstb/memory_api.h                   |   26 +
 24 files changed, 2217 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pci/brcmstb-pcie.txt
 create mode 100644 arch/arm/configs/brcmstb_defconfig
 create mode 100644 arch/arm/mach-bcm/Makefile.boot
 create mode 100644 arch/arm/mach-bcm/include/mach/irqs.h
 create mode 100644 arch/arm/mach-bcm/include/mach/memory.h
 create mode 100644 arch/arm/mach-bcm/include/mach/uncompress.h
 create mode 100644 arch/arm64/include/asm/dma-direct.h
 create mode 100644 drivers/pci/controller/pcie-brcmstb.c
 create mode 100644 drivers/soc/bcm/brcmstb/memory.c
 create mode 100644 include/soc/brcmstb/memory_api.h
Signature · 1 line
1.9.0.138.g2de3478