From 71cc03c5c98c4d2dbf13061690f61394711ccc66 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Wed, 3 May 2023 07:33:11 +0000 Subject: [PATCH 1/3] Improve riscv defconfigs - Enable "sbi" command. - Enable SBI based reset and poweroff commands. - Set max supported CPUs on QEMU targets to 32. - Enable relocation and use firmware FDT/DTB (i.e. generated by QEMU) for QEMU targets. Signed-off-by: David Abdurachmanov --- configs/qemu-riscv64_defconfig | 8 ++++++++ configs/qemu-riscv64_smode_defconfig | 5 +++++ configs/qemu-riscv64_spl_defconfig | 3 +++ configs/sifive_unleashed_defconfig | 5 +++++ configs/sifive_unmatched_defconfig | 5 +++++ include/configs/qemu-riscv.h | 2 -- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig index d64f3400..09816973 100644 --- a/configs/qemu-riscv64_defconfig +++ b/configs/qemu-riscv64_defconfig @@ -23,3 +23,11 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_MTD=y CONFIG_FLASH_SHOW_PROGRESS=0 CONFIG_SYS_MAX_FLASH_BANKS=2 +CONFIG_NR_CPUS=32 +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="cp.l ${fdtcontroladdr} ${fdt_addr_r} 0x20000;" +CONFIG_CMD_SBI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y +CONFIG_CMD_POWEROFF=y +CONFIG_SYSRESET_CMD_POWEROFF=y diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 53c2f489..c9bdc485 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -26,3 +26,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_MTD=y CONFIG_FLASH_SHOW_PROGRESS=0 CONFIG_SYS_MAX_FLASH_BANKS=2 +CONFIG_CMD_SBI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y +CONFIG_CMD_POWEROFF=y +CONFIG_SYSRESET_CMD_POWEROFF=y diff --git a/configs/qemu-riscv64_spl_defconfig b/configs/qemu-riscv64_spl_defconfig index 9c8eb155..de65d4f0 100644 --- a/configs/qemu-riscv64_spl_defconfig +++ b/configs/qemu-riscv64_spl_defconfig @@ -28,3 +28,6 @@ CONFIG_DM_MTD=y CONFIG_FLASH_SHOW_PROGRESS=0 CONFIG_SYS_MAX_FLASH_BANKS=2 # CONFIG_BINMAN_FDT is not set +CONFIG_NR_CPUS=32 +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="cp.l ${fdtcontroladdr} ${fdt_addr_r} 0x20000;" diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig index ae0f9b42..c4958785 100644 --- a/configs/sifive_unleashed_defconfig +++ b/configs/sifive_unleashed_defconfig @@ -41,3 +41,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_CLK=y CONFIG_DM_MTD=y +CONFIG_CMD_SBI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y +CONFIG_CMD_POWEROFF=y +CONFIG_SYSRESET_CMD_POWEROFF=y diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index c24feb68..74cdb4ea 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -63,3 +63,8 @@ CONFIG_DM_SCSI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y +CONFIG_CMD_SBI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y +CONFIG_CMD_POWEROFF=y +CONFIG_SYSRESET_CMD_POWEROFF=y diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h index 20135f56..23db7b6f 100644 --- a/include/configs/qemu-riscv.h +++ b/include/configs/qemu-riscv.h @@ -35,8 +35,6 @@ "qemu " #define CFG_EXTRA_ENV_SETTINGS \ - "fdt_high=0xffffffffffffffff\0" \ - "initrd_high=0xffffffffffffffff\0" \ "kernel_addr_r=0x84000000\0" \ "kernel_comp_addr_r=0x88000000\0" \ "kernel_comp_size=0x4000000\0" \ -- 2.40.1