From: Matthias Brugger Date: Fri, 6 Sep 2019 14:58:48 +0200 Subject: [U-Boot] [PATCH] rpi4: enable dram bank initialization In-Reply-To: <3e043d81-97c2-2d1e-97e6-1b760b3d0917@csgraf.de> References: <20190906115610.9175-1-matthias.bgg@kernel.org> <3e043d81-97c2-2d1e-97e6-1b760b3d0917@csgraf.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 06/09/2019 14:11, Alexander Graf wrote: > > On 06.09.19 13:56, matthias.bgg at kernel.org wrote: >> From: Matthias Brugger >> >> 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 >> --- >> This patch is based on basic RPi4 support implemented by series: >> https://www.mail-archive.com/u-boot at lists.denx.de/msg335667.html >> >> To actually work correctly we need the series that fixes the libftd: >> https://patchwork.ozlabs.org/cover/1158304/ >> >>   board/raspberrypi/rpi/rpi.c | 8 ++++++++ >>   configs/rpi_4_defconfig     | 2 +- >>   2 files changed, 9 insertions(+), 1 deletion(-) >> >> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c >> index fa57d50c95..eea8a69551 100644 >> --- a/board/raspberrypi/rpi/rpi.c >> +++ b/board/raspberrypi/rpi/rpi.c >> @@ -312,6 +312,14 @@ int dram_init(void) >>       return 0; >>   } >>   +#ifdef CONFIG_BCM2711 >> +int dram_init_banksize(void) >> +{ >> +    return fdtdec_decode_ram_size(gd->fdt_blob, NULL, 0, NULL, > > > This also depends on CONFIG_OF_BOARD, no? > I would need to double check if at this point gd->fdt_blob is in it's final state or might get updated afterwards. Actually I think we should change all RPi configs to OF_BOARD, which would also be necessary to implement a single binary for RPi3 and RPi4. But that's another story.