summaryrefslogtreecommitdiff
path: root/target/riscv64/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'target/riscv64/Makefile')
-rw-r--r--target/riscv64/Makefile51
1 files changed, 37 insertions, 14 deletions
diff --git a/target/riscv64/Makefile b/target/riscv64/Makefile
index c2b50a688..55134d24e 100644
--- a/target/riscv64/Makefile
+++ b/target/riscv64/Makefile
@@ -6,7 +6,11 @@ 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_WITH_MMU),)
+QEMU_ARGS+=-bios none -cpu rv64,mmu=off
+endif
+
ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
endif
@@ -47,32 +51,51 @@ ifeq ($(ADK_TARGET_QEMU),y)
@echo "Start qemu with following command line:"
@echo 'qemu-system-riscv64 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
endif
+ifeq ($(ADK_TARGET_SYSTEM_SIPEED_MAIX_BIT),y)
+ @echo 'sudo python3 scripts/kflash.py -p /dev/ttyUSB0 -b 1500000 -t $(FW_DIR)/$(TARGET_KERNEL)'
+endif
+endif
+ifeq ($(ADK_TARGET_FS),genimage)
+targethelp:
+ @echo "The disk image is: $(FW_DIR)/sdcard.img"
+ @echo "Use following command to install it on SD card:"
+ @echo 'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k'
+endif
+ifeq ($(ADK_TARGET_FS),nfsroot)
+targethelp:
+ @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+ @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
endif
kernel-strip:
+ @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
kernel-install: kernel-strip
+ @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(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=generic make)
- cp $(BUILD_DIR)/opensbi/build/platform/generic/firmware/fw_jump.elf \
- $(FW_DIR)
+dtb-install:
+ ${KERNEL_MAKE} dtbs
+ for x in $(LINUX_DIR)/arch/riscv/boot/dts/*/*.dtb; do \
+ [[ -e "$$x" ]] && cp $(LINUX_DIR)/arch/riscv/boot/dts/*/*.dtb $(FW_DIR); \
+ break; \
+ done
# 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
+ifeq ($(ADK_TARGET_FS),genimage)
+imageinstall: dtb-install $(FW_DIR)/$(GENIMAGE) targethelp
+endif
+ifeq ($(ADK_TARGET_FS),nfsroot)
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
endif