From 65b25cd0f268e989dfa5f1efcfca1e75ca38af64 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 8 Apr 2018 11:16:17 +0100 Subject: riscv: fix kernel boot in qemu --- target/riscv64/Makefile | 22 ++++++++++++++++------ target/riscv64/kernel/qemu-riscv64 | 1 + target/riscv64/systems/qemu-riscv64 | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'target/riscv64') diff --git a/target/riscv64/Makefile b/target/riscv64/Makefile index 4796d939b..9b022f98e 100644 --- a/target/riscv64/Makefile +++ b/target/riscv64/Makefile @@ -16,12 +16,12 @@ targethelp: @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}' ifeq ($(ADK_TARGET_QEMU),y) @echo "Start qemu with following command line:" - @echo 'qemu-system-riscv64 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}' + @echo 'qemu-system-riscv64 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL).bbl -initrd ${FW_DIR}/${INITRAMFS}' endif endif ifeq ($(ADK_TARGET_FS),initramfsarchive) targethelp: - @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}' + @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}.bbl' @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)" endif ifeq ($(ADK_TARGET_FS),initramfspiggyback) @@ -29,7 +29,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-riscv64 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)' + @echo 'qemu-system-riscv64 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL).bbl' endif endif @@ -39,13 +39,23 @@ kernel-strip: 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).bbl + # filesystem specific targets ifeq ($(ADK_TARGET_FS),initramfs) -imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp +imageinstall: kernel-install bbl $(FW_DIR)/$(INITRAMFS) targethelp endif ifeq ($(ADK_TARGET_FS),initramfsarchive) -imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp +imageinstall: kernel-install bbl $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp endif ifeq ($(ADK_TARGET_FS),initramfspiggyback) -imageinstall: createinitramfs targethelp +imageinstall: createinitramfs bbl targethelp endif diff --git a/target/riscv64/kernel/qemu-riscv64 b/target/riscv64/kernel/qemu-riscv64 index 85e4c59d5..5246f62aa 100644 --- a/target/riscv64/kernel/qemu-riscv64 +++ b/target/riscv64/kernel/qemu-riscv64 @@ -1,2 +1,3 @@ CONFIG_RISCV=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 70d91645e..ae8401447 100644 --- a/target/riscv64/systems/qemu-riscv64 +++ b/target/riscv64/systems/qemu-riscv64 @@ -2,6 +2,7 @@ config ADK_TARGET_SYSTEM_QEMU_RISCV64 bool "Qemu Emulator" select ADK_TARGET_QEMU select ADK_TARGET_CPU_RISCV64 + select ADK_TARGET_KERNEL_WITH_COMPRESSION help Qemu Emulator for RISCV64 architecture. -- cgit v1.2.3