rockchip: sdram: add basic support for sdram reg info version 3
authorJonas Karlman <jonas@kwiboo.se>
Tue, 7 Feb 2023 17:27:10 +0000 (17:27 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Tue, 28 Feb 2023 10:07:26 +0000 (18:07 +0800)
commitbde73b14f0f46760f1a0ec84a9474ed93a22e496
tree69f26e84d24064d3811ee19c3aba973ddc63b84a
parent5bb4697ca3b731a4153a26da7a742b8360667658
rockchip: sdram: add basic support for sdram reg info version 3

Newer DRAM initialization blobs from vendor can encode sdram info in a
new version 3 format. The new format makes use of more bits in sys_reg3
compared to the version 2 format.

Add basic support for detecting the version 3 format and decoding the
high bits used for ddrtype.

This fixes decode of sdram size on my RK3568 boards that have LPDDR4X.

Details on the new format was deciphered from vendor u-boot commit [1].

[1] https://github.com/rockchip-linux/u-boot/commit/c69667e0e2bf4290ab1f408fcde58b8806ac266b

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/include/asm/arch-rockchip/sdram.h
arch/arm/mach-rockchip/sdram.c