From e6200271eec4cade86de5fde3ebc57b027fe46b7 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Mon, 15 Jul 2013 19:02:47 +1000 Subject: linux-xlnx: Split MACHINE_* handler into separate include Signed-off-by: Nathan Rossi --- recipes-kernel/linux/linux-machine-config.inc | 28 ++++++++++++++++++++++++ recipes-kernel/linux/linux-xlnx.inc | 31 +-------------------------- 2 files changed, 29 insertions(+), 30 deletions(-) create mode 100644 recipes-kernel/linux/linux-machine-config.inc diff --git a/recipes-kernel/linux/linux-machine-config.inc b/recipes-kernel/linux/linux-machine-config.inc new file mode 100644 index 00000000..83fb1004 --- /dev/null +++ b/recipes-kernel/linux/linux-machine-config.inc @@ -0,0 +1,28 @@ + +# Scan all files in MACHINE_DEVICETREE and MACHINE_KCONFIG and populate SRC_URI, +# FILESEXTRAPATHS and KERNEL_DEVICETREE. +python __anonymous () { + workdir = d.getVar("WORKDIR", True) + machine_devicetree = d.getVar("MACHINE_DEVICETREE", True) or '' + machine_kconfigs = d.getVar("MACHINE_KCONFIG", True) or '' + extrapaths = set() + sources = set() + if machine_devicetree: + files=set() + for path in machine_devicetree.split(): + sources.add("file://" + os.path.basename(path)) + extrapaths.add(os.path.dirname(path)) + if os.path.splitext(os.path.basename(path))[1] == '.dts': + files.add(os.path.join(workdir, os.path.basename(path))) + d.setVar("KERNEL_DEVICETREE", ' '.join(files)) + if machine_kconfigs: + for path in machine_kconfigs.split(): + files.add(os.path.join(workdir, os.path.basename(path))) + sources.add("file://" + os.path.basename(path)) + extrapaths.add(os.path.dirname(path)) + + if len(extrapaths) != 0: + d.setVar("FILESEXTRAPATHS_append", ":".join(extrapaths) + ":") + if len(sources) != 0: + d.setVar("SRC_URI_append", " %s " % " ".join(sources)) +} diff --git a/recipes-kernel/linux/linux-xlnx.inc b/recipes-kernel/linux/linux-xlnx.inc index dcad563b..9eb869d8 100644 --- a/recipes-kernel/linux/linux-xlnx.inc +++ b/recipes-kernel/linux/linux-xlnx.inc @@ -3,6 +3,7 @@ inherit kernel # This version extension should match CONFIG_LOCALVERSION in defconfig LINUX_VERSION_EXTENSION ?= "-xilinx" +require linux-machine-config.inc require recipes-kernel/linux/linux-yocto.inc # MicroBlaze is a uImage target, but its not called 'uImage' @@ -18,37 +19,7 @@ PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCREV}" # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" -# Device Tree and Kernel Configuration - # Common Device Tree Includes # (put them in ${WORKDIR} to avoid using dtc with include paths) FILESEXTRAPATHS_append := "${XILINX_LAYERDIR}/conf/machine/boards/common:" SRC_URI_append += "file://zynq-7-base.dtsi" - -# Scan all files in MACHINE_DEVICETREE and MACHINE_KCONFIG and populate SRC_URI, -# FILESEXTRAPATHS and KERNEL_DEVICETREE. -python __anonymous () { - workdir = d.getVar("WORKDIR", True) - machine_devicetree = d.getVar("MACHINE_DEVICETREE", True) or '' - machine_kconfigs = d.getVar("MACHINE_KCONFIG", True) or '' - extrapaths = set() - sources = set() - if machine_devicetree: - files=set() - for path in machine_devicetree.split(): - sources.add("file://" + os.path.basename(path)) - extrapaths.add(os.path.dirname(path)) - if os.path.splitext(os.path.basename(path))[1] == '.dts': - files.add(os.path.join(workdir, os.path.basename(path))) - d.setVar("KERNEL_DEVICETREE", ' '.join(files)) - if machine_kconfigs: - for path in machine_kconfigs.split(): - files.add(os.path.join(workdir, os.path.basename(path))) - sources.add("file://" + os.path.basename(path)) - extrapaths.add(os.path.dirname(path)) - - if len(extrapaths) != 0: - d.setVar("FILESEXTRAPATHS_append", ":".join(extrapaths) + ":") - if len(sources) != 0: - d.setVar("SRC_URI_append", " %s " % " ".join(sources)) -} -- cgit v1.2.3-54-g00ecf