diff options
Diffstat (limited to 'recipes-kernel/linux/linux-machine-config.inc')
-rw-r--r-- | recipes-kernel/linux/linux-machine-config.inc | 45 |
1 files changed, 45 insertions, 0 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..f4e7fa54 --- /dev/null +++ b/recipes-kernel/linux/linux-machine-config.inc | |||
@@ -0,0 +1,45 @@ | |||
1 | # | ||
2 | # This include file implements the MACHINE_DEVICETREE and MACHINE_KCONFIG | ||
3 | # variable handling for the Kernel. | ||
4 | # | ||
5 | # e.g. (set in the associated <machine>.conf) | ||
6 | # MACHINE_DEVICETREE := "zc702/zc702-zynq7.dts" | ||
7 | # MACHINE_KCONFIG := "common/rtc.cfg" | ||
8 | # | ||
9 | # This will expand out to: | ||
10 | # SRC_URI_append += "file://zc702/zc702-zynq7.dts file://common/rtc.cfg" | ||
11 | # OOT_KERNEL_DEVICETREE ?= "${WORKDIR}/devicetree/zc702-zynq7.dts" | ||
12 | # | ||
13 | # This include also adds all the 'conf/machine/boards' for all layers (that are | ||
14 | # available) to the FILESEXTRAPATHS. | ||
15 | # | ||
16 | |||
17 | inherit xilinx-utils | ||
18 | |||
19 | # If OOT_KERNEL_DEVICETREE is not set, default to the device tree's provided by | ||
20 | # MACHINE_DEVICETREE | ||
21 | OOT_KERNEL_DEVICETREE ?= "${@expand_dir_basepaths_by_extension("MACHINE_DEVICETREE", os.path.join(d.getVar("WORKDIR", True), 'devicetree'), '.dts', d)}" | ||
22 | |||
23 | # Appends the '<layer>/conf/machine/boards' path to FILESEXTRAPATHS for all | ||
24 | # layers (using the ${BBPATH}) | ||
25 | FILESEXTRAPATHS_append := "${@get_additional_bbpath_filespath('conf/machine/boards', d)}" | ||
26 | |||
27 | # Using the MACHINE_DEVICETREE and MACHINE_KCONFIG vars, append them to SRC_URI | ||
28 | SRC_URI_append += " \ | ||
29 | ${@paths_affix(d.getVar("MACHINE_DEVICETREE", True) or '', prefix = 'file://')} \ | ||
30 | ${@paths_affix(d.getVar("MACHINE_KCONFIG", True) or '', prefix = 'file://')} \ | ||
31 | " | ||
32 | |||
33 | # Copy all device tree's into the same directory. This is due to compatibility | ||
34 | # with dtc and the use of DTSI (Device Tree Includes), the version of DTC in | ||
35 | # Yocto does not provide include path support. | ||
36 | do_install_prepend() { | ||
37 | if test -n "${MACHINE_DEVICETREE}"; then | ||
38 | mkdir -p ${WORKDIR}/devicetree | ||
39 | for i in ${MACHINE_DEVICETREE}; do | ||
40 | if test -e ${WORKDIR}/$i; then | ||
41 | cp ${WORKDIR}/$i ${WORKDIR}/devicetree | ||
42 | fi | ||
43 | done | ||
44 | fi | ||
45 | } | ||