summaryrefslogtreecommitdiff
path: root/target/or1k
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-09-01 22:47:48 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-09-01 22:48:16 +0200
commitc5c6f661665450bb2a1f9e217fd5022cf7cbdfcd (patch)
treef1a8ce7031c92e157103518b83c96f64e2a87c22 /target/or1k
parent77dcf4f883cd9ee840e7d431ed982fa982a60405 (diff)
or1k: add basic qemu support
Kernel boots, userland not.
Diffstat (limited to 'target/or1k')
-rw-r--r--target/or1k/Makefile9
-rw-r--r--target/or1k/kernel/qemu-or1k2
-rw-r--r--target/or1k/patches/4.1.6/ld-or1k.patch12
-rw-r--r--target/or1k/systems/qemu-or1k6
4 files changed, 29 insertions, 0 deletions
diff --git a/target/or1k/Makefile b/target/or1k/Makefile
index 8b3caa379..dc40475f7 100644
--- a/target/or1k/Makefile
+++ b/target/or1k/Makefile
@@ -7,12 +7,17 @@ include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/vmlinux
OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
+QEMU_ARGS:=-nographic
# target helper text
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-or32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
+endif
endif
ifeq ($(ADK_TARGET_FS),initramfsarchive)
targethelp:
@@ -22,6 +27,10 @@ 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-or32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+endif
endif
kernel-strip:
diff --git a/target/or1k/kernel/qemu-or1k b/target/or1k/kernel/qemu-or1k
new file mode 100644
index 000000000..ece36cc61
--- /dev/null
+++ b/target/or1k/kernel/qemu-or1k
@@ -0,0 +1,2 @@
+CONFIG_OPENRISC=Y
+CONFIG_OPENRISC_BUILTIN_DTB="or1ksim"
diff --git a/target/or1k/patches/4.1.6/ld-or1k.patch b/target/or1k/patches/4.1.6/ld-or1k.patch
new file mode 100644
index 000000000..81c9db6c2
--- /dev/null
+++ b/target/or1k/patches/4.1.6/ld-or1k.patch
@@ -0,0 +1,12 @@
+diff -Nur linux-4.1.6.orig/arch/openrisc/kernel/vmlinux.lds.S linux-4.1.6/arch/openrisc/kernel/vmlinux.lds.S
+--- linux-4.1.6.orig/arch/openrisc/kernel/vmlinux.lds.S 2015-08-17 05:52:51.000000000 +0200
++++ linux-4.1.6/arch/openrisc/kernel/vmlinux.lds.S 2015-09-01 22:02:13.224692884 +0200
+@@ -30,7 +30,7 @@
+ #include <asm/cache.h>
+ #include <asm-generic/vmlinux.lds.h>
+
+-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
++OUTPUT_FORMAT("elf32-or1k", "elf32-or1k", "elf32-or1k")
+ jiffies = jiffies_64 + 4;
+
+ SECTIONS
diff --git a/target/or1k/systems/qemu-or1k b/target/or1k/systems/qemu-or1k
new file mode 100644
index 000000000..6bddce795
--- /dev/null
+++ b/target/or1k/systems/qemu-or1k
@@ -0,0 +1,6 @@
+config ADK_TARGET_SYSTEM_QEMU_OR1K
+ bool "Qemu Emulator"
+ select ADK_TARGET_QEMU
+ help
+ Qemu Emulator for OR1K architecture.
+