summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2023-08-13 17:14:29 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2023-08-13 17:14:49 +0200
commit801451b72dc989483f61b68ca84aee92843f94fb (patch)
treecdb3588b9a27f391b8e7454d154bcd00aa763de1
parent8b99befad597c1adeb1ec99a543eac0553c422af (diff)
m68k: add qemu virt support, seems more reliable at the moment then q800
-rw-r--r--mk/image.mk2
-rw-r--r--target/config/Config.in.qemuopts5
-rw-r--r--target/config/Config.in.runtime1
-rw-r--r--target/linux/Config.in1
-rw-r--r--target/linux/config/Config.in.m68k14
-rw-r--r--target/m68k/Makefile10
-rw-r--r--target/m68k/kernel/qemu-m68k-virt3
-rw-r--r--target/m68k/systems/qemu-m68k-virt9
8 files changed, 43 insertions, 2 deletions
diff --git a/mk/image.mk b/mk/image.mk
index 0706e2dca..9989994b9 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -171,7 +171,6 @@ ${STAGING_TARGET_DIR}/${INITRAMFS}_list: ${TARGET_DIR}/.adk
echo "nod /dev/random 0666 0 0 c 1 8"; \
echo "nod /dev/urandom 0666 0 0 c 1 9"; \
echo "nod /dev/ttyS0 0660 0 0 c 4 64"; \
- echo "nod /dev/ttyS1 0660 0 0 c 4 65"; \
echo "nod /dev/ttysclp0 0660 0 0 c 4 65"; \
echo "nod /dev/ttyB0 0660 0 0 c 11 0"; \
echo "nod /dev/ttyB1 0660 0 0 c 11 1"; \
@@ -184,6 +183,7 @@ ${STAGING_TARGET_DIR}/${INITRAMFS}_list: ${TARGET_DIR}/.adk
echo "nod /dev/ttyBF1 0660 0 0 c 204 65"; \
echo "nod /dev/ttyUL0 0660 0 0 c 204 187"; \
echo "nod /dev/ttyUL1 0660 0 0 c 204 188"; \
+ echo "nod /dev/ttyGF0 0660 0 0 c 254 0"; \
echo "slink /init /sbin/init 755 0 0"; \
) >>$@
diff --git a/target/config/Config.in.qemuopts b/target/config/Config.in.qemuopts
index 50e314eab..78c608b49 100644
--- a/target/config/Config.in.qemuopts
+++ b/target/config/Config.in.qemuopts
@@ -42,6 +42,7 @@ depends on ADK_TARGET_QEMU && (ADK_TARGET_SYSTEM_QEMU_X86_64 \
|| ADK_TARGET_SYSTEM_QEMU_X86 \
|| ADK_TARGET_SYSTEM_QEMU_AARCH64 \
|| ADK_TARGET_SYSTEM_QEMU_ARC \
+ || ADK_TARGET_SYSTEM_QEMU_M68K_VIRT \
|| ADK_TARGET_SYSTEM_QEMU_SPARC64)
choice
@@ -96,9 +97,10 @@ prompt "Qemu Emulation using VirtIO drivers"
depends on ADK_TARGET_SYSTEM_QEMU_SPARC64 || \
ADK_TARGET_SYSTEM_QEMU_AARCH64 || \
ADK_TARGET_SYSTEM_QEMU_ARC || \
+ ADK_TARGET_SYSTEM_QEMU_CSKY || \
+ ADK_TARGET_SYSTEM_QEMU_M68K_VIRT || \
ADK_TARGET_SYSTEM_QEMU_RISCV32 || \
ADK_TARGET_SYSTEM_QEMU_RISCV64 || \
- ADK_TARGET_SYSTEM_QEMU_CSKY || \
ADK_TARGET_SYSTEM_QEMU_X86 || \
ADK_TARGET_SYSTEM_QEMU_X86_64
default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_AARCH64
@@ -106,6 +108,7 @@ default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_ARC
default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_CSKY
default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_RISCV32
default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_RISCV64
+default ADK_TARGET_QEMU_WITH_VIRTIO if ADK_TARGET_SYSTEM_QEMU_M68K_VIRT
config ADK_TARGET_QEMU_WITHOUT_VIRTIO
bool "disabled"
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index 1564c3b3a..611ed5ce3 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -376,6 +376,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
default "ttyO0" if ADK_TARGET_SYSTEM_PHYTEC_WEGA
default "ttyS4" if ADK_TARGET_SYSTEM_IMGTEC_CI20
default "ttySTM0" if ADK_TARGET_SYSTEM_ST_STM32F746G
+ default "ttyGF0" if ADK_TARGET_SYSTEM_QEMU_M68K_VIRT
default "ttyS0"
config ADK_RUNTIME_CONSOLE_SERIAL_SPEED
diff --git a/target/linux/Config.in b/target/linux/Config.in
index e4da0762b..42e4efcbb 100644
--- a/target/linux/Config.in
+++ b/target/linux/Config.in
@@ -21,6 +21,7 @@ source target/linux/config/Config.in.crypto
source target/linux/config/Config.in.misc
source target/linux/config/Config.in.arc
source target/linux/config/Config.in.arm
+source target/linux/config/Config.in.m68k
source target/linux/config/Config.in.mips
source target/linux/config/Config.in.xtensa
source target/linux/config/Config.in.pm
diff --git a/target/linux/config/Config.in.m68k b/target/linux/config/Config.in.m68k
new file mode 100644
index 000000000..0a8fec23e
--- /dev/null
+++ b/target/linux/config/Config.in.m68k
@@ -0,0 +1,14 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+config ADK_LINUX_KERNEL_M68020
+ bool
+ default y if ADK_TARGET_CPU_M68K_68020
+
+config ADK_LINUX_KERNEL_M68040
+ bool
+ default y if ADK_TARGET_CPU_M68K_68040
+
+config ADK_LINUX_KERNEL_M68KFPU_EMU
+ bool
+ default y if ADK_TARGET_CPU_M68K_68040
diff --git a/target/m68k/Makefile b/target/m68k/Makefile
index 0ffd9b8a2..37a61853c 100644
--- a/target/m68k/Makefile
+++ b/target/m68k/Makefile
@@ -8,6 +8,12 @@ include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/vmlinux
QEMU_ARGS:=${ADK_QEMU_ARGS}
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_VIRT),y)
+QEMU_ARGS+=-M virt -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
+ifeq ($(ADK_TARGET_FS),archive)
+QEMU_ARGS+=-append "rootwait root=/dev/vda1 ro" -drive file=qemu-m68k.img,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
+endif
+endif
ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_Q800),y)
QEMU_ARGS+=-M q800
endif
@@ -24,9 +30,13 @@ ifeq ($(ADK_TARGET_QEMU),y)
@echo "Use following command to create a QEMU Image:"
@echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSUSERTARBALL)"
@echo "Start qemu with following options:"
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K_VIRT),y)
+ @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+else
@echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
endif
endif
+endif
ifeq ($(ADK_TARGET_FS),initramfs)
targethelp:
@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
diff --git a/target/m68k/kernel/qemu-m68k-virt b/target/m68k/kernel/qemu-m68k-virt
new file mode 100644
index 000000000..47e9200d4
--- /dev/null
+++ b/target/m68k/kernel/qemu-m68k-virt
@@ -0,0 +1,3 @@
+CONFIG_M68K=y
+CONFIG_VIRT=y
+CONFIG_COMPAT_32BIT_TIME=y
diff --git a/target/m68k/systems/qemu-m68k-virt b/target/m68k/systems/qemu-m68k-virt
new file mode 100644
index 000000000..d982f7ce1
--- /dev/null
+++ b/target/m68k/systems/qemu-m68k-virt
@@ -0,0 +1,9 @@
+config ADK_TARGET_SYSTEM_QEMU_M68K_VIRT
+ bool "Qemu M68K (virt)"
+ select ADK_TARGET_QEMU
+ select ADK_TARGET_WITH_MMU
+ select ADK_TARGET_KERNEL_ZIMAGE
+ select ADK_TARGET_KERNEL_WITH_COMPRESSION
+ help
+ Support for Qemu Emulator with M68K architecture (virt).
+