[meta-lsi] [PATCH 08/22] add compiler tune for 32-bit armv8

Daniel Dragomir daniel.dragomir at windriver.com
Thu Jan 28 04:56:59 PST 2016


From: Cristian Bercaru <cristian.bercaru at windriver.com>

This patch enables the user to compile 32-bit packages optimized for
Axxia's 5600 X9 platform, which is based on an armv8 core. To do this,
edit the following variables in 'local.conf':
  MACHINE = "axxiaarm"
  CHIPSET = "X9"
If CHIPSET is not set, it will default to "5500", the Axxia platform
based on armv7, cortex-a15. The code is also optimized to use Neon and
VFPv3 vector floating point instructions, regardless of CHIPSET. After
the recipes are parsed, the bitbake log should display the following
  TUNE_FEATURES = "arm armv8a vfp neon"

Signed-off-by: Cristian Bercaru <cristian.bercaru at windriver.com>
---
 conf/machine/axxiaarm.conf                        |  8 ++++++--
 conf/machine/include/arm/arch-armv8a.inc          | 17 +++++++++++++++++
 recipes-kernel/linux/linux-yocto-rt_3.14.bbappend |  1 +
 recipes-kernel/linux/linux-yocto-rt_4.1.bbappend  |  1 +
 recipes-kernel/linux/linux-yocto_3.14.bbappend    |  1 +
 recipes-kernel/linux/linux-yocto_4.1.bbappend     |  1 +
 recipes-support/db/db_%.bbappend                  |  4 ++++
 7 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 conf/machine/include/arm/arch-armv8a.inc
 create mode 100644 recipes-support/db/db_%.bbappend

diff --git a/conf/machine/axxiaarm.conf b/conf/machine/axxiaarm.conf
index 2101920..256c047 100644
--- a/conf/machine/axxiaarm.conf
+++ b/conf/machine/axxiaarm.conf
@@ -2,7 +2,7 @@
 #@NAME: axxiaarm
 #@DESCRIPTION: Machine configuration for LSI Axxia ARM systems
 
-PREFERRED_VERSION_linux-yocto ?= "3.14%"
+PREFERRED_VERSION_linux-yocto ?= "4.1%"
 #PREFERRED_VERSION_u-boot-lsi ?= "2013.01.01%"
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 #PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-lsi"
@@ -13,7 +13,11 @@ MACHINE_FEATURES += "ext3"
 
 MACHINE_EXTRA_RRECOMMENDS += ""
 
-require conf/machine/include/tune-cortexa15.inc
+TUNE_ARMV8A = "conf/machine/include/arm/arch-armv8a.inc"
+TUNE_ARMV7A = "conf/machine/include/tune-cortexa15.inc"
+TUNE = "${@bb.utils.contains('CHIPSET', 'X9', '${TUNE_ARMV8A}', '${TUNE_ARMV7A}', d)}"
+require ${TUNE}
+DEFAULTTUNE_armv8a = "armv8a-neon"
 
 KARCH = "arm"
 KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/arm/arch-armv8a.inc b/conf/machine/include/arm/arch-armv8a.inc
new file mode 100644
index 0000000..26a71d9
--- /dev/null
+++ b/conf/machine/include/arm/arch-armv8a.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "armv8a"
+
+TUNEVALID[armv8a] = "Enable instructions for ARMv8-a"
+TUNECONFLICTS[armv8a] = "armv4 armv5 armv6 armv7 armv7a"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv8a", " -march=armv8-a", "", d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "armv8a", "armv8a:", "" ,d)}"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+# Little Endian base configs
+AVAILTUNES += "armv8a armv8a-neon"
+ARMPKGARCH_tune-armv8a ?= "armv8a"
+ARMPKGARCH_tune-armv8a-neon ?= "armv8a"
+TUNE_FEATURES_tune-armv8a ?= "arm armv8a vfp"
+TUNE_FEATURES_tune-armv8a-neon ?= "${TUNE_FEATURES_tune-armv8a} neon"
+PACKAGE_EXTRA_ARCHS_tune-armv8a = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv8a armv8a-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv8a-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv8a} armv8a-vfp-neon"
diff --git a/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 95940b9..ee50a87 100644
--- a/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -7,6 +7,7 @@ PARALLEL_MAKE = ""
 LINUX_KERNEL_TYPE = "preempt-rt"
 LSI_SRC ?= "linux-yocto"
 POWER_MANAGEMENT ?= "low-power"
+CHIPSET ?= "5500"
 BIG_ENDIAN ?= "no"
 DBG ?= "no"
 TESTING ?= "no"
diff --git a/recipes-kernel/linux/linux-yocto-rt_4.1.bbappend b/recipes-kernel/linux/linux-yocto-rt_4.1.bbappend
index 02305f4..dcbd9e0 100644
--- a/recipes-kernel/linux/linux-yocto-rt_4.1.bbappend
+++ b/recipes-kernel/linux/linux-yocto-rt_4.1.bbappend
@@ -7,6 +7,7 @@ PARALLEL_MAKE = ""
 LINUX_KERNEL_TYPE = "preempt-rt"
 LSI_SRC ?= "linux-yocto"
 POWER_MANAGEMENT ?= "low-power"
+CHIPSET ?= "5500"
 BIG_ENDIAN ?= "no"
 DBG ?= "no"
 TESTING ?= "no"
diff --git a/recipes-kernel/linux/linux-yocto_3.14.bbappend b/recipes-kernel/linux/linux-yocto_3.14.bbappend
index 87dbfb4..f970c0f 100644
--- a/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -7,6 +7,7 @@ PARALLEL_MAKE = ""
 LINUX_KERNEL_TYPE = "standard"
 LSI_SRC ?= "linux-yocto"
 POWER_MANAGEMENT ?= "low-power"
+CHIPSET ?= "5500"
 BIG_ENDIAN ?= "no"
 DBG ?= "no"
 TESTING ?= "no"
diff --git a/recipes-kernel/linux/linux-yocto_4.1.bbappend b/recipes-kernel/linux/linux-yocto_4.1.bbappend
index bcce98d..c25c5a3 100644
--- a/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -7,6 +7,7 @@ PARALLEL_MAKE = ""
 LINUX_KERNEL_TYPE = "standard"
 LSI_SRC ?= "linux-yocto"
 POWER_MANAGEMENT ?= "low-power"
+CHIPSET ?= "5500"
 BIG_ENDIAN ?= "no"
 DBG ?= "no"
 TESTING ?= "no"
diff --git a/recipes-support/db/db_%.bbappend b/recipes-support/db/db_%.bbappend
new file mode 100644
index 0000000..43d6371
--- /dev/null
+++ b/recipes-support/db/db_%.bbappend
@@ -0,0 +1,4 @@
+# Normally, when compiled on ARM, db is configured using
+# "--with-mutex=ARM/gcc-assembly" to use SWP instructions that became obsoleted
+# on ARMv8. When compiling on ARMv8 these settings are disabled.
+MUTEX_armv8a = ""
-- 
1.9.1



More information about the meta-lsi mailing list