openwrtv4/target/linux/ramips/patches-4.9
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
..
0004-MIPS-ralink-add-MT7621-pcie-driver.patch kernel: update kernel 4.9 to 4.9.20 2017-04-02 12:47:55 +02:00
0005-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
0006-MIPS-ralink-add-cpu-frequency-scaling.patch
0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
0009-PCI-MIPS-enable-PCIe-on-MT7688.patch kernel: update kernel 4.9 to 4.9.31 2017-06-08 01:03:39 +02:00
0013-owrt-hack-fix-mt7688-cache-issue.patch
0015-arch-mips-do-not-select-illegal-access-driver-by-def.patch
0024-GPIO-add-named-gpio-exports.patch
0025-pinctrl-ralink-add-pinctrl-driver.patch ramips: pinctrl: return proper error if pinctrl0 is empty 2017-07-27 09:12:15 +02:00
0026-DT-Add-documentation-for-gpio-ralink.patch
0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
0028-GPIO-ralink-add-mt7621-gpio-controller.patch
0029-phy-usb-add-ralink-phy.patch
0031-uvc-add-iPassion-iP2970-support.patch kernel: update kernel 4.9 to 4.9.17 2017-03-26 12:23:19 +02:00
0032-USB-dwc2-add-device_reset.patch
0034-NET-multi-phy-support.patch kernel: update kernel 4.9 to 4.9.29 2017-05-21 21:51:22 +02:00
0036-mtd-fix-cfi-cmdset-0002-erase-status-check.patch
0037-mtd-cfi-cmdset-0002-force-word-write.patch
0039-mtd-add-mt7621-nand-support.patch kernel: update kernel 4.9 to 4.9.31 2017-06-08 01:03:39 +02:00
0040-nand-hack.patch kernel: update kernel 4.9 to 4.9.31 2017-06-08 01:03:39 +02:00
0041-DT-Add-documentation-for-spi-rt2880.patch
0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch
0043-spi-add-mt7621-support.patch
0044-i2c-MIPS-adds-ralink-I2C-driver.patch
0045-i2c-add-mt7621-driver.patch
0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch
0047-DMA-ralink-add-rt2880-dma-engine.patch
0048-asoc-add-mt7620-support.patch
0051-serial-add-ugly-custom-baud-rate-hack.patch
0052-pwm-add-mediatek-support.patch
0054-mtd-add-chunked-read-io-to-m25p80.patch kernel: update kernel 4.9 to 4.9.37 2017-07-15 00:13:05 +02:00
0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch
0064-add_clk_round_rate.patch
0066-mt7621-enable-highmem.patch
0067-enable-mt7621-xhci.patch
0069-awake-rt305x-dwc2-controller.patch
0085-pinmux-util.patch
0090-ethernet.patch
0098-disable_cm.patch kernel: update kernel 4.9 to 4.9.17 2017-03-26 12:23:19 +02:00
0099-pci-mt7620.patch
100-mt7621-core-detect-hack.patch
0100-prom_fixes.patch
0101-MIPS-ralink-allow-NULL-clock-for-clk_get_rate.patch ramips: add NULL clock fix send upstream 2017-07-29 09:24:23 +02:00
101-mt7621-timer.patch ramips: refresh the rcu_sched patch and remove debug info 2017-07-26 09:32:22 +02:00
0105-set_mt7621_soc_type.patch
0200-linkit_bootstrap.patch
301-fix-rt3883.patch kernel: update kernel 4.9 to 4.9.17 2017-03-26 12:23:19 +02:00
0700-pinctrl-mt7620-mdio-as-refclk.patch
0720-arch-mips-ralink-add-i2c-clocks.patch kernel: update kernel 4.9 to 4.9.17 2017-03-26 12:23:19 +02:00
0901-spansion_nand_id_fix.patch kernel: update kernel 4.9 to 4.9.31 2017-06-08 01:03:39 +02:00
999-fix-pci-init-mt7620.patch ramips: fix PCI init on MT7620 with Linux 4.9+ 2017-07-31 21:28:37 +02:00