sunxi: H616: dram: Improve address wrapping detection
authorJernej Skrabec <jernej.skrabec@gmail.com>
Sun, 9 Mar 2025 06:31:43 +0000 (07:31 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Thu, 27 Mar 2025 00:26:35 +0000 (00:26 +0000)
commit380802938673c6c82b776a33eda6d57eba7ca914
tree6353685a9e6f768cf9ddb8b5d2aee76a67b288ce
parent40c687aef01fd0ccdf24285f577db1bc0d64db16
sunxi: H616: dram: Improve address wrapping detection

It turns out that checking just one write is not enough. Due to
unexplained reasons scan procedure detected double the size. By making
16 dword writes and comparisons that never happens.

New procedure is also inverted. Instead of writing two different values
to base address and some offset and then reading both and comparing
values, simplify this by writing pattern at the base address and then
search for this pattern at some offset.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Ryan Walklin <ryan@testtoast.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/mach-sunxi/dram_sun50i_h616.c