[meta-xilinx] [PATCH 4/7] linux-xlnx: Rework kernel config setup

Nathan Rossi nathan at nathanrossi.com
Thu Oct 5 05:20:51 PDT 2017


This change reworks how the linux-xlnx kernel is configured, instead of
using kmeta fragments as the base config the kernel is instead
configured with defconfigs from the vendor tree. This has been the
default for zcu102-zynqmp and now extends to Zynq and MicroBlaze
targets.

Since linux-yocto.inc is still included by the linux-xlnx.inc, it is
possible to still use kmeta like .scc/.cfg fragments separately as well
as from a kmeta source. This is used by default to get the KC705 and
ZYBO Linux-BD kernel configuration fragments. Though fragments are
limited to the current in layer provided fragments by default.

Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
---
 recipes-kernel/linux/linux-xilinx-configs.inc  | 11 -------
 recipes-kernel/linux/linux-xilinx-machines.inc | 17 ----------
 recipes-kernel/linux/linux-xlnx.inc            | 45 +++++++++++++++-----------
 3 files changed, 27 insertions(+), 46 deletions(-)
 delete mode 100644 recipes-kernel/linux/linux-xilinx-configs.inc
 delete mode 100644 recipes-kernel/linux/linux-xilinx-machines.inc

diff --git a/recipes-kernel/linux/linux-xilinx-configs.inc b/recipes-kernel/linux/linux-xilinx-configs.inc
deleted file mode 100644
index 5892c1c43d..0000000000
--- a/recipes-kernel/linux/linux-xilinx-configs.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-# This include file sets up the xilinx config fragments, these
-# fragments build on top of the base config infrastructure provided in
-# the linux-yocto/kernel-yocto recipes and classes in core layer of OE.
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/config:"
-
-SRC_URI_append = " \
-		file://xilinx-common;type=kmeta;name=kmeta-xilinx-common;destsuffix=xilinx-common \
-		file://xilinx-machine;type=kmeta;name=kmeta-xilinx-machine;destsuffix=xilinx-machine \
-		"
-
diff --git a/recipes-kernel/linux/linux-xilinx-machines.inc b/recipes-kernel/linux/linux-xilinx-machines.inc
deleted file mode 100644
index 77cab0af33..0000000000
--- a/recipes-kernel/linux/linux-xilinx-machines.inc
+++ /dev/null
@@ -1,17 +0,0 @@
-# Setup for MicroBlaze and Zynq architectures
-COMPATIBLE_MACHINE ?= "^$"
-COMPATIBLE_MACHINE_zynq = "zynq"
-COMPATIBLE_MACHINE_zynqmp = "zynqmp"
-COMPATIBLE_MACHINE_microblaze = "microblaze"
-
-# Default kernel config fragements for specific machines
-KERNEL_FEATURES_append_ml605-qemu-microblazeel = " bsp/ml605-qemu-microblazeel.scc"
-KERNEL_FEATURES_append_s3adsp1800-qemu-microblazeeb = " bsp/s3adsp1800-qemu-microblazeeb.scc"
-KERNEL_FEATURES_append_kc705-microblazeel = " bsp/kc705-microblazeel/kc705-microblazeel.scc"
-
-# MicroBlaze is a uImage target, but its not called 'uImage' instead it is called 'linux.bin.ub'
-python () {
-    if d.getVar('KERNEL_IMAGETYPE', True).endswith('.ub'):
-        d.setVar('DEPENDS', "%s u-boot-mkimage-native" % d.getVar('DEPENDS', True))
-}
-
diff --git a/recipes-kernel/linux/linux-xlnx.inc b/recipes-kernel/linux/linux-xlnx.inc
index 844fdfd5c0..590287efb7 100644
--- a/recipes-kernel/linux/linux-xlnx.inc
+++ b/recipes-kernel/linux/linux-xlnx.inc
@@ -1,4 +1,3 @@
-
 # This version extension should match CONFIG_LOCALVERSION in defconfig
 XILINX_RELEASE_VERSION ?= ""
 LINUX_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}"
@@ -10,28 +9,38 @@ SRCBRANCHARG = "${@['nobranch=1', 'branch=${KBRANCH}'][d.getVar('KBRANCH', True)
 
 FILESOVERRIDES_append = ":${LINUX_VERSION}"
 KERNELURI ?= "git://github.com/Xilinx/linux-xlnx.git;protocol=https"
-SRC_URI = " \
-		${KERNELURI};${SRCBRANCHARG} \
-		file://xilinx-base;type=kmeta;name=kmeta-xilinx-base;destsuffix=xilinx-base \
-		"
+SRC_URI = "${KERNELURI};${SRCBRANCHARG}"
 
 SRCREV_machine ?= "${SRCREV}"
 
 require recipes-kernel/linux/linux-yocto.inc
+require linux-microblaze.inc
 
 DESCRIPTION = "Xilinx Kernel"
 
-require linux-xilinx-configs.inc
-require linux-xilinx-machines.inc
-
-KBUILD_DEFCONFIG_zcu102-zynqmp = "xilinx_zynqmp_defconfig"
-KCONFIG_MODE_zcu102-zynqmp = "alldefconfig"
-
-KERNEL_FEATURES_append = " bsp/xilinx/soc/linux-xlnx/drivers/xilinx.scc"
-KERNEL_FEATURES_append_zynq = " bsp/xilinx/soc/linux-xlnx/drivers/zynq7.scc"
-KERNEL_FEATURES_append_zynqmp = " \
-		bsp/xilinx/soc/linux-xlnx/drivers/zynqmp.scc \
-		features/drm/drm-xilinx.scc \
-		features/v4l2/v4l2-xilinx.scc \
-		"
+# Force the use of the KBUILD_DEFCONFIG even if some other defconfig was generated in the ${WORKDIR}
+do_kernel_metadata_prepend () {
+	if [ -n "${KBUILD_DEFCONFIG}" ]; then
+		rm ${WORKDIR}/defconfig
+	fi
+}
+
+# Default to be only compatible with specific machines or soc families
+COMPATIBLE_MACHINE ?= "^$"
+COMPATIBLE_MACHINE_zynq = ".*"
+COMPATIBLE_MACHINE_zynqmp = ".*"
+COMPATIBLE_MACHINE_kc705-microblazeel = ".*"
+
+# Use DEFCONFIGs for configuring linux-xlnx kernels
+KCONFIG_MODE ?= "alldefconfig"
+KBUILD_DEFCONFIG_zynqmp = "xilinx_zynqmp_defconfig"
+KBUILD_DEFCONFIG_zynq = "xilinx_zynq_defconfig"
+KBUILD_DEFCONFIG_microblaze = "mmu_defconfig"
+
+# Add meta-xilinx kmeta, used for MicroBlaze BSP fragments
+FILESEXTRAPATHS_prepend := "${THISDIR}:"
+SRC_URI_append = " file://xilinx-kmeta;type=kmeta;name=xilinx-kmeta;destsuffix=xilinx-kmeta"
+
+# MicroBlaze BSP fragments
+KERNEL_FEATURES_append_kc705-microblazeel = " bsp/kc705-microblazeel/kc705-microblazeel.scc"
 
-- 
2.14.2





More information about the meta-xilinx mailing list