summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-02-05 02:58:59 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-02-07 16:41:33 +0100
commit38ae283cb4f6385dca56aa6c0baf5dbdd83cd1bc (patch)
tree4d052f32ca7783032b4d90a75fc3aa3319b91908 /target
parent18bbaad5530dea70a8495b788c4b308d66921561 (diff)
riscv: use default BIOS included in qemu
Diffstat (limited to 'target')
-rw-r--r--target/riscv32/Makefile18
-rw-r--r--target/riscv32/kernel/qemu-riscv327
-rw-r--r--target/riscv64/Makefile20
3 files changed, 17 insertions, 28 deletions
diff --git a/target/riscv32/Makefile b/target/riscv32/Makefile
index 37750d763..577ef3f15 100644
--- a/target/riscv32/Makefile
+++ b/target/riscv32/Makefile
@@ -6,7 +6,7 @@ include $(ADK_TOPDIR)/mk/kernel-build.mk
include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/arch/riscv/boot/Image
-QEMU_ARGS:=-M virt -m 256 -nographic -device loader,file=$(FW_DIR)/$(TARGET_KERNEL),addr=0x80200000
+QEMU_ARGS:=-M virt -m 512 -nographic
ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
endif
@@ -45,7 +45,7 @@ targethelp:
@echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
ifeq ($(ADK_TARGET_QEMU),y)
@echo "Start qemu with following command line:"
- @echo 'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/fw_jump.elf'
+ @echo 'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
endif
endif
@@ -54,21 +54,13 @@ kernel-strip:
kernel-install: kernel-strip
@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
-bbl:
- @rm -rf $(BUILD_DIR)/opensbi
- (cd $(BUILD_DIR)/ && git clone https://github.com/riscv/opensbi.git)
- (cd $(BUILD_DIR)/opensbi && PATH='$(HOST_PATH)' \
- CROSS_COMPILE=$(GNU_TARGET_NAME)- \
- PLATFORM=qemu/virt make)
- cp $(BUILD_DIR)/opensbi/build/platform/qemu/virt/firmware/fw_jump.elf $(FW_DIR)
-
# filesystem specific targets
ifeq ($(ADK_TARGET_FS),initramfs)
-imageinstall: kernel-install bbl $(FW_DIR)/$(INITRAMFS) targethelp
+imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfsarchive)
-imageinstall: kernel-install bbl $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfspiggyback)
-imageinstall: createinitramfs bbl targethelp
+imageinstall: createinitramfs targethelp
endif
diff --git a/target/riscv32/kernel/qemu-riscv32 b/target/riscv32/kernel/qemu-riscv32
index ab8ffb263..a1ef83228 100644
--- a/target/riscv32/kernel/qemu-riscv32
+++ b/target/riscv32/kernel/qemu-riscv32
@@ -5,3 +5,10 @@ CONFIG_CPU_RV_GENERIC=y
CONFIG_RV_SYSRISCV_ATOMIC=y
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
CONFIG_32BIT=y
+CONFIG_HVC_DRIVER=y
+CONFIG_HVC_RISCV_SBI=y
+CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_SOC_SIFIVE=y
+CONFIG_SERIAL_SIFIVE=y
+CONFIG_SERIAL_SIFIVE_CONSOLE=y
diff --git a/target/riscv64/Makefile b/target/riscv64/Makefile
index c2b50a688..44dd98351 100644
--- a/target/riscv64/Makefile
+++ b/target/riscv64/Makefile
@@ -6,7 +6,7 @@ include $(ADK_TOPDIR)/mk/kernel-build.mk
include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/arch/riscv/boot/Image
-QEMU_ARGS:=-M virt -m 512 -nographic -bios $(FW_DIR)/fw_jump.elf
+QEMU_ARGS:=-M virt -m 512 -nographic
ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
endif
@@ -53,26 +53,16 @@ kernel-strip:
kernel-install: kernel-strip
-boot:
- @rm -rf $(BUILD_DIR)/opensbi
- (cd $(BUILD_DIR)/ && git clone https://github.com/riscv/opensbi.git)
- (cd $(BUILD_DIR)/opensbi && PATH='$(HOST_PATH)' \
- CROSS_COMPILE=$(GNU_TARGET_NAME)- \
- FW_PAYLOAD_PATH=$(KERNEL) \
- PLATFORM=generic make)
- cp $(BUILD_DIR)/opensbi/build/platform/generic/firmware/fw_jump.elf \
- $(FW_DIR)
-
# filesystem specific targets
ifeq ($(ADK_TARGET_FS),archive)
-imageinstall: kernel-install boot $(FW_DIR)/$(ROOTFSTARBALL) targethelp
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfs)
-imageinstall: kernel-install boot $(FW_DIR)/$(INITRAMFS) targethelp
+imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfsarchive)
-imageinstall: kernel-install boot $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfspiggyback)
-imageinstall: createinitramfs boot targethelp
+imageinstall: createinitramfs targethelp
endif