openwrtv3/target/linux
Ilya Katsnelson bb4d5006c0 ramips: fix PCI init on MT7620 with Linux 4.9+
So, this is kind of complicated. This has been upstream for a while,
imported from OpenWRT/LEDE with some cleanups. LEDE ramips has stayed
on linux-4.4 this whole time, with the old(er) version of the patch
that had correct behavior[0], while upstream got changed[1].

When LEDE updated to kernel 4.9, the older version of the code from
the patch got replaced with the upstream version containing the bug.

The original behavior, however, seems to be correct here, as the
official programming guide[2] indicates that bit 31 (PDRV_SW_SET)
in register PPLL_CFG1 is reserved, but bit 23 (added as PPLL_LD)
is the PPLL lock state (which also happens to line up with the
error message).

The original confusion probably comes from the double definition
of PDRV_SW_SET[3, 4] in the upstream code, with one correct definition
(31) and one incorrect one (23).

I've also used the opportunity to clean up the error message a bit -
it's still not really helpful to anyone who doesn't already know what
the PPLL is, but at least it's slightly more readable now.

This will probably need to be upstreamed as well, since with the way
it's currently set up, it's unlikely PCI ever worked for anyone who's
running an upstream kernel on that SoC.

[0]: 05d6e92594/target/linux/ramips/patches-4.4/0009-PCI-MIPS-adds-mt7620a-pcie-driver.patch (L259)
[1]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L246)
[2]: http://www.anz.ru/files/mediatek/MT7620_ProgrammingGuide.pdf
[3]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L36)
[4]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L39)

Signed-off-by: Ilya Katsnelson <me@0upti.me>
2017-07-31 21:28:37 +02:00
..
adm5120 treewide: populate boardname and model earlier 2017-07-15 23:13:34 +02:00
adm8668 build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
apm821xx kernel: update kernel 4.9 to version 4.9.40 2017-07-28 22:46:17 +02:00
ar7 ar7: add NULL clock fix send upstream 2017-07-29 09:24:17 +02:00
ar71xx kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
arc770 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
archs38 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
armvirt kernel: cleanup CONFIG_SCHED_HRTICK 2017-06-29 04:46:59 +02:00
at91 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
ath25 kernel: cleanup CONFIG_SCHED_HRTICK 2017-06-29 04:46:59 +02:00
au1000 kernel: update kernel 3.18 to version 3.18.43 2016-10-24 20:25:14 +03:00
bcm53xx kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
brcm47xx brcm47xx: fix switch port mapping on Asus RT-N12 and RT-N16 models 2017-07-21 08:09:45 +02:00
brcm63xx brcm63xx: add NULL clock fix send upstream 2017-07-29 09:24:27 +02:00
brcm2708 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
cns3xxx treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
gemini kernel: use .patch extension for all patches 2017-06-27 06:37:46 +02:00
generic kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
imx6 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
ipq806x treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
ixp4xx treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
kirkwood treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
lantiq lantiq: fix sleep with spinlock held in xrx200 network driver 2017-07-20 19:10:29 +02:00
layerscape kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
malta kernel: cleanup CONFIG_SCHED_HRTICK 2017-06-29 04:46:59 +02:00
mcs814x treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
mediatek treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
mpc85xx treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
mvebu kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
mxs treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
octeon treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
omap kernel: cleanup CONFIG_SCHED_HRTICK 2017-06-29 04:46:59 +02:00
omap24xx treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
orion treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
oxnas kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
pistachio kernel: update kernel 4.9 to 4.9.37 2017-07-15 00:13:05 +02:00
ppc40x treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
ppc44x ppc44x: mark as broken 2017-01-10 12:49:34 +01:00
ramips ramips: fix PCI init on MT7620 with Linux 4.9+ 2017-07-31 21:28:37 +02:00
rb532 kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
sunxi treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
uml kernel: update kernel 4.4 to version 4.4.79 2017-07-28 22:46:26 +02:00
x86 x86: Fix xen serial console by removing conflicting PATA driver 2017-07-16 11:31:52 +02:00
xburst xburst: enable high-res timers, refresh kernel config 2017-06-07 18:31:10 +02:00
zynq treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
Makefile