Skip to contentSkip to conversation

Update the AArch64 defconfig for Foundation v8

PATCH New Thomas Petazzoni 2 participants 6 messages Mar 21, 2014

lore
Share & tools
lore
#0 lore raw

cover Update the AArch64 defconfig for Foundation v8

Hello,

This set of commits updates the Foundation v8 defconfig to use a mainline kernel, bumps the version of the boot-wrapper-aarch64, and fixes a problem with the Linaro AArch64 toolchain (which was initially reported by Kevin Hilman on IRC).

Thomas

Thomas Petazzoni (4):
pkg-autotools: add a AUTOCONF_AC_CHECK_FILE_VAL macro
boot-wrapper-aarch64: bump version and switch to autotools-package
toolchain-external: Linaro AArch64 toolchains need a symlink, like ARM
ones
board/arm/foundation-v8: update defconfig and instructions

 board/arm/foundation-v8/readme.txt                 |  2 +-
 boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk  | 38 ++++++++++++++++------
 configs/arm_foundationv8_defconfig                 | 18 +++++-----
 package/pkg-autotools.mk                           | 10 ++++++
 toolchain/toolchain-external/toolchain-external.mk |  8 +++++
 5 files changed, 57 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/4 pkg-autotools: add a AUTOCONF_AC_CHECK_FILE_VAL macro

When configure.ac scripts do AC_CHECK_FILE tests, they always fail in cross-compilation contexts because it is not possible to check for file existence during the build process. Therefore we have to preseed the configure environment with ac_cv_file_<foo>=yes variable, <foo> being the path of the file, where all slashes, dots or dashes have been replaced by underscores.

In the context of the boot-wrapper-aarch64, we will have to use three of these variables, with fairly complex paths. So instead of replicating the logic each time, we create a AUTOCONF_AC_CHECK_FILE_VAL macro to help defining such variables.

---
 package/pkg-autotools.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/pkg-autotools.mk +10 -0
index 32ceef2..a646612 100644
@@ -36,6 +36,16 @@ define CONFIG_UPDATE
 	done
 endef
 
+# This function generates the ac_cv_file_<foo> value for a given
+# filename. This is needed to convince configure script doing
+# AC_CHECK_FILE() tests that the file actually exists, since such
+# tests cannot be done in a cross-compilation context. This function
+# takes as argument the path of the file. An example usage is:
+#
+#  FOOBAR_CONF_ENV = \
+#	$(call AUTOCONF_AC_CHECK_FILE_VAL,/dev/random)=yes
+AUTOCONF_AC_CHECK_FILE_VAL = ac_cv_file_$(subst -,_,$(subst /,_,$(subst .,_,$(1))))
+
 ################################################################################
 # inner-autotools-package -- defines how the configuration, compilation and
 # installation of an autotools package should be done, implements a
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/4 boot-wrapper-aarch64: bump version and switch to autotools-package

In reply to Thomas Petazzoni

This commit updates boot-wrapper-aarch64 to the latest version. As it now uses the autotools, we switch the package to the autotools-package infrastructure.

---
 boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk | 38 +++++++++++++++++------
 1 file changed, 28 insertions(+), 10 deletions(-)
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk +28 -10
index d9ddf48..f4e1e1f 100644
@@ -4,26 +4,44 @@
 #
 ################################################################################
 
-BOOT_WRAPPER_AARCH64_VERSION        = 26b62f586020fd998c6efd43db657eaafeec14da
+BOOT_WRAPPER_AARCH64_VERSION        = 4266507a84f8c06452109d38e0350d4759740694
 BOOT_WRAPPER_AARCH64_SITE           = git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/boot-wrapper-aarch64.git
 BOOT_WRAPPER_AARCH64_LICENSE        = BSD3c
 BOOT_WRAPPER_AARCH64_LICENSE_FILES  = LICENSE.txt
 BOOT_WRAPPER_AARCH64_DEPENDENCIES   = linux
 BOOT_WRAPPER_AARCH64_INSTALL_IMAGES = YES
 
-BOOT_WRAPPER_AARCH64_DTS = $(call qstrip,$(BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS))
+# The Git repository does not have the generated configure script and
+# Makefile.
+BOOT_WRAPPER_AARCH64_AUTORECONF = YES
 
-define BOOT_WRAPPER_AARCH64_BUILD_CMDS
-	$(MAKE) \
-		KERNEL=$(BINARIES_DIR)/Image \
-		DTC=$(LINUX_DIR)/scripts/dtc/dtc \
-		FDT_SRC=$(LINUX_DIR)/arch/arm64/boot/dts/$(BOOT_WRAPPER_AARCH64_DTS).dts \
-		CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
-		BOOTARGS='$(BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS)' -C $(@D)
+BOOT_WRAPPER_AARCH64_DTB = /arch/arm64/boot/dts/$(basename $(call qstrip,$(BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS))).dtb
+
+# Fixup the path to the DTB in configure.ac. In the future, this
+# should hopefully be made more configurable by the
+# boot-wrapper-aarch64 developers.
+define BOOT_WRAPPER_AARCH64_FIX_DTB_NAME
+	$(SED) 's%^KERN_DTB=.*%KERN_DTB=$(BOOT_WRAPPER_AARCH64_DTB)%' $(@D)/configure.ac
 endef
 
+BOOT_WRAPPER_AARCH64_PRE_PATCH_HOOKS += BOOT_WRAPPER_AARCH64_FIX_DTB_NAME
+
+BOOT_WRAPPER_AARCH64_CONF_OPT = \
+	--with-kernel-dir=$(LINUX_DIR) \
+	--with-cmdline=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS)
+
+# We need to convince the configure script that the Linux kernel tree
+# exists, as well as the DTB and the kernel Image. Even though those
+# are available on the build machine, the configure script uses
+# AC_CHECK_FILE tests, which are always disabled in cross-compilation
+# situations.
+BOOT_WRAPPER_AARCH64_CONF_ENV = \
+	$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR))=yes \
+	$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR)$(BOOT_WRAPPER_AARCH64_DTB))=yes \
+	$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR)/arch/arm64/boot/Image)=yes
+
 define BOOT_WRAPPER_AARCH64_INSTALL_IMAGES_CMDS
 	cp $(@D)/linux-system.axf $(BINARIES_DIR)
 endef
 
-$(eval $(generic-package))
+$(eval $(autotools-package))
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/4 toolchain-external: Linaro AArch64 toolchains need a symlink, like ARM ones

In reply to Thomas Petazzoni

Like ARM ones, the Linaro AArch64 toolchains expect libraries in /lib/aarch64-linux-gnu and /usr/lib/aarch64-linux-gnu, but Buildroot always installs them in /lib and /usr/lib. Therefore, this commit adds the appropriate symbolic links, just like we're already doing for Linaro ARM toolchains.

---
 toolchain/toolchain-external/toolchain-external.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
toolchain/toolchain-external/toolchain-external.mk +8 -0
index 1b1053d..547d55d 100644
@@ -242,6 +242,11 @@ define TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK
 	ln -sf . $(TARGET_DIR)/usr/lib/arm-linux-gnueabihf
 endef
 
+define TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK
+	ln -sf . $(TARGET_DIR)/lib/aarch64-linux-gnu
+	ln -sf . $(TARGET_DIR)/usr/lib/aarch64-linux-gnu
+endef
+
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/
 TOOLCHAIN_EXTERNAL_SOURCE = arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
@@ -346,12 +351,15 @@ TOOLCHAIN_EXTERNAL_SOURCE = microblaze-unknown-linux-gnu.tgz
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_09),y)
 TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.09/components/toolchain/binaries/
 TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux.tar.xz
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_10),y)
 TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.10/components/toolchain/binaries/
 TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.10-1_linux.tar.xz
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_11),y)
 TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.11/components/toolchain/binaries/
 TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux.tar.xz
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK
 else
 # Custom toolchain
 TOOLCHAIN_EXTERNAL_SITE = $(dir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL)))
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 4/4 board/arm/foundation-v8: update defconfig and instructions

In reply to Thomas Petazzoni

This commit updates the defconfig of the foundation-v8 platform, which can be tested under the AArch64 emulator provided by ARM. The main change is that we switch to the mainline 3.13.6 kernel instead of a Linaro-specific Git tree.

Another change is to update the download link for the emulator in the instructions, in order to use the latest version of the emulator, which was used for testing.

---
 board/arm/foundation-v8/readme.txt |  2 +-
 configs/arm_foundationv8_defconfig | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)
board/arm/foundation-v8/readme.txt +1 -1
index 7f419a0..f6d0698 100644
@@ -3,7 +3,7 @@ ARM software simulator of the AArch64 architecture.
 
 First, one has to download the AArch64 software simulator from:
 
-  https://silver.arm.com/download/download.tm?pv=1317469
+  https://silver.arm.com/download/download.tm?pv=1509509
 
 Then, use the arm_foundationv8_defconfig configuration to build your
 Buildroot system.
configs/arm_foundationv8_defconfig +10 -8
index c8de16d..2280792 100644
@@ -1,15 +1,17 @@
 BR2_aarch64=y
 BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.13.6"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(LINUX_DIR)/arch/arm64/configs/defconfig"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="foundation-v8"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_BOOT_WRAPPER_AARCH64=y
-BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS="vexpress-foundation-v8"
+BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS="foundation-v8"
 BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS="root=/dev/vda consolelog=9 console=ttyAMA0 rw"
-BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_GIT=y
-BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.linaro.org/kernel/linaro-aarch64.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="7181edd0539e195f78adedbb6c3878f9f1e0c4bb"
-BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
-BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
-BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image"
Signature · 1 line
1.8.3.2
#5 lore raw

cover Update the AArch64 defconfig for Foundation v8

In reply to Thomas Petazzoni
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
This set of commits updates the Foundation v8 defconfig to use a mainline kernel, bumps the version of the boot-wrapper-aarch64, and fixes a problem with the Linaro AArch64 toolchain (which was initially reported by Kevin Hilman on IRC).

Committed series, thanks - Great we got to the bottom of the issue.

Signature · 1 line
Bye, Peter Korsgaard