summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/config/Config.in.kernel1
-rw-r--r--target/linux/config/Config.in.serial7
-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
6 files changed, 35 insertions, 2 deletions
diff --git a/target/config/Config.in.kernel b/target/config/Config.in.kernel
index ee139995a..a6e90109c 100644
--- a/target/config/Config.in.kernel
+++ b/target/config/Config.in.kernel
@@ -84,3 +84,4 @@ config ADK_TARGET_KERNEL_MINICONFIG
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
+ default "qemu-or1k" if ADK_TARGET_SYSTEM_QEMU_OR1K
diff --git a/target/linux/config/Config.in.serial b/target/linux/config/Config.in.serial
index 823119155..e742f36ed 100644
--- a/target/linux/config/Config.in.serial
+++ b/target/linux/config/Config.in.serial
@@ -48,13 +48,16 @@ config ADK_KERNEL_SERIAL_ETRAXFS
config ADK_KERNEL_SERIAL_8250
bool "8250 serial driver"
- select ADK_KERNEL_SERIAL_OF_PLATFORM if ADK_TARGET_SYSTEM_XILINX_KINTEX7
+ select ADK_KERNEL_SERIAL_OF_PLATFORM if ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
+ || ADK_TARGET_SYSTEM_QEMU_OR1K
select ADK_KERNEL_SERIAL_8250_PNP if ADK_TARGET_SYSTEM_PCENGINES_APU
select ADK_KERNEL_SERIAL_8250_CONSOLE
depends on ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
- || ADK_TARGET_SYSTEM_PCENGINES_APU
+ || ADK_TARGET_SYSTEM_PCENGINES_APU \
+ || ADK_TARGET_SYSTEM_QEMU_OR1K
default y if ADK_TARGET_SYSTEM_XILINX_KINTEX7
default y if ADK_TARGET_SYSTEM_PCENGINES_APU
+ default y if ADK_TARGET_SYSTEM_QEMU_OR1K
default n
help
Serial driver for 8250 UART chip.
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.
+