From: Stefan Agner Date: Fri, 20 Nov 2020 13:57:39 +0100 Subject: RPi4 hang when booting from USB mass storage Message-ID: <0fe384ce683d71503775b6f48e813043@agner.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, When trying to boot rpi_4_32b_defconfig of U-Boot 2020.10 (or master) using a USB flash drive, U-Boot hangs early at: U-Boot 2020.10 (Nov 20 2020 - 10:25:26 +0100) DRAM: 3.9 GiB The weird thing is that at this point U-Boot does not access USB/SD card at all, still it matters if it got booted via USB or SD card. What I noticed is that dram_init mem_size is different depending on where I boot from, from USB: U-Boot 2020.10-dirty (Nov 20 2020 - 11:35:45 +0100) DRAM: dram_init... dram_init 993001472 dram_init_banksize 3.9 GiB And from SD-card: U-Boot 2020.10-dirty (Nov 20 2020 - 11:37:06 +0100) DRAM: dram_init... dram_init 994050048 dram_init_banksize 3.9 GiB I tried different firmware versions from stable branch (7caead9, ef72c17 used in current Raspberry Pi OS and latest 2ba11f2) and U-Boot versions back to 2020.01 without success. What does work is forcing the size in dram_init() to 512M: @@ -267,6 +268,8 @@ int dram_init(void) } gd->ram_size = msg->get_arm_mem.body.resp.mem_size; + gd->ram_size = SZ_512M; + printf("forcing dram_init %lld\n", gd->ram_size); return 0; } I did try RPi 4 Model B 2GB and 4GB. Any idea? -- Stefan