openwrt/target/linux/ramips/patches-5.4
Chuanhong Guo 7612ecb201 ramips: mt7621: do memory detection on KSEG1
It's reported that current memory detection code occasionally detects
larger memory under some bootloaders.
Current memory detection code tests whether address space wraps around
on KSEG0, which is unreliable because it's cached.

Rewrite memory size detection to perform the same test on KSEG1 instead.
While at it, this patch also does the following two things:
1. use a fixed pattern instead of a random function pointer as the magic
   value.
2. add an additional memory write and a second comparison as part of the
   test to prevent possible smaller memory detection result due to
   leftover values in memory.

Fixes: 6d91ddf517 ("ramips: mt7621: add support for memory detection")
Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 2f024b7933)
[backport for OpenWrt 21.02 as it was reproducible with Kernel 5.4, see [1]]
[1]: https://forum.openwrt.org/t/113081
Tested-by: Dimitri Souza <dimitri.souza@gmail.com> [mt7621/archer-c6-v3]
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2022-02-22 20:48:46 +08:00
..
100-mt7621-core-detect-hack.patch
101-mt7621-timer.patch
102-mt7621-fix-cpu-clk-add-clkdev.patch
105-mt7621-memory-detect.patch kernel: Activate FORTIFY_SOURCE for MIPS kernel 5.4 2021-05-14 23:32:22 +02:00
110-mt7621-perfctr-fix.patch
111-gpio-mmio-introduce-BGPIOF_NO_SET_ON_INPUT.patch ramips: mt7621: backport GPIO driver fix 2020-04-04 14:14:43 +08:00
112-gpio-mt7621-add-BGPIOF_NO_SET_ON_INPUT-flag.patch ramips: mt7621: backport GPIO driver fix 2020-04-04 14:14:43 +08:00
200-add-ralink-eth.patch kernel: bump 5.4 to 5.4.158 2021-11-07 01:10:53 +01:00
300-mt7620-export-chip-version-and-pkg.patch
301-MIPS-ralink-mt7621-introduce-soc_device-initializati.patch ramips: mt7621: introduce 'soc_device' initialization 2020-04-04 14:56:14 +08:00
302-spi-nor-add-gd25q512.patch kernel: bump 5.4 to 5.4.102 2021-03-06 15:51:54 +01:00
325-mt7621-fix-memory-detect.patch ramips: mt7621: do memory detection on KSEG1 2022-02-22 20:48:46 +08:00
401-net-ethernet-mediatek-support-net-labels.patch kernel: bump 5.4 to 5.4.124 2021-06-06 17:54:51 +02:00
990-NET-no-auto-carrier-off-support.patch kernel: bump 5.4 to 5.4.158 2021-11-07 01:10:53 +01:00
991-at803x.patch kernel: bump 5.4 to 5.4.79 2020-11-24 15:36:59 +01:00
0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch ramips: add support for Ubiquiti UniFi 6 Lite 2021-01-05 16:25:13 +01:00
0002-MIPS-Always-define-builtin_cmdline.patch ramips: add support for Ubiquiti UniFi 6 Lite 2021-01-05 16:25:13 +01:00
0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch kernel: bump 5.4 to 5.4.87 2021-01-08 21:09:17 +01: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 kernel: bump 5.4 to 5.4.124 2021-06-06 17:54:51 +02:00
0010-MIPS-add-bootargs-override-property.patch ramips: add support for Ubiquiti UniFi 6 Lite 2021-01-05 16:25:13 +01:00
0013-owrt-hack-fix-mt7688-cache-issue.patch kernel: bump 5.4 to 5.4.87 2021-01-08 21:09:17 +01:00
0015-arch-mips-do-not-select-illegal-access-driver-by-def.patch
0024-GPIO-add-named-gpio-exports.patch kernel: bump 5.4 to 5.4.114 2021-05-02 14:32:27 +02:00
0026-DT-Add-documentation-for-gpio-ralink.patch ramips: replace pinctrl property names 2020-04-12 22:29:17 +08:00
0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch ramips: replace pinctrl property names 2020-04-12 22:29:17 +08:00
0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch
0031-uvc-add-iPassion-iP2970-support.patch kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
0037-mtd-cfi-cmdset-0002-force-word-write.patch
0041-DT-Add-documentation-for-spi-rt2880.patch
0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch
0044-i2c-MIPS-adds-ralink-I2C-driver.patch
0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch
0048-asoc-add-mt7620-support.patch kernel: bump 5.4 to 5.4.124 2021-06-06 17:54:51 +02:00
0051-serial-add-ugly-custom-baud-rate-hack.patch kernel: bump 5.4 to 5.4.163 2021-12-12 20:08:17 +01:00
0052-pwm-add-mediatek-support.patch
0069-awake-rt305x-dwc2-controller.patch kernel: bump 5.4 to 5.4.58 2020-08-18 18:14:54 +02:00
0070-weak_reordering.patch
0098-disable_cm.patch kernel: bump 5.4 to 5.4.163 2021-12-12 20:08:17 +01:00
0100-staging-mt7621-pci-simplify-mt7621_pcie_init_virtual.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0101-staging-mt7621-pci-enable-clock-bit-for-each-port.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0102-staging-mt7621-pci-use-gpios-for-properly-reset.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0103-staging-mt7621-pci-change-value-for-PERST_DELAY_MS.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0104-staging-mt7621-pci-release-gpios-after-pci-initializ.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0105-staging-mt7621-pci-delete-no-more-needed-mt7621_rese.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0106-staging-mt7621-pci-phy-add-mt7621_phy_rmw-to-simplif.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0107-staging-mt7621-pci-fix-io-space-and-properly-set-res.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0108-staging-mt7621-pci-fix-register-to-set-up-virtual-br.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0109-staging-mt7621-pci-don-t-return-if-get-gpio-fails.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0110-staging-mt7621-pci-phy-avoid-to-create-to-different-.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0111-staging-mt7621-pci-use-only-two-phys-from-device-tre.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0112-staging-mt7621-pci-change-variable-to-print-for-slot.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0113-staging-mt7621-pci-be-sure-gpio-descriptor-is-null-o.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0114-staging-mt7621-pci-avoid-to-poweroff-the-phy-for-slo.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0115-staging-mt7621-pci-delete-release-gpios-related-code.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0116-staging-mt7621-pci-use-builtin_platform_driver.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0117-staging-mt7621-pci-phy-use-builtin_platform_driver.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0118-staging-mt7621-pci-phy-re-do-xtal_mode-detection.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0119-staging-mt7621-pci-avoid-to-set-iomem_resource-addre.patch ramips: mt7621: backport PCIe driver fixes from staging-test 2020-04-04 14:14:43 +08:00
0120-staging-mt7621-pci-properly-power-off-dual-ported-pc.patch ramips: mt7621: backport more pcie driver fixes 2020-04-18 13:06:48 +08:00
0121-staging-mt7621-pci-fix-PCIe-interrupt-mapping.patch ramips: mt7621: backport more pcie driver fixes 2020-04-18 13:06:48 +08:00
0122-mips-ralink-enable-zboot-support.patch kernel: bump 5.4 to 5.4.163 2021-12-12 20:08:17 +01:00
0123-mips-ralink-manage-low-reset-lines.patch kernel: bump 5.4 to 5.4.99 2021-02-19 07:15:59 +01:00
0200-linkit_bootstrap.patch
0300-mtd-rawnand-add-driver-support-for-MT7621-nand-flash.patch ramips: fix NAND flash driver ECC bit position mask 2022-02-16 21:29:10 +01:00
0301-dt-bindings-add-documentation-for-mt7621-nand-driver.patch ramips: mt7621: add new NAND driver 2020-04-04 14:56:14 +08:00