summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-07-13 15:56:03 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-07-13 15:57:21 -0500
commit18c77efc35de9ffd65b99a1ab792fdb88a23a304 (patch)
tree74f70fc0ab17311d7088e3df4fa1cb354502ab15 /target
parent3574407229f50681b91f071ffdee62fdb0c589e6 (diff)
add basic toolchain support for or1k arch with musl libc
Diffstat (limited to 'target')
-rw-r--r--target/arch.lst1
-rw-r--r--target/config/Config.in.cpu6
-rw-r--r--target/config/Config.in.gcc.choice16
-rw-r--r--target/config/Config.in.libc.choice3
-rw-r--r--target/or1k/Makefile44
-rw-r--r--target/or1k/systems/toolchain-or1k8
6 files changed, 75 insertions, 3 deletions
diff --git a/target/arch.lst b/target/arch.lst
index afa0949f3..8bb80ead0 100644
--- a/target/arch.lst
+++ b/target/arch.lst
@@ -14,6 +14,7 @@ microblaze
mips
mips64
nios2
+or1k
ppc
ppc64
sparc
diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu
index 5f4833b27..f70125084 100644
--- a/target/config/Config.in.cpu
+++ b/target/config/Config.in.cpu
@@ -548,6 +548,11 @@ config ADK_CPU_NIOS2
select ADK_TARGET_WITH_NPTL
select ADK_TARGET_WITH_MMU
+config ADK_CPU_OR1K
+ bool
+ select ADK_TARGET_WITH_NPTL
+ select ADK_TARGET_WITH_MMU
+
config ADK_CPU_PARISC
bool
select ADK_TARGET_WITH_NPTL
@@ -904,6 +909,7 @@ config ADK_TARGET_CPU_ARCH
default "mips" if ADK_TARGET_ARCH_MIPS && ADK_TARGET_BIG_ENDIAN
default "mipsel" if ADK_TARGET_ARCH_MIPS && ADK_TARGET_LITTLE_ENDIAN
default "nios2" if ADK_TARGET_ARCH_NIOS2
+ default "or1k" if ADK_TARGET_ARCH_OR1K
default "ppc" if ADK_CPU_PPC
default "ppc" if ADK_CPU_PPC_440
default "ppc64" if ADK_CPU_PPC64
diff --git a/target/config/Config.in.gcc.choice b/target/config/Config.in.gcc.choice
index f7ec23d53..d310eac7b 100644
--- a/target/config/Config.in.gcc.choice
+++ b/target/config/Config.in.gcc.choice
@@ -5,9 +5,10 @@ choice
prompt "GCC version"
default ADK_TOOLCHAIN_GCC_4_7_4 if ADK_TARGET_ARCH_C6X
default ADK_TOOLCHAIN_GCC_4_5_4 if ADK_TARGET_ARCH_BFIN
-default ADK_TOOLCHAIN_GCC_4_8_0_ARC if ADK_TARGET_ARCH_ARC
+default ADK_TOOLCHAIN_GCC_4_8_ARC if ADK_TARGET_ARCH_ARC
default ADK_TOOLCHAIN_GCC_4_4_7 if ADK_TARGET_ARCH_AVR32
default ADK_TOOLCHAIN_GCC_4_2_4 if ADK_TARGET_ARCH_METAG
+default ADK_TOOLCHAIN_GCC_4_9_OR1K if ADK_TARGET_ARCH_OR1K
default ADK_TOOLCHAIN_GCC_4_9_3
config ADK_TOOLCHAIN_GCC_GIT
@@ -15,6 +16,7 @@ config ADK_TOOLCHAIN_GCC_GIT
depends on !ADK_TARGET_ARCH_ARC
depends on !ADK_TARGET_ARCH_AVR32
depends on !ADK_TARGET_ARCH_METAG
+ depends on !ADK_TARGET_ARCH_OR1K
select ADK_DISABLE_HONOUR_CFLAGS
config ADK_TOOLCHAIN_GCC_5_1_0
@@ -25,6 +27,7 @@ config ADK_TOOLCHAIN_GCC_5_1_0
depends on !ADK_TARGET_ARCH_C6X
depends on !ADK_TARGET_ARCH_H8300
depends on !ADK_TARGET_ARCH_METAG
+ depends on !ADK_TARGET_ARCH_OR1K
config ADK_TOOLCHAIN_GCC_4_9_3
bool "4.9.3"
@@ -34,6 +37,7 @@ config ADK_TOOLCHAIN_GCC_4_9_3
depends on !ADK_TARGET_ARCH_C6X
depends on !ADK_TARGET_ARCH_H8300
depends on !ADK_TARGET_ARCH_METAG
+ depends on !ADK_TARGET_ARCH_OR1K
config ADK_TOOLCHAIN_GCC_4_8_5
bool "4.8.5"
@@ -46,9 +50,15 @@ config ADK_TOOLCHAIN_GCC_4_8_5
depends on !ADK_TARGET_ARCH_C6X
depends on !ADK_TARGET_ARCH_H8300
depends on !ADK_TARGET_ARCH_METAG
+ depends on !ADK_TARGET_ARCH_OR1K
-config ADK_TOOLCHAIN_GCC_4_8_3_ARC
- bool "4.8.3-arc"
+config ADK_TOOLCHAIN_GCC_4_9_OR1K
+ bool "4.9-or1k"
+ depends on ADK_TARGET_ARCH_OR1K
+ select ADK_DISABLE_HONOUR_CFLAGS
+
+config ADK_TOOLCHAIN_GCC_4_8_ARC
+ bool "4.8-arc"
depends on ADK_TARGET_ARCH_ARC
config ADK_TOOLCHAIN_GCC_4_7_4
diff --git a/target/config/Config.in.libc.choice b/target/config/Config.in.libc.choice
index 1af1b99d0..f8ce1b0e2 100644
--- a/target/config/Config.in.libc.choice
+++ b/target/config/Config.in.libc.choice
@@ -11,6 +11,7 @@ config ADK_TARGET_LIB_UCLIBC_NG
!ADK_TARGET_ARCH_ALPHA && \
!ADK_TARGET_ARCH_HPPA && \
!ADK_TARGET_ARCH_NIOS2 && \
+ !ADK_TARGET_ARCH_OR1K && \
!ADK_TARGET_ARCH_SPARC64 && \
!ADK_TARGET_ARCH_PPC64 && \
!ADK_TARGET_ARCH_TILE
@@ -25,6 +26,7 @@ config ADK_TARGET_LIB_MUSL
ADK_TARGET_ARCH_ARM || \
ADK_TARGET_ARCH_MICROBLAZE || \
ADK_TARGET_ARCH_MIPS || \
+ ADK_TARGET_ARCH_OR1K || \
ADK_TARGET_ARCH_PPC || \
ADK_TARGET_ARCH_SH || \
ADK_TARGET_ARCH_X86 || \
@@ -39,6 +41,7 @@ config ADK_TARGET_LIB_GLIBC
depends on !ADK_TARGET_ARCH_BFIN
depends on !ADK_TARGET_ARCH_CRIS
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_ARCH_OR1K
depends on !ADK_TARGET_ARCH_XTENSA
depends on !ADK_TARGET_UCLINUX
depends on !ADK_TARGET_WITHOUT_MMU
diff --git a/target/or1k/Makefile b/target/or1k/Makefile
new file mode 100644
index 000000000..ce4992aae
--- /dev/null
+++ b/target/or1k/Makefile
@@ -0,0 +1,44 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+include $(ADK_TOPDIR)/mk/kernel.mk
+include $(ADK_TOPDIR)/mk/modules.mk
+include $(ADK_TOPDIR)/mk/kernel-build.mk
+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
+
+# 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}'
+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}'
+endif
+
+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),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/or1k/systems/toolchain-or1k b/target/or1k/systems/toolchain-or1k
new file mode 100644
index 000000000..ed7efccd1
--- /dev/null
+++ b/target/or1k/systems/toolchain-or1k
@@ -0,0 +1,8 @@
+config ADK_TARGET_SYSTEM_TOOLCHAIN_OR1K
+ bool "Toolchain only"
+ select ADK_CPU_OR1K
+ select ADK_TARGET_TOOLCHAIN
+ select ADK_TARGET_PACKAGE_TXZ
+ help
+ OpenRISC toolchain.
+