瀏覽代碼

add basic infrastructure for qemu-cris support

Waldemar Brodkorb 9 年之前
父節點
當前提交
500b13fb56

+ 2 - 0
target/config/Config.in.cpu

@@ -197,10 +197,12 @@ config ADK_CPU_CORTEX_A57
 config ADK_CPU_CRIS_V10
 	bool
 	select ADK_TARGET_WITH_LT
+	select ADK_TARGET_WITH_MMU
 
 config ADK_CPU_CRIS_V32
 	bool
 	select ADK_TARGET_WITH_LT
+	select ADK_TARGET_WITH_MMU
 
 config ADK_CPU_GEODE
 	bool

+ 1 - 0
target/config/Config.in.kernel

@@ -36,6 +36,7 @@ config ADK_TARGET_KERNEL
 config ADK_TARGET_KERNEL_MINICONFIG
 	string
 	default "arm-fm" if ADK_TARGET_SYSTEM_ARM_FM
+	default "qemu-cris" if ADK_TARGET_SYSTEM_QEMU_CRIS
 	default "qemu-microblaze-s3adsp1800" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
 	default "qemu-microblaze-ml605" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
 	default "qemu-aarch64" if ADK_TARGET_SYSTEM_QEMU_AARCH64

+ 47 - 0
target/cris/Makefile

@@ -7,3 +7,50 @@ include $(ADK_TOPDIR)/mk/modules.mk
 include $(ADK_TOPDIR)/mk/kernel-build.mk
 include $(ADK_TOPDIR)/mk/image.mk
 
+KERNEL:=$(LINUX_DIR)/vmlinux
+ZKERNEL:=$(LINUX_DIR)/arch/cris/boot/Image
+QEMU_ARGS:=-M axis-dev88 -nographic
+
+ifeq ($(ADK_TARGET_FS),initramfs)
+targethelp:
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
+ifeq ($(ADK_TARGET_QEMU),y)
+	@echo "Start qemu with following command line:"
+	@echo 'qemu-system-${ADK_TARGET_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
+endif
+endif
+
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+targethelp:
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfspiggyback)
+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-${ADK_TARGET_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+endif
+endif
+
+kernel-install:
+	@cp $(KERNEL) $(FW_DIR)/${TARGET_KERNEL}
+
+# filesystem specific targets
+ifeq ($(ADK_TARGET_FS),archive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
+endif
+ifeq ($(ADK_TARGET_FS),initramfs)
+imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
+endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
+endif
+ifeq ($(ADK_TARGET_FS),initramfspiggyback)
+imageinstall: createinitramfs targethelp
+endif
+ifeq ($(ADK_TARGET_FS),nfsroot)
+imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
+endif

+ 6 - 0
target/cris/kernel/qemu-cris

@@ -0,0 +1,6 @@
+CONFIG_CRIS=y
+CONFIG_ETRAXFS=y
+CONFIG_ETRAX_ARCH_V32=y
+CONFIG_ETRAXFS_SERIAL=y
+CONFIG_ETRAX_SERIAL_PORTS=4
+CONFIG_ETRAX_SERIAL_PORT0=y

+ 8 - 0
target/cris/systems/qemu-cris

@@ -0,0 +1,8 @@
+config ADK_TARGET_SYSTEM_QEMU_CRIS
+	bool "Qemu Emulator"
+	select ADK_CPU_CRIS_V32
+	select ADK_TARGET_QEMU
+	select ADK_TARGET_KERNEL_IMAGE
+	help
+	  Qemu Emulator for CRISv32 architecture.
+

+ 0 - 1
target/cris/systems/toolchain-cris

@@ -1,6 +1,5 @@
 config ADK_TARGET_SYSTEM_TOOLCHAIN_CRIS
 	bool "Toolchain only"
-	select ADK_CPU_CRIS_V32
 	select ADK_TARGET_TOOLCHAIN
 	select ADK_TARGET_PACKAGE_TXZ
 	help

+ 22 - 0
target/linux/patches/3.18.12/cris-initramfs.patch

@@ -0,0 +1,22 @@
+diff -Nur linux-3.18.12.orig/arch/cris/arch-v10/mm/init.c linux-3.18.12/arch/cris/arch-v10/mm/init.c
+--- linux-3.18.12.orig/arch/cris/arch-v10/mm/init.c	2015-04-20 21:48:02.000000000 +0200
++++ linux-3.18.12/arch/cris/arch-v10/mm/init.c	2015-05-16 01:46:37.000000000 +0200
+@@ -261,3 +261,7 @@
+ {
+ 	flush_etrax_cacherange(0, 8192);
+ }
++
++void free_initrd_mem(unsigned long start, unsigned long end)
++{
++}
+diff -Nur linux-3.18.12.orig/arch/cris/arch-v32/mm/init.c linux-3.18.12/arch/cris/arch-v32/mm/init.c
+--- linux-3.18.12.orig/arch/cris/arch-v32/mm/init.c	2015-04-20 21:48:02.000000000 +0200
++++ linux-3.18.12/arch/cris/arch-v32/mm/init.c	2015-05-16 01:46:54.000000000 +0200
+@@ -171,3 +171,7 @@
+ 
+ 	mem_map = contig_page_data.node_mem_map;
+ }
++
++void free_initrd_mem(unsigned long start, unsigned long end)
++{
++}