From 92ffed61568e4ebac5a985a4cc342e80b78b2bd3 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 1 Aug 2015 10:32:23 +0200 Subject: add basic support for qemu-metag --- target/metag/Makefile | 66 +++++++++++++++++++++++++++++++++++++++++ target/metag/kernel/qemu-metag | 7 +++++ target/metag/systems/qemu-metag | 8 +++++ 3 files changed, 81 insertions(+) create mode 100644 target/metag/kernel/qemu-metag create mode 100644 target/metag/systems/qemu-metag (limited to 'target/metag') 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. + -- cgit v1.2.3