rockchip: sdram: Allow the first bank to extend beyond 4 GiB
authorJonas Karlman <jonas@kwiboo.se>
Thu, 30 Jan 2025 22:07:11 +0000 (22:07 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 19 Feb 2025 15:11:06 +0000 (23:11 +0800)
Allow the first bank to extend beyond 4 GiB when the blob of space for
peripheral is located before start of DRAM, e.g. when start of DRAM
is 0x40000000 and continue beyond the 4 GiB mark.

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

index 1fb01e1..96a791b 100644 (file)
@@ -309,6 +309,8 @@ int dram_init_banksize(void)
        if (ram_top > SZ_4G && top < SZ_4G) {
                gd->bd->bi_dram[1].start = SZ_4G;
                gd->bd->bi_dram[1].size = ram_top - gd->bd->bi_dram[1].start;
+       } else if (ram_top > SZ_4G && top == SZ_4G) {
+               gd->bd->bi_dram[0].size = ram_top - gd->bd->bi_dram[0].start;
        }
 #else
 #ifdef CONFIG_SPL_OPTEE_IMAGE