summaryrefslogtreecommitdiff
path: root/target/riscv64
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2020-02-16 13:28:47 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2020-02-17 13:20:23 +0100
commitbc6956f08c225304cfb62b7314a660f52701d30c (patch)
tree9ad4f384be743de2a152a1fa81503978d7a5f58a /target/riscv64
parent7025cc5131adbafb70a7f6715cb8d17f0446ec58 (diff)
riscv64: use upstream Linux kernel
Diffstat (limited to 'target/riscv64')
-rw-r--r--target/riscv64/Makefile31
-rw-r--r--target/riscv64/kernel/qemu-riscv642
-rw-r--r--target/riscv64/systems/qemu-riscv641
3 files changed, 17 insertions, 17 deletions
diff --git a/target/riscv64/Makefile b/target/riscv64/Makefile
index bc31d62d8..892b88e6e 100644
--- a/target/riscv64/Makefile
+++ b/target/riscv64/Makefile
@@ -5,8 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
include $(ADK_TOPDIR)/mk/kernel-build.mk
include $(ADK_TOPDIR)/mk/image.mk
-KERNEL:=$(LINUX_DIR)/vmlinux
-OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
+KERNEL:=$(LINUX_DIR)/arch/riscv/boot/Image
QEMU_ARGS:=-M virt -m 256 -nographic
ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
@@ -51,31 +50,29 @@ endif
endif
kernel-strip:
- $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
kernel-install: kernel-strip
- @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
-bbl:
- @mkdir -p $(BUILD_DIR)/bbl
- @rm -rf $(BUILD_DIR)/riscv-pk
- (cd $(BUILD_DIR)/ && git clone https://github.com/riscv/riscv-pk.git)
- (cd $(BUILD_DIR)/bbl && PATH='$(HOST_PATH)' ../riscv-pk/configure \
- --host=$(GNU_TARGET_NAME) --target=$(GNU_TARGET_NAME) \
- --with-payload=$(FW_DIR)/$(TARGET_KERNEL))
- (cd $(BUILD_DIR)/bbl && PATH='$(HOST_PATH)' make)
- cp $(BUILD_DIR)/bbl/bbl $(FW_DIR)/$(TARGET_KERNEL)
+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=qemu/virt make)
+ cp $(BUILD_DIR)/opensbi/build/platform/qemu/virt/firmware/fw_payload.elf \
+ $(FW_DIR)/$(TARGET_KERNEL)
# filesystem specific targets
ifeq ($(ADK_TARGET_FS),archive)
-imageinstall: kernel-install bbl $(FW_DIR)/$(ROOTFSTARBALL) targethelp
+imageinstall: kernel-install boot $(FW_DIR)/$(ROOTFSTARBALL) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfs)
-imageinstall: kernel-install bbl $(FW_DIR)/$(INITRAMFS) targethelp
+imageinstall: kernel-install boot $(FW_DIR)/$(INITRAMFS) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfsarchive)
-imageinstall: kernel-install bbl $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
+imageinstall: kernel-install boot $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
endif
ifeq ($(ADK_TARGET_FS),initramfspiggyback)
-imageinstall: createinitramfs bbl targethelp
+imageinstall: createinitramfs boot targethelp
endif
diff --git a/target/riscv64/kernel/qemu-riscv64 b/target/riscv64/kernel/qemu-riscv64
index 4991fbd69..019e13c19 100644
--- a/target/riscv64/kernel/qemu-riscv64
+++ b/target/riscv64/kernel/qemu-riscv64
@@ -1,5 +1,7 @@
CONFIG_RISCV=y
CONFIG_SIFIVE_PLIC=y
+CONFIG_HVC_DRIVER=y
CONFIG_HVC_RISCV_SBI=y
+CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
CONFIG_CMDLINE_BOOL=y
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
diff --git a/target/riscv64/systems/qemu-riscv64 b/target/riscv64/systems/qemu-riscv64
index ae8401447..99fbfd0b9 100644
--- a/target/riscv64/systems/qemu-riscv64
+++ b/target/riscv64/systems/qemu-riscv64
@@ -3,6 +3,7 @@ config ADK_TARGET_SYSTEM_QEMU_RISCV64
select ADK_TARGET_QEMU
select ADK_TARGET_CPU_RISCV64
select ADK_TARGET_KERNEL_WITH_COMPRESSION
+ select ADK_TARGET_KERNEL_IMAGE
help
Qemu Emulator for RISCV64 architecture.