Skip to contentSkip to conversation

MIPS: ath79: fix AR724X_PLL_REG_PCIE_CONFIG offset

PATCH New Mathias Kresin 1 participant 2 messages May 11, 2017 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 MIPS: ath79: fix AR724X_PLL_REG_PCIE_CONFIG offset

According to the QCA u-boot source the "PCIE Phase Lock Loop Configuration (PCIE_PLL_CONFIG)" register is for all SoCs except the QCA955X and QCA956X at offset 0x10.

Since the PCIE PLL config register is only defined for the AR724x fix only this value. The value is wrong since the day it was added and isn't used by any driver yet.

---
 arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/mach-ath79/ar71xx_regs.h +1 -1
index aa3800c..d99ca86 100644
@@ -167,7 +167,7 @@
 #define AR71XX_AHB_DIV_MASK		0x7
 
 #define AR724X_PLL_REG_CPU_CONFIG	0x00
-#define AR724X_PLL_REG_PCIE_CONFIG	0x18
+#define AR724X_PLL_REG_PCIE_CONFIG	0x10
 
 #define AR724X_PLL_FB_SHIFT		0
 #define AR724X_PLL_FB_MASK		0x3ff
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 MIPS: pci-ar724x: 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.

---
 arch/mips/include/asm/mach-ath79/ar71xx_regs.h |  3 ++
 arch/mips/pci/pci-ar724x.c                     | 42 ++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
arch/mips/include/asm/mach-ath79/ar71xx_regs.h +3 -0
index d99ca86..c83d8cc 100644
@@ -169,6 +169,9 @@
 #define AR724X_PLL_REG_CPU_CONFIG	0x00
 #define AR724X_PLL_REG_PCIE_CONFIG	0x10
 
+#define AR724X_PLL_REG_PCIE_CONFIG_PPL_BYPASS	BIT(16)
+#define AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET	BIT(25)
+
 #define AR724X_PLL_FB_SHIFT		0
 #define AR724X_PLL_FB_MASK		0x3ff
 #define AR724X_PLL_REF_DIV_SHIFT	10
arch/mips/pci/pci-ar724x.c +42 -0

68 lines not on this page · raw message

Signature · 1 line
2.7.4