From: Matthias Brugger Date: Thu, 5 Dec 2019 17:58:00 +0100 Subject: [PATCH 2/2] rpi: Enable DRAM bank initialization on arm64 In-Reply-To: <57b25010-cb6c-a063-4619-8cd9091e4d78@gmx.de> References: <20191204165242.22463-1-matthias.bgg@kernel.org> <20191204165242.22463-2-matthias.bgg@kernel.org> <57b25010-cb6c-a063-4619-8cd9091e4d78@gmx.de> Message-ID: <099c8385-a985-9d39-5905-cfb503b8386f@suse.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 04/12/2019 22:28, Heinrich Schuchardt wrote: > On 12/4/19 5:52 PM, matthias.bgg at kernel.org wrote: >> From: Matthias Brugger >> >> Up to now we only update the DRAM banks when we are define >> CONFIG_BCM2711. But our one binary approach uses a config that supports >> BCM2837 and BCM2711. As a result we only see one gigabyte of RAM on > > %s/gigabyte/gibibyte/ > > There are RPi 4 with 1GiB, 2GiB, 4GiB. All have more than 1 GB but only > some have more than 1GiB. > >> Raspberry Pi 4, although it has more RAM. > > I guess this should be changed to "even if it has more RAM" as you can > also buy a RPi 4 with 1 GiB of RAM. > >> Fix this by calling dram_init_banksize when we are booting a U-Boot build >> for arm64. >> >> Fixes: 5694090670 ("ARM: defconfig: add unified config for RPi3 and RPi4") >> >> Signed-off-by: Matthias Brugger >> >> --- >> >>   board/raspberrypi/rpi/rpi.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c >> index 76f1c55b65..35fcef2b56 100644 >> --- a/board/raspberrypi/rpi/rpi.c >> +++ b/board/raspberrypi/rpi/rpi.c >> @@ -271,7 +271,7 @@ int dram_init(void) >>   } >> >>   #ifdef CONFIG_OF_BOARD >> -#ifdef CONFIG_BCM2711 >> +#ifdef CONFIG_ARM64 > > The change does not relate to your commit message. > > Please, explain why you enable fdtdec_decode_ram_size() on the RPi 3 in > 64bit configuration and disables it on the RPi 4 in 32bit configuration. > Right, I'll test with 32 bit, but I think it does no harm. Will delete the ARM64 ifdef. > What happens here if we have a RPi 4 with more than 1 GiB of memory and > use a 32bit U-Boot? > Just tested that. It will always show you 1 GiB of memory because the rpi_4_32b_defconfig states only one DRAM banks. I'll fix this as well. Regards, Matthias > Best regards > > Heinrich > >>   int dram_init_banksize(void) >>   { >>       int ret; >> >