summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-04-15 16:50:50 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-04-15 16:50:50 +0200
commit786605b21d3996df956bf785b020996cc7df3763 (patch)
treed40b956ce805150c73bc22bc33fbaa097e323f3d
parent67f34421f0ae00adc39cbf016e4b33d2817b854d (diff)
add basic support for aarch64 with ARMv8 foundation model, toolchain and kernel works, userland broken.
-rw-r--r--Config.in1
-rw-r--r--mk/kernel-build.mk4
-rw-r--r--package/boot-wrapper-aarch64/Makefile27
-rw-r--r--package/boot-wrapper-aarch64/patches/patch-Makefile_am13
-rw-r--r--package/boot-wrapper-aarch64/patches/patch-configure_ac23
-rw-r--r--target/aarch64/Config.in9
-rw-r--r--target/aarch64/Makefile38
-rw-r--r--target/aarch64/kernel/arm-fm7
-rw-r--r--target/aarch64/sys-available/arm-fm13
-rw-r--r--target/aarch64/sys-available/toolchain-aarch6414
-rw-r--r--target/aarch64/target.mk4
-rw-r--r--target/arch.lst1
-rw-r--r--target/config/Config.in11
-rw-r--r--target/config/Config.in.arch.choice6
-rw-r--r--target/config/Config.in.arch.default4
-rw-r--r--target/config/Config.in.runtime2
-rw-r--r--target/config/Config.in.system.choice1
-rw-r--r--target/tarch.lst1
18 files changed, 178 insertions, 1 deletions
diff --git a/Config.in b/Config.in
index 09c66e435..572c414ea 100644
--- a/Config.in
+++ b/Config.in
@@ -17,6 +17,7 @@ mainmenu "OpenADK Configuration"
config ADK_CHOOSE_TARGET_SYSTEM
boolean
+ default y if ADK_CHOOSE_TARGET_SYSTEM_AARCH64
default y if ADK_CHOOSE_TARGET_SYSTEM_ARM
default y if ADK_CHOOSE_TARGET_SYSTEM_M68K
default y if ADK_CHOOSE_TARGET_SYSTEM_MICROBLAZE
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 448c133c3..79c199cf5 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -19,6 +19,10 @@ ifeq ($(ADK_TARGET_KERNEL_BZIMAGE),y)
KERNEL_FILE:=vmlinux
KERNEL_TARGET:=all
endif
+ifeq ($(ADK_TARGET_KERNEL_IMAGE),y)
+KERNEL_FILE:=vmlinux
+KERNEL_TARGET:=$(ADK_TARGET_KERNEL)
+endif
$(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched:
$(TRACE) target/kernel-patch
diff --git a/package/boot-wrapper-aarch64/Makefile b/package/boot-wrapper-aarch64/Makefile
new file mode 100644
index 000000000..1c7a800ee
--- /dev/null
+++ b/package/boot-wrapper-aarch64/Makefile
@@ -0,0 +1,27 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= boot-wrapper-aarch64
+PKG_VERSION:= 0.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2ffdbf8c05854e3b855314d9ac21bbc4
+PKG_DESCR:= boot-wrapper for aarch64
+PKG_SECTION:= boot
+PKG_BUILDDEP:= autotool
+PKG_SITES:= http://www.openadk.org/distfiles/
+
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BOOT_WRAPPER_AARCH64,boot-wrapper-aarch64,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+AUTOTOOL_STYLE:= autoreconf
+CONFIGURE_ARGS+= --with-kernel-dir=${LINUX_DIR}
+
+boot-wrapper-aarch64-install:
+ ${CP} ${WRKBUILD}/linux-system.axf ${LINUX_DIR}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/boot-wrapper-aarch64/patches/patch-Makefile_am b/package/boot-wrapper-aarch64/patches/patch-Makefile_am
new file mode 100644
index 000000000..40eb83f2a
--- /dev/null
+++ b/package/boot-wrapper-aarch64/patches/patch-Makefile_am
@@ -0,0 +1,13 @@
+--- boot-wrapper-aarch64-0.1.orig/Makefile.am 2014-04-13 21:10:47.000000000 +0200
++++ boot-wrapper-aarch64-0.1/Makefile.am 2014-04-13 21:58:16.848991221 +0200
+@@ -83,8 +83,8 @@ $(IMAGE): boot.o cache.o gic.o mmu.o ns.
+ model.lds: $(LD_SCRIPT) Makefile
+ $(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DBOOTMETHOD=$(BOOTMETHOD) -P -C -o $@ $<
+
+-fdt.dtb: $(KERNEL_DTB) Makefile gen-cpu-nodes.sh
+- ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
++fdt.dtb: $(KERNEL_DTS) Makefile gen-cpu-nodes.sh
++ ( cat $(KERNEL_DTS) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
+
+ # The filesystem archive might not exist if INITRD is not being used
+ .PHONY: all clean $(FILESYSTEM)
diff --git a/package/boot-wrapper-aarch64/patches/patch-configure_ac b/package/boot-wrapper-aarch64/patches/patch-configure_ac
new file mode 100644
index 000000000..1a016cf2e
--- /dev/null
+++ b/package/boot-wrapper-aarch64/patches/patch-configure_ac
@@ -0,0 +1,23 @@
+--- boot-wrapper-aarch64-0.1.orig/configure.ac 2014-04-13 21:10:47.000000000 +0200
++++ boot-wrapper-aarch64-0.1/configure.ac 2014-04-13 21:58:39.944973128 +0200
+@@ -22,18 +22,10 @@ AC_ARG_WITH([kernel-dir],
+ AC_SUBST([KERN_DIR], [$withval]),
+ AC_MSG_ERROR([No kernel directory specified. Use --with-kernel-dir]))
+ KERN_IMAGE=/arch/arm64/boot/Image
+-KERN_DTB=/arch/arm64/boot/dts/rtsm_ve-aemv8a.dtb
+-
+-# Ensure that the user has provided us with a sane kernel dir.
+-m4_define([CHECKFILES], [KERN_DIR,
+- KERN_DIR$KERN_DTB,
+- KERN_DIR$KERN_IMAGE])
+-
+-m4_foreach([checkfile], [CHECKFILES],
+- [AC_CHECK_FILE([$checkfile], [], AC_MSG_ERROR([No such file or directory: $checkfile]))])
++KERN_DTS=/arch/arm64/boot/dts/foundation-v8.dts
+
+ AC_SUBST([KERNEL_IMAGE], [$KERN_DIR$KERN_IMAGE])
+-AC_SUBST([KERNEL_DTB], [$KERN_DIR$KERN_DTB])
++AC_SUBST([KERNEL_DTS], [$KERN_DIR$KERN_DTS])
+
+ # Allow a user to pass --enable-psci
+ USE_PSCI=no
diff --git a/target/aarch64/Config.in b/target/aarch64/Config.in
new file mode 100644
index 000000000..9e48de6b4
--- /dev/null
+++ b/target/aarch64/Config.in
@@ -0,0 +1,9 @@
+choice
+depends on ADK_LINUX_AARCH64 && !ADK_CHOOSE_TARGET_ARCH
+prompt "Target system"
+
+config ADK_CHOOSE_TARGET_SYSTEM_AARCH64
+ boolean "Choose target system"
+
+source "target/aarch64/Config.in.systems"
+endchoice
diff --git a/target/aarch64/Makefile b/target/aarch64/Makefile
new file mode 100644
index 000000000..d276472fa
--- /dev/null
+++ b/target/aarch64/Makefile
@@ -0,0 +1,38 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+KERNEL:=${LINUX_DIR}/arch/arm64/boot/Image
+
+kernel-install:
+ cd $(TOPDIR) && \
+ make -f Makefile \
+ -C package/boot-wrapper-aarch64 clean
+ cd $(TOPDIR) && \
+ make -f Makefile \
+ -C package/boot-wrapper-aarch64 package
+ ${CP} ${LINUX_DIR}/linux-system.axf \
+ $(FW_DIR)/$(TARGET_KERNEL)
+
+ifeq ($(ADK_TARGET_FS),archive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+ @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSUSERTARBALL)
+ @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+ @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
+imageinstall: createinitramfs kernel-install
+ @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
+ifeq ($(ADK_TARGET_SYSTEM_ARM_FM),y)
+ @echo 'Start emulator via:'
+ @echo 'Foundation_v8 --image=$(FW_DIR)/${TARGET_KERNEL}'
+endif
+endif
diff --git a/target/aarch64/kernel/arm-fm b/target/aarch64/kernel/arm-fm
new file mode 100644
index 000000000..db8edb12d
--- /dev/null
+++ b/target/aarch64/kernel/arm-fm
@@ -0,0 +1,7 @@
+CONFIG_ARM64=y
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_AEABI=y
+CONFIG_NET_VENDOR_SMSC=y
+CONFIG_SMC91X=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
diff --git a/target/aarch64/sys-available/arm-fm b/target/aarch64/sys-available/arm-fm
new file mode 100644
index 000000000..4eef2aeaf
--- /dev/null
+++ b/target/aarch64/sys-available/arm-fm
@@ -0,0 +1,13 @@
+config ADK_TARGET_SYSTEM_ARM_FM
+ bool "ARMv8 Foundation Model"
+ select ADK_aarch64
+ select ADK_arm_fm
+ select ADK_little
+ select ADK_soft_float
+ select ADK_eabi
+ select ADK_CPU_ARMV8
+ select ADK_LINUX_64
+ select ADK_TARGET_KERNEL_IMAGE
+ select ADK_PACKAGE_BOOT_WRAPPER_AARCH64
+ help
+ Support for ARMv8 Foundation Model (aarch64).
diff --git a/target/aarch64/sys-available/toolchain-aarch64 b/target/aarch64/sys-available/toolchain-aarch64
new file mode 100644
index 000000000..638c3cdcf
--- /dev/null
+++ b/target/aarch64/sys-available/toolchain-aarch64
@@ -0,0 +1,14 @@
+config ADK_TARGET_SYSTEM_TOOLCHAIN_AARCH64
+ bool "Toolchain only (little endian)"
+ select ADK_aarch64
+ select ADK_toolchain_aarch64
+ select ADK_little
+ select ADK_soft_float
+ select ADK_fpu_vfp
+ select ADK_eabi
+ select ADK_TOOLCHAIN
+ select ADK_CPU_ARMV8
+ select ADK_LINUX_64
+ select ADK_TARGET_PACKAGE_TXZ
+ help
+ AARCH64 toolchain.
diff --git a/target/aarch64/target.mk b/target/aarch64/target.mk
new file mode 100644
index 000000000..95a9f3337
--- /dev/null
+++ b/target/aarch64/target.mk
@@ -0,0 +1,4 @@
+include $(TOPDIR)/mk/kernel-ver.mk
+ARCH:= arm64
+CPU_ARCH:= $(ADK_TARGET_CPU_ARCH)
+TARGET_CFLAGS_ARCH:= $(ADK_TARGET_CFLAGS)
diff --git a/target/arch.lst b/target/arch.lst
index 8c9a71e0b..9fc6d20d2 100644
--- a/target/arch.lst
+++ b/target/arch.lst
@@ -1,3 +1,4 @@
+aarch64
arm
m68k
microblaze
diff --git a/target/config/Config.in b/target/config/Config.in
index d7bf385a2..c5d06be79 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -187,6 +187,7 @@ config ADK_TARGET_LIBC_PATH
config ADK_TARGET_KERNEL_MINICONFIG
string
+ default "arm-fm" if ADK_TARGET_SYSTEM_ARM_FM
default "qemu-microblaze-s3adsp1800" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
default "qemu-microblaze-ml605" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
default "qemu-arm-versatilepb" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
@@ -557,6 +558,9 @@ config ADK_CPU_ARM1176JZF_S
config ADK_CPU_CORTEX_A9
boolean
+config ADK_CPU_ARMV8
+ boolean
+
config ADK_TARGET_CPU_ARCH
string
default "x86_64" if ADK_CPU_X86_64
@@ -574,6 +578,7 @@ config ADK_TARGET_CPU_ARCH
default "mips64el" if ADK_LINUX_MIPS && ADK_little && ADK_LINUX_64
default "mips" if ADK_LINUX_MIPS && ADK_big
default "mipsel" if ADK_LINUX_MIPS && ADK_little
+ default "aarch64" if ADK_LINUX_AARCH64 && ADK_little
default "arm" if ADK_LINUX_ARM && ADK_little
default "sparc" if ADK_LINUX_SPARC
default "sparc64" if ADK_LINUX_SPARC64
@@ -606,6 +611,7 @@ config ADK_TARGET_CFLAGS
default "-march=loongson2f -Wa,-mfix-loongson2f-nop" if ADK_CPU_LOONGSON2F
default "-march=mips32" if ADK_CPU_MIPS32
default "-march=mips64" if ADK_CPU_MIPS64
+ default "-march=armv8-a" if ADK_CPU_ARMV8
default "-march=armv5te -mtune=iwmmxt" if ADK_CPU_XSCALE
default "-march=armv5te -mtune=arm926ej-s -mfloat-abi=soft" if ADK_CPU_ARM926EJ_S && ADK_soft_float
default "-march=armv5te -mtune=arm926ej-s -mfloat-abi=hard" if ADK_CPU_ARM926EJ_S && ADK_hard_float
@@ -636,6 +642,7 @@ config ADK_TARGET_CMDLINE
default "console=ttyS0,115200" if ADK_TARGET_QEMU_ARM_MODEL_SPITZ
default "console=ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
default "console=ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
+ default "console=ttyAMA0" if ADK_TARGET_SYSTEM_ARM_FM
default "console=ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4
default "console=ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4EB
default "console=ttyS0,115200" if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D13
@@ -668,6 +675,7 @@ config ADK_TARGET_LIB_UCLIBC
boolean
select ADK_uclibc
depends on \
+ !ADK_LINUX_AARCH64 && \
!ADK_LINUX_M68K && \
!ADK_LINUX_MICROBLAZE && \
!ADK_LINUX_SPARC64 && \
@@ -682,6 +690,7 @@ config ADK_TARGET_LIB_GLIBC
boolean
select ADK_glibc
depends on \
+ ADK_LINUX_AARCH64 || \
ADK_LINUX_ARM || \
ADK_LINUX_M68K || \
ADK_LINUX_MICROBLAZE || \
@@ -771,6 +780,7 @@ config ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK
select ADK_LINUX_INITRAMFS_BUILTIN
depends on \
ADK_HARDWARE_QEMU || \
+ ADK_LINUX_AARCH64 || \
ADK_LINUX_ARM || \
ADK_LINUX_M68K || \
ADK_LINUX_MICROBLAZE || \
@@ -826,6 +836,7 @@ config ADK_TARGET_ROOTFS_NFSROOT
select ADK_KERNEL_IP_PNP_DHCP
depends on !ADK_HARDWARE_QEMU && !ADK_HARDWARE_VBOX && !ADK_TARGET_SYSTEM_ARANYM_M68K
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI
+ depends on !ADK_TARGET_SYSTEM_ARM_FM
help
Root filesystem mounted via NFS. (DHCP)
diff --git a/target/config/Config.in.arch.choice b/target/config/Config.in.arch.choice
index c2fc7f2f3..54141eb3a 100644
--- a/target/config/Config.in.arch.choice
+++ b/target/config/Config.in.arch.choice
@@ -4,6 +4,12 @@ prompt "Target architecture"
config ADK_CHOOSE_TARGET_ARCH
bool "Choose target architecture"
+config ADK_LINUX_AARCH64
+ bool "aarch64 system"
+ select ADK_aarch64
+ help
+ Support for AARCH64 systems.
+
config ADK_LINUX_ARM
bool "arm system"
select ADK_arm
diff --git a/target/config/Config.in.arch.default b/target/config/Config.in.arch.default
index 90401de3d..df7e422f3 100644
--- a/target/config/Config.in.arch.default
+++ b/target/config/Config.in.arch.default
@@ -1,4 +1,7 @@
# target architectures
+config ADK_aarch64
+ bool
+
config ADK_arm
bool
@@ -34,6 +37,7 @@ config ADK_x86
config ADK_TARGET_ARCH
string
+ default "aarch64" if ADK_aarch64
default "arm" if ADK_arm
default "m68k" if ADK_m68k
default "microblaze" if ADK_microblaze
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index ea023d0df..d953c1189 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -88,7 +88,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
string
default "hvc0" if ADK_TARGET_SYSTEM_QEMU_PPC64
default "ttyUL0" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
- default "ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB || ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
+ default "ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB || ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9 || ADK_TARGET_SYSTEM_ARM_FM
default "ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4 || ADK_TARGET_SYSTEM_QEMU_SH4EB
default "ttymxc0" if ADK_TARGET_SYSTEM_CUBOX_I
default "ttyS0"
diff --git a/target/config/Config.in.system.choice b/target/config/Config.in.system.choice
index 54e4e621a..ccbaa1e82 100644
--- a/target/config/Config.in.system.choice
+++ b/target/config/Config.in.system.choice
@@ -1,3 +1,4 @@
+source "target/aarch64/Config.in"
source "target/arm/Config.in"
source "target/m68k/Config.in"
source "target/microblaze/Config.in"
diff --git a/target/tarch.lst b/target/tarch.lst
index 60e064398..8b3a57ef0 100644
--- a/target/tarch.lst
+++ b/target/tarch.lst
@@ -1,3 +1,4 @@
+aarch64
arm
armhf
m68k