From: Jim Quinlan <james.quinlan@xxxxxxxxxxxx>
This adds a basic driver for Broadcom's STB PCIe controller, for now
aimed at Raspberry Pi 4's SoC, bcm2711.
Signed-off-by: Jim Quinlan <james.quinlan@xxxxxxxxxxxx>
Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
---
Changes since v2:
- Correct rc_bar2_offset sign
- Invert IRQ clear and masking in setup code
- Use bitfield.h, redo all register ops while keeping the register
names intact
- Remove all SHIFT register definitions
- Get rid of all _RB writes
- Get rid of of_data
- Don't iterate over inexisting dma-ranges
- Add comment regarding dma-ranges validation
- Small cosmetic cleanups
- Fix license mismatch
- Set driver Kconfig tristate
- Didn't add any comment about the controller not being I/O coherent
for now as I wait for Jeremy's reply
Changes since v1:
- Fix Kconfig
- Remove pci domain check
- Remove all MSI related code
- Remove supend/resume code
- Simplify link state wait routine
- Prefix all functions
- Use of_device_get_match_data()
- Use devm_clk_get_optional()
- Get rid of irq variable
- Use STB all over the driver
- Simplify map_bus() function
- Fix license mismatch
- Remove unused register definitions
- Small cleanups, spell errors
This is based on Jim's original submission[1] but adapted and tailored
specifically to bcm2711's needs (that's the Raspberry Pi 4). Support for
the rest of the brcmstb family will soon follow once we get support for
multiple dma-ranges in dma/direct.
[1] https://patchwork.kernel.org/patch/10605959/
drivers/pci/controller/Kconfig | 8 +
drivers/pci/controller/Makefile | 1 +
drivers/pci/controller/pcie-brcmstb.c | 753 ++++++++++++++++++++++++++
3 files changed, 762 insertions(+)
create mode 100644 drivers/pci/controller/pcie-brcmstb.c