summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-10-28 22:09:03 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-10-28 22:09:20 +0100
commit09cd046e6cc65ab7bf044503b6404a2ba912bf85 (patch)
tree2a42565c988b0c36798b9021af601f86a7a9dc19
parent87eac2992b7dacd9c4d6e2cf7a5bb51f0bbdca15 (diff)
qemu-system-s390: add basic support, only virtio-net does not work as expected.
-rw-r--r--mk/image.mk3
-rw-r--r--target/config/Config.in.cpu14
-rw-r--r--target/config/Config.in.runtime1
-rw-r--r--target/linux/config/Config.in.virtio1
-rw-r--r--target/s390/Makefile61
-rw-r--r--target/s390/kernel/qemu-s39013
-rw-r--r--target/s390/systems/qemu-s3907
-rw-r--r--target/s390/systems/toolchain-s3902
8 files changed, 95 insertions, 7 deletions
diff --git a/mk/image.mk b/mk/image.mk
index 0940a2f44..a5d77c3cd 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -79,6 +79,9 @@ ifneq ($(ADK_TARGET_ARCH_AARCH64)$(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_PPC6
test ! -d ${TARGET_DIR}/usr/lib || rm -rf ${TARGET_DIR}/usr/lib/
(cd ${TARGET_DIR}/usr ; ln -sf ${ADK_TARGET_LIBC_PATH} lib)
endif
+ifeq ($(ADK_TARGET_ARCH_S390),y)
+ (cd ${TARGET_DIR}/; ln -sf lib lib64)
+endif
ifeq (${ADK_PRELINK},)
prelink:
diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu
index 3af630daf..37830bf8a 100644
--- a/target/config/Config.in.cpu
+++ b/target/config/Config.in.cpu
@@ -609,11 +609,6 @@ config ADK_CPU_PPC64
select ADK_TARGET_WITH_NPTL
select ADK_TARGET_WITH_MMU
-config ADK_CPU_S390
- bool
- select ADK_TARGET_WITH_NPTL
- select ADK_TARGET_WITH_MMU
-
config ADK_CPU_SH2
bool
select ADK_TARGET_WITHOUT_MMU
@@ -673,6 +668,12 @@ config ADK_CPU_XTENSA
select ADK_TARGET_WITH_NPTL
select ADK_TARGET_WITH_MMU
+config ADK_CPU_Z900
+ bool
+ select ADK_LINUX_64
+ select ADK_TARGET_WITH_NPTL
+ select ADK_TARGET_WITH_MMU
+
# CPU features
config ADK_TARGET_CPU_WITH_FPU
bool
@@ -797,6 +798,7 @@ config ADK_TARGET_GCC_ARCH
default "nocona" if ADK_CPU_NOCONA
default "pentium-m" if ADK_CPU_PENTIUM_M
default "x86-64" if ADK_CPU_X86_64
+ default "z900" if ADK_CPU_Z900
config ADK_TARGET_CPU_FLAGS
string
@@ -956,7 +958,7 @@ config ADK_TARGET_CPU_ARCH
default "ppc" if ADK_CPU_PPC_440
default "ppc64le" if ADK_CPU_PPC64 && ADK_TARGET_LITTLE_ENDIAN
default "ppc64" if ADK_CPU_PPC64 && ADK_TARGET_BIG_ENDIAN
- default "s390" if ADK_CPU_S390
+ default "s390x" if ADK_TARGET_ARCH_S390
default "sh2" if ADK_CPU_SH2
default "sh2a" if ADK_CPU_SH2A
default "sh3" if ADK_CPU_SH3
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index 51454767f..fc36a8f7a 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -246,6 +246,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
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 "ttysclp0" if ADK_TARGET_SYSTEM_QEMU_S390
default "ttyO0" if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
default "ttyS0"
diff --git a/target/linux/config/Config.in.virtio b/target/linux/config/Config.in.virtio
index 7b3be63df..634770a51 100644
--- a/target/linux/config/Config.in.virtio
+++ b/target/linux/config/Config.in.virtio
@@ -24,6 +24,7 @@ config ADK_KERNEL_VIRTIO_NET
select ADK_KERNEL_VIRTIO_MMIO
select ADK_KERNEL_VIRTIO_PCI
select ADK_KERNEL_VIRTIO_PCI_LEGACY
+ default y if ADK_TARGET_SYSTEM_QEMU_S390
default n
help
Enables support for Virtio Net driver.
diff --git a/target/s390/Makefile b/target/s390/Makefile
index 03afae8f0..93373aaa8 100644
--- a/target/s390/Makefile
+++ b/target/s390/Makefile
@@ -5,3 +5,64 @@ include $(ADK_TOPDIR)/rules.mk
include $(ADK_TOPDIR)/mk/kernel-build.mk
include $(ADK_TOPDIR)/mk/image.mk
+KERNEL:=$(LINUX_DIR)/vmlinux
+
+QEMU_ARGS:=-monitor null -M s390-ccw-virtio-2.4
+QEMU_ARGS+=${ADK_QEMU_ARGS}
+QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-ccw,netdev=eth0
+
+# 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-${ADK_TARGET_CPU_ARCH} ${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-${ADK_TARGET_CPU_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_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+endif
+endif
+
+# image creation and kernel install
+kernel-strip:
+ $(TARGET_CROSS)objcopy $(OSTRIP) -S $(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
diff --git a/target/s390/kernel/qemu-s390 b/target/s390/kernel/qemu-s390
new file mode 100644
index 000000000..00a86e58b
--- /dev/null
+++ b/target/s390/kernel/qemu-s390
@@ -0,0 +1,13 @@
+CONFIG_S390=y
+CONFIG_MARCH_Z900=y
+CONFIG_TN3270=y
+CONFIG_TN3270_TTY=y
+CONFIG_TN3270_FS=m
+CONFIG_TN3270_CONSOLE=y
+CONFIG_TN3215=y
+CONFIG_TN3215_CONSOLE=y
+CONFIG_CCW_CONSOLE=y
+CONFIG_SCLP_TTY=y
+CONFIG_SCLP_CONSOLE=y
+CONFIG_SCLP_VT220_TTY=y
+CONFIG_SCLP_VT220_CONSOLE=y
diff --git a/target/s390/systems/qemu-s390 b/target/s390/systems/qemu-s390
new file mode 100644
index 000000000..c04dfad31
--- /dev/null
+++ b/target/s390/systems/qemu-s390
@@ -0,0 +1,7 @@
+config ADK_TARGET_SYSTEM_QEMU_S390
+ bool "Qemu Emulator"
+ select ADK_CPU_Z900
+ select ADK_TARGET_QEMU
+ help
+ Support for Qemu Emulator S/390 architecture.
+
diff --git a/target/s390/systems/toolchain-s390 b/target/s390/systems/toolchain-s390
index e1b520a83..d441dfd94 100644
--- a/target/s390/systems/toolchain-s390
+++ b/target/s390/systems/toolchain-s390
@@ -1,6 +1,6 @@
config ADK_TARGET_SYSTEM_TOOLCHAIN_S390
bool "Toolchain only"
- select ADK_CPU_S390
+ select ADK_CPU_Z900
select ADK_TARGET_TOOLCHAIN
select ADK_TARGET_PACKAGE_TXZ
help