On Sun, 9 Mar 2025, at 7:31 PM, Jernej Skrabec wrote:
> 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 <[email protected]>
> ---
>  arch/arm/mach-sunxi/dram_sun50i_h616.c | 58 +++++++++++++++++++++++++-
>  1 file changed, 56 insertions(+), 2 deletions(-)

Tested with H700 devices with both 1GB (RG35XX-H) and 4GB (RG40XX-V) of LPDDR4; 
reliable detection with over 50 boots combined on both devices. Previously ~1 
in 10 boots would mistakenly incorrectly detect RAM size, in particular 2 or 4 
GB RAM on the 1GB device.

Tested-by: Ryan Walklin <[email protected]>

Regards,

Ryan

Reply via email to