Skip to content
Commit cc19db8b authored by Chuanhong Guo's avatar Chuanhong Guo Committed by Thomas Bogendoerfer
Browse files

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: 139c949f

 MIPS: ("ralink: mt7621: add memory detection support")
Reported-by: default avatarRui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: default avatarChuanhong Guo <gch981213@gmail.com>
Tested-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Tested-by: default avatarRui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent d9565bf4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment