MIPS: ath79: get PCIe controller out of reset
authorMathias Kresin <dev@kresin.me>
Fri, 20 Jul 2018 11:58:25 +0000 (13:58 +0200)
committerPaul Burton <paul.burton@mips.com>
Wed, 25 Jul 2018 02:08:06 +0000 (19:08 -0700)
commit0316b05311e777f8044c72a88b966ebae7c7a39f
tree17a366a994dc8817251c756cc2913f1865186fab
parentffc2058189223a2625ff55dfe1676df86ed03ee3
MIPS: ath79: get PCIe controller out of reset

The ar724x pci driver expects the PCIe controller to be brought out of
reset by the bootloader.

At least the AVM Fritz 300E bootloader doesn't take care of releasing
the different PCIe controller related resets which causes an endless
hang as soon as either the PCIE Reset register (0x180f0018) or the PCI
Application Control register (0x180f0000) is read from.

Do the full "PCIE Root Complex Initialization Sequence" if the PCIe
host controller is still in reset during probing.

The QCA u-boot sleeps 10ms after the PCIE Application Control bit is
set to ready. It has been shown that 10ms might not be enough time if
PCIe should be used right after setting the bit. During my tests it
took up to 20ms till the link was up. Giving the link up to 100ms
should work for all cases.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/19916/
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
arch/mips/pci/pci-ar724x.c