]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rpi4: enable dram bank initialization
authorMatthias Brugger <mbrugger@suse.com>
Mon, 9 Sep 2019 16:31:56 +0000 (18:31 +0200)
committerMatthias Brugger <mbrugger@suse.com>
Tue, 1 Oct 2019 09:14:47 +0000 (11:14 +0200)
When booting through the efi stub, the memory map get's created by
reading the dram bank information. Depending on the version of the RPi4
this information changes. Read the device tree to initialize the dram
bank data structure. This way the kernel is able to access the whole
range of available memory.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
board/raspberrypi/rpi/rpi.c
configs/rpi_4_defconfig

index fa57d50c95edfb6ab8bcbf5b4bda41208e05d2b9..9e0abdda3190c647161265e392f85ec08be807ec 100644 (file)
@@ -312,6 +312,16 @@ int dram_init(void)
        return 0;
 }
 
+#ifdef CONFIG_OF_BOARD
+#ifdef CONFIG_BCM2711
+int dram_init_banksize(void)
+{
+       return fdtdec_decode_ram_size(gd->fdt_blob, NULL, 0, NULL,
+                                    (phys_size_t *)&gd->ram_size, gd->bd);
+}
+#endif
+#endif
+
 static void set_fdtfile(void)
 {
        const char *fdtfile;
index 2d63197d75dd0a121980fe7bed91d21c364a4b52..2954e17ac3bd2476f65f5d043a14df6162fe5e85 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_ARCH_BCM283X=y
 CONFIG_SYS_TEXT_BASE=0x00080000
 CONFIG_TARGET_RPI_4=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_NR_DRAM_BANKS=1
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set