summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-05-16 16:36:07 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-05-16 18:40:45 +0200
commit500b13fb564e7e44ee2d8bbffe6d03adb68bb401 (patch)
tree5770d8dbe031f0c54e3ef3b57029a1935f7903e3 /target
parent524958a0e7311f7b236c650738f74bf0f30c9388 (diff)
add basic infrastructure for qemu-cris support
Diffstat (limited to 'target')
-rw-r--r--target/config/Config.in.cpu2
-rw-r--r--target/config/Config.in.kernel1
-rw-r--r--target/cris/Makefile47
-rw-r--r--target/cris/kernel/qemu-cris6
-rw-r--r--target/cris/systems/qemu-cris8
-rw-r--r--target/cris/systems/toolchain-cris1
-rw-r--r--target/linux/patches/3.18.12/cris-initramfs.patch22
7 files changed, 86 insertions, 1 deletions
diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu
index 35e7f1e2f..b15204074 100644
--- a/target/config/Config.in.cpu
+++ b/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
diff --git a/target/config/Config.in.kernel b/target/config/Config.in.kernel
index 0495a75ef..b51f094d6 100644
--- a/target/config/Config.in.kernel
+++ b/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
diff --git a/target/cris/Makefile b/target/cris/Makefile
index ebc17340e..190460230 100644
--- a/target/cris/Makefile
+++ b/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
diff --git a/target/cris/kernel/qemu-cris b/target/cris/kernel/qemu-cris
new file mode 100644
index 000000000..234563c4b
--- /dev/null
+++ b/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
diff --git a/target/cris/systems/qemu-cris b/target/cris/systems/qemu-cris
new file mode 100644
index 000000000..d1df7e654
--- /dev/null
+++ b/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.
+
diff --git a/target/cris/systems/toolchain-cris b/target/cris/systems/toolchain-cris
index ab5be72f6..6615da6ad 100644
--- a/target/cris/systems/toolchain-cris
+++ b/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
diff --git a/target/linux/patches/3.18.12/cris-initramfs.patch b/target/linux/patches/3.18.12/cris-initramfs.patch
new file mode 100644
index 000000000..b709e705e
--- /dev/null
+++ b/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)
++{
++}