HiFive Unmatched: U-Boot stuck when loading Ramdisk
Sören Tempel
soeren at soeren-tempel.net
Fri Oct 15 14:54:06 CEST 2021
Hello,
I hope this is the right way to report u-boot issues. I tried to reach
out to the RISC-V subsystem maintainer beforehand but didn't receive a
response, hence sending this to the ML.
We are currently working on Alpine Linux support for the Hifive
Unmatched and at least two of our developers have access to a board
presently. While working on Alpine support, we noticed that U-Boot with
sifive_unmatched_defconfig gets stuck while loading the Alpine
initramfs. The last message received on the SiFive UART is:
Loading Ramdisk to ffa72000, end fffffc19 ...
Afterwards, U-Boot is stuck. We ran into this problem on two different
boards independently. Both with u-boot-2021.10 as well as u-boot master
(78e786decb6c8783568044c98891e64289cbf59c). I noticed that if I set
initrd_high manually (i.e. change the address region the Ramdisk is
loaded to) everything works as expected. For example, `setenv
initrd_high 0x85000000`. Maybe the default address region used for the
Ramdisk overlaps with the U-Boot stack/text region or something?
I am not familiar with U-Boot internals, but briefly looking at the code
and how the default Ramdisk address region is calculated, it seems to me
that many boards set CONFIG_SYS_BOOTMAPSZ but the board configuration
for the Unmatched and Unleashed doesn't. If I set it manually everything
works as expected. For example:
diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-unmatched.h
index d63a5f62fb..e1d3cb4ec4 100644
--- a/include/configs/sifive-unmatched.h
+++ b/include/configs/sifive-unmatched.h
@@ -25,6 +25,7 @@
#endif
+#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
#define CONFIG_SYS_SDRAM_BASE 0x80000000
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
This causes the Ramdisk to be loaded to 8f9f7000, end 8ffffb3d by
default which, looking at the Unmatched memory map, seems to be a more
sensible address region for the Ramdisk:
Moving Image from 0x84000000 to 0x80200000, end=811a9000
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f9f7000, end 8ffffb3d ... OK
Loading Device Tree to 000000008f9f1000, end 000000008f9f660b ... OK
If there is a better place to report this issue let me know. If you need
more information to reproduce/debug this issue I would be very happy to
help.
Greetings,
Sören
More information about the U-Boot
mailing list