summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-08-01 10:32:23 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-08-02 10:41:07 +0200
commit92ffed61568e4ebac5a985a4cc342e80b78b2bd3 (patch)
tree80ac3a94f95e04683ca628d94fd91e7688a575dd /target
parent88b74bc242e84d27241bbdd3c3072c110149e9c9 (diff)
add basic support for qemu-metag
Diffstat (limited to 'target')
-rw-r--r--target/config/Config.in.kernel1
-rw-r--r--target/config/Config.in.runtime1
-rw-r--r--target/metag/Makefile66
-rw-r--r--target/metag/kernel/qemu-metag7
-rw-r--r--target/metag/systems/qemu-metag8
5 files changed, 83 insertions, 0 deletions
diff --git a/target/config/Config.in.kernel b/target/config/Config.in.kernel
index 0eadd0e16..ee139995a 100644
--- a/target/config/Config.in.kernel
+++ b/target/config/Config.in.kernel
@@ -83,3 +83,4 @@ config ADK_TARGET_KERNEL_MINICONFIG
default "qemu-m68k-mcf5208" if ADK_TARGET_QEMU_M68K_MCF5208
default "qemu-m68k-q800" if ADK_TARGET_QEMU_M68K_Q800
default "imgtec-ci20" if ADK_TARGET_SYSTEM_IMGTEC_CI20
+ default "qemu-metag" if ADK_TARGET_SYSTEM_QEMU_METAG
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index b8f8f8413..188320d09 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -234,6 +234,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
default "ttymxc0" if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+ default "ttyDA1" if ADK_TARGET_SYSTEM_QEMU_METAG
default "ttyS2" if ADK_TARGET_SYSTEM_KINETIS_K70
default "ttyS0"
diff --git a/target/metag/Makefile b/target/metag/Makefile
index ebc17340e..cf01e9304 100644
--- a/target/metag/Makefile
+++ b/target/metag/Makefile
@@ -7,3 +7,69 @@ include $(ADK_TOPDIR)/mk/modules.mk
include $(ADK_TOPDIR)/mk/kernel-build.mk
include $(ADK_TOPDIR)/mk/image.mk
+KERNEL:=$(LINUX_DIR)/vmlinux
+QEMU_ARGS:=-nographic -display none -device da,exit_threads=1 -chardev stdio,id=chan1 -chardev pty,id=chan2
+
+# target helper text
+ifeq ($(ADK_TARGET_FS),archive)
+targethelp:
+ @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+ifeq ($(ADK_TARGET_QEMU),y)
+ @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+ @echo "Use following command to create a QEMU Image:"
+ @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
+ @echo "Start qemu with following options:"
+ @echo 'qemu-system-meta ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
+endif
+endif
+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-meta ${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-meta ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+endif
+endif
+ifeq ($(ADK_TARGET_FS),nfsroot)
+targethelp:
+ @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+ @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
+endif
+
+# image creation and kernel install
+kernel-strip:
+ cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
+
+kernel-install: kernel-strip
+ cp $(BUILD_DIR)/$(TARGET_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/metag/kernel/qemu-metag b/target/metag/kernel/qemu-metag
new file mode 100644
index 000000000..6c45bc1ca
--- /dev/null
+++ b/target/metag/kernel/qemu-metag
@@ -0,0 +1,7 @@
+CONFIG_METAG=y
+CONFIG_SOC_TZ1090=y
+CONFIG_METAG_DA=y
+CONFIG_METAG_META21_MMU=y
+CONFIG_METAG_UNALIGNED=y
+CONFIG_DA_TTY=y
+CONFIG_DA_CONSOLE=y
diff --git a/target/metag/systems/qemu-metag b/target/metag/systems/qemu-metag
new file mode 100644
index 000000000..f6a45ef4a
--- /dev/null
+++ b/target/metag/systems/qemu-metag
@@ -0,0 +1,8 @@
+config ADK_TARGET_SYSTEM_QEMU_METAG
+ bool "Qemu Emulator"
+ select ADK_CPU_METAG
+ select ADK_TARGET_QEMU
+ select ADK_TARGET_PACKAGE_TXZ
+ help
+ METAG Qemu support.
+