diff options
author | Nathan Rossi <nathan.rossi@xilinx.com> | 2013-07-15 19:02:47 +1000 |
---|---|---|
committer | Nathan Rossi <nathan.rossi@xilinx.com> | 2013-07-15 19:02:47 +1000 |
commit | e6200271eec4cade86de5fde3ebc57b027fe46b7 (patch) | |
tree | da38fc5e6323a2703de4cbe8e50b50f73c3a7a15 | |
parent | a31d7a669470e4f230957a8b95e212e56914158e (diff) | |
download | meta-xilinx-e6200271eec4cade86de5fde3ebc57b027fe46b7.tar.gz |
linux-xlnx: Split MACHINE_* handler into separate include
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
-rw-r--r-- | recipes-kernel/linux/linux-machine-config.inc | 28 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-xlnx.inc | 31 |
2 files changed, 29 insertions, 30 deletions
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 @@ | |||
1 | |||
2 | # Scan all files in MACHINE_DEVICETREE and MACHINE_KCONFIG and populate SRC_URI, | ||
3 | # FILESEXTRAPATHS and KERNEL_DEVICETREE. | ||
4 | python __anonymous () { | ||
5 | workdir = d.getVar("WORKDIR", True) | ||
6 | machine_devicetree = d.getVar("MACHINE_DEVICETREE", True) or '' | ||
7 | machine_kconfigs = d.getVar("MACHINE_KCONFIG", True) or '' | ||
8 | extrapaths = set() | ||
9 | sources = set() | ||
10 | if machine_devicetree: | ||
11 | files=set() | ||
12 | for path in machine_devicetree.split(): | ||
13 | sources.add("file://" + os.path.basename(path)) | ||
14 | extrapaths.add(os.path.dirname(path)) | ||
15 | if os.path.splitext(os.path.basename(path))[1] == '.dts': | ||
16 | files.add(os.path.join(workdir, os.path.basename(path))) | ||
17 | d.setVar("KERNEL_DEVICETREE", ' '.join(files)) | ||
18 | if machine_kconfigs: | ||
19 | for path in machine_kconfigs.split(): | ||
20 | files.add(os.path.join(workdir, os.path.basename(path))) | ||
21 | sources.add("file://" + os.path.basename(path)) | ||
22 | extrapaths.add(os.path.dirname(path)) | ||
23 | |||
24 | if len(extrapaths) != 0: | ||
25 | d.setVar("FILESEXTRAPATHS_append", ":".join(extrapaths) + ":") | ||
26 | if len(sources) != 0: | ||
27 | d.setVar("SRC_URI_append", " %s " % " ".join(sources)) | ||
28 | } | ||
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 | |||
3 | # This version extension should match CONFIG_LOCALVERSION in defconfig | 3 | # This version extension should match CONFIG_LOCALVERSION in defconfig |
4 | LINUX_VERSION_EXTENSION ?= "-xilinx" | 4 | LINUX_VERSION_EXTENSION ?= "-xilinx" |
5 | 5 | ||
6 | require linux-machine-config.inc | ||
6 | require recipes-kernel/linux/linux-yocto.inc | 7 | require recipes-kernel/linux/linux-yocto.inc |
7 | 8 | ||
8 | # MicroBlaze is a uImage target, but its not called 'uImage' | 9 | # MicroBlaze is a uImage target, but its not called 'uImage' |
@@ -18,37 +19,7 @@ PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCREV}" | |||
18 | # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. | 19 | # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. |
19 | COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" | 20 | COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" |
20 | 21 | ||
21 | # Device Tree and Kernel Configuration | ||
22 | |||
23 | # Common Device Tree Includes | 22 | # Common Device Tree Includes |
24 | # (put them in ${WORKDIR} to avoid using dtc with include paths) | 23 | # (put them in ${WORKDIR} to avoid using dtc with include paths) |
25 | FILESEXTRAPATHS_append := "${XILINX_LAYERDIR}/conf/machine/boards/common:" | 24 | FILESEXTRAPATHS_append := "${XILINX_LAYERDIR}/conf/machine/boards/common:" |
26 | SRC_URI_append += "file://zynq-7-base.dtsi" | 25 | SRC_URI_append += "file://zynq-7-base.dtsi" |
27 | |||
28 | # Scan all files in MACHINE_DEVICETREE and MACHINE_KCONFIG and populate SRC_URI, | ||
29 | # FILESEXTRAPATHS and KERNEL_DEVICETREE. | ||
30 | python __anonymous () { | ||
31 | workdir = d.getVar("WORKDIR", True) | ||
32 | machine_devicetree = d.getVar("MACHINE_DEVICETREE", True) or '' | ||
33 | machine_kconfigs = d.getVar("MACHINE_KCONFIG", True) or '' | ||
34 | extrapaths = set() | ||
35 | sources = set() | ||
36 | if machine_devicetree: | ||
37 | files=set() | ||
38 | for path in machine_devicetree.split(): | ||
39 | sources.add("file://" + os.path.basename(path)) | ||
40 | extrapaths.add(os.path.dirname(path)) | ||
41 | if os.path.splitext(os.path.basename(path))[1] == '.dts': | ||
42 | files.add(os.path.join(workdir, os.path.basename(path))) | ||
43 | d.setVar("KERNEL_DEVICETREE", ' '.join(files)) | ||
44 | if machine_kconfigs: | ||
45 | for path in machine_kconfigs.split(): | ||
46 | files.add(os.path.join(workdir, os.path.basename(path))) | ||
47 | sources.add("file://" + os.path.basename(path)) | ||
48 | extrapaths.add(os.path.dirname(path)) | ||
49 | |||
50 | if len(extrapaths) != 0: | ||
51 | d.setVar("FILESEXTRAPATHS_append", ":".join(extrapaths) + ":") | ||
52 | if len(sources) != 0: | ||
53 | d.setVar("SRC_URI_append", " %s " % " ".join(sources)) | ||
54 | } | ||