From 91bc909d317cfef08cc263e406e747e40ad4ab6c Mon Sep 17 00:00:00 2001 From: Yuri Zaporozhets Date: Mon, 11 Nov 2024 20:24:04 +0100 Subject: [PATCH 1/4] spl: increase SPL_SYS_MALLOC_SIZE when using BIOSEMU on RISC-V If BIOSEMU is compiled for RISC-V (SiFive Unmatched board) and the function dm_pci_run_vga_bios() is executed, U-Boot stops with error message saying that the SPL malloc pool is too small. So increase the default pool size when both BIOSEMU and RISCV parameters are set. Signed-off-by: Yuri Zaporozhets Reviewed-by: Leo Yu-Chi Liang --- common/spl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 045fcac10a5..240543c9c7e 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -462,6 +462,7 @@ config SPL_CUSTOM_SYS_MALLOC_ADDR config SPL_SYS_MALLOC_SIZE hex "Size of the SPL malloc pool" depends on SPL_SYS_MALLOC + default 0x180000 if BIOSEMU && RISCV default 0x100000 config SPL_READ_ONLY From afc52da8946909bfd21ea224281effc37440edfc Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 12 Nov 2024 11:42:23 +0100 Subject: [PATCH 2/4] configs: SiFive Unmatched: enable 'env erase' sub-command With the move from script based booting to using bootmeth a lot of environment variables have changed. To always use the default environment it is recommendable to erase the environment stored in the SPI flash. This can be done with the 'env erase' sub-command. Signed-off-by: Heinrich Schuchardt Reviewed-by: Leo Yu-Chi Liang --- configs/sifive_unmatched_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index 058e5fab683..6fede360aeb 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -42,6 +42,7 @@ CONFIG_SPL_SYS_MALLOC=y CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_SPI_LOAD=y +CONFIG_CMD_ERASEENV=y CONFIG_CMD_EEPROM=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_PWM=y From 185986caebf623c11071db8cb1d94e0d82f1d9e7 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 12 Nov 2024 17:27:22 +0100 Subject: [PATCH 3/4] configs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE To restore MMC boot, enable SPL_SYS_MMCSD_RAW_MODE and recover SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION and SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION. Fixes: 2a00d73d081 ("spl: mmc: Try to clean up raw-mode options") Signed-off-by: Andreas Schwab Reviewed-by: Leo Yu-Chi Liang --- configs/starfive_visionfive2_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig index 20f89ae6796..319e1d358a0 100644 --- a/configs/starfive_visionfive2_defconfig +++ b/configs/starfive_visionfive2_defconfig @@ -56,6 +56,9 @@ CONFIG_SPL_PAD_TO=0x0 CONFIG_SPL_SYS_MALLOC=y CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x80000000 +CONFIG_SPL_SYS_MMCSD_RAW_MODE=y +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2 CONFIG_SPL_SYS_MALLOC_SIZE=0x400000 CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y From bdca70632dad38a1f7830c955771c0bd88ce7ae0 Mon Sep 17 00:00:00 2001 From: Yuri Zaporozhets Date: Tue, 19 Nov 2024 21:59:59 +0100 Subject: [PATCH 4/4] configs: enable CONFIG_PCI_REGION_MULTI_ENTRY=y in sifive_unmatched_defconfig Currently, the PCI subsystem selects the small "region 2" (which starts at 0x7000000) as bus_addr/phys_addr. As a consequence, the BAR0 on PCIe video card cannot be initialized, because it simply doesn't fit into 0x1000000 bytes size of "region 2". U-Boot should use "region 1" instead (the one which starts at 0x60090000), because it has much bigger size (0xFF70000), and easily accomodates BAR0 of the video card. Linux kernel also uses 0x60090000 as bus_start/phys_start. Signed-off-by: Yuri Zaporozhets Reviewed-by: Leo Yu-Chi Liang --- configs/sifive_unmatched_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index 6fede360aeb..6f511796a20 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -36,6 +36,7 @@ CONFIG_DISPLAY_BOARDINFO=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_ID_EEPROM=y CONFIG_PCI_INIT_R=y +CONFIG_PCI_REGION_MULTI_ENTRY=y CONFIG_SPL_MAX_SIZE=0x100000 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set CONFIG_SPL_SYS_MALLOC=y