
Hi Sylwester,
On Tue, 2020-04-21 at 18:50 +0200, Sylwester Nawrocki wrote:
This patch adds basic driver for the Broadcom STB PCIe host controller. The code is based on Linux upstream driver (pcie-brcmtsb.c) with MSI handling removed. The inbound access memory region is not currently parsed from dma-ranges DT property and is fixed as a 1:1 mapping of whole RAM. The patch has been tested on rpi4 board, i.e. on BCM2711 SoC with VL805 USB Host Controller.
Signed-off-by: Sylwester Nawrocki s.nawrocki@samsung.com
I see that you based your code on the downstream PCIe driver (the one available in the Raspberry Pi foundation kernel repos). There's a real upstream version of it[1], It's properly reviewed and we made a point to remove all non bcm2711 specific stuff from it, as support for other platforms (like bcm7445) isn't there yet (it depends on supporting multiple dma-ranges in Linux, which we don't). Also note that the Raspberry Pi foundation is moving towards using this driver, see for example their rpi-5.6.y branch, and I belive Broadcom is doing the same.
So I strongly suggest you base this driver on the upstream version. As I was working towards the same goal as you I already have an implementation for u-boot myself[2]. Feel free to use that if you find it useful. Ultimately, whether you base it on my version or the upstream Linux version it's half the size and easier to follow.
Regards, Nicolas
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv... [2] https://github.com/vianpl/u-boot/commits/brcm-pcie