linux/arch/mips/ralink
Chuanhong Guo cc19db8b31 MIPS: ralink: 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: 139c949f7f MIPS: ("ralink: mt7621: add memory detection support")
Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Tested-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2022-02-16 20:46:50 +01:00
..
bootrom.c MIPS: ralink: bootrom: mark a function as __init to save some memory 2020-05-31 13:35:13 +02:00
cevt-rt3352.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
clk.c mips: ralink: convert to CONFIG_COMMON_CLK 2021-06-08 17:00:09 +02:00
common.h MIPS: ralink: mt7621: add memory detection support 2021-03-29 11:18:54 +02:00
early_printk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ill_acc.c mips: ralink: add missing of_node_put() call in ill_acc_of_setup() 2021-12-14 10:05:12 +01:00
irq-gic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq.c mips: Bulk conversion to generic_handle_domain_irq() 2021-08-12 11:39:40 +01:00
Kconfig PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver 2021-10-21 10:59:18 -05:00
Makefile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mt7620.c pinctrl: ralink: move MT7620 SoC pinmux config into a new 'pinctrl-mt7620.c' file 2021-06-07 09:17:47 +02:00
mt7621.c MIPS: ralink: mt7621: do memory detection on KSEG1 2022-02-16 20:46:50 +01:00
of.c of/fdt: Rework early_init_dt_scan_memory() to call directly 2021-12-16 16:07:52 -06:00
Platform MIPS: ralink: Don't include objects twice 2020-05-15 09:10:07 +02:00
prom.c pinctrl: ralink: move ralink architecture pinmux header into the driver 2021-06-07 09:17:47 +02:00
reset.c MIPS: ralink: manage low reset lines 2021-02-04 13:35:01 +01:00
rt288x.c pinctrl: ralink: move RT288X SoC pinmux config into a new 'pinctrl-rt288x.c' file 2021-06-07 09:17:48 +02:00
rt305x.c pinctrl: ralink: move RT305X SoC pinmux config into a new 'pinctrl-rt305x.c' file 2021-06-07 09:17:47 +02:00
rt3883.c pinctrl: ralink: move RT3883 SoC pinmux config into a new 'pinctrl-rt3883.c' file 2021-06-07 09:17:47 +02:00
timer-gic.c MIPS: ralink: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-02-19 10:37:58 -08:00
timer.c MIPS: Remove dev_err() usage after platform_get_irq() 2019-08-26 11:26:04 +01:00