summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2014-10-08 19:36:20 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2014-10-27 17:58:46 +1000
commit5ace286d7b941572edb8d3a61a8e045cfee35dc0 (patch)
tree6b0c3390a4403816fce9f542f6a94e174d065c5c
parentb3b8dc0c79b22f3746983ac35589578188b6fe97 (diff)
downloadmeta-xilinx-5ace286d7b941572edb8d3a61a8e045cfee35dc0.tar.gz
linux-xlnx: Rework linux-xlnx recipes to inherit linux-yocto
* Rework the recipes to inherit the linux-yocto recipes * Use the linux-yocto configuration process to create the kernel config * Suppliment the linux-yocto kernel cache/meta branch with a subset cache located in the meta-xilinx layer (this is to avoid incompatibilies) * Use the same config fragments and setup as the linux-yocto appends for Zynq and MicroBlaze * Remove the generation of device trees from the kernel recipe * Remove the use of the MACHINE_KCONFIG variable for providing config fragements Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
-rw-r--r--recipes-kernel/linux/linux-dtb.inc68
-rw-r--r--recipes-kernel/linux/linux-machine-common.inc5
-rw-r--r--recipes-kernel/linux/linux-machine-config.inc45
-rw-r--r--recipes-kernel/linux/linux-machine-kconfig.inc21
-rw-r--r--recipes-kernel/linux/linux-xlnx-dev.bb9
-rw-r--r--recipes-kernel/linux/linux-xlnx.inc27
-rw-r--r--recipes-kernel/linux/linux-xlnx_3.10.bb11
-rw-r--r--recipes-kernel/linux/linux-xlnx_3.14.bb8
8 files changed, 23 insertions, 171 deletions
diff --git a/recipes-kernel/linux/linux-dtb.inc b/recipes-kernel/linux/linux-dtb.inc
deleted file mode 100644
index 5efb9a0d..00000000
--- a/recipes-kernel/linux/linux-dtb.inc
+++ /dev/null
@@ -1,68 +0,0 @@
1# Support for device tree generation
2FILES_kernel-devicetree = "/boot/devicetree*"
3OOT_KERNEL_DEVICETREE_FLAGS ?= "-R 8 -p 0x3000"
4
5python __anonymous () {
6 oot_devicetree = d.getVar("OOT_KERNEL_DEVICETREE", True) or ''
7 if oot_devicetree:
8 depends = d.getVar("DEPENDS", True)
9 d.setVar("DEPENDS", "%s dtc-native" % depends)
10 packages = d.getVar("PACKAGES", True)
11 if "kernel-devicetree" not in packages:
12 d.setVar("PACKAGES", "%s kernel-devicetree" % packages)
13}
14
15do_install_append() {
16 if test -n "${OOT_KERNEL_DEVICETREE}"; then
17 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}; do
18 if [ ! -f ${DTS_FILE} ]; then
19 echo "Warning: ${DTS_FILE} is not available!"
20 continue
21 fi
22 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
23 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
24 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
25 dtc -I dts -O dtb ${OOT_KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
26 install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
27 done
28 fi
29}
30
31do_deploy_append() {
32 if test -n "${OOT_KERNEL_DEVICETREE}"; then
33 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}; do
34 if [ ! -f ${DTS_FILE} ]; then
35 echo "Warning: ${DTS_FILE} is not available!"
36 continue
37 fi
38 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
39 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
40 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
41 install -d ${DEPLOYDIR}
42 install -m 0644 ${B}/${DTS_BASE_NAME} ${DEPLOYDIR}/${DTB_NAME}.dtb
43 cd ${DEPLOYDIR}
44 ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
45 cd -
46 done
47 fi
48}
49
50pkg_postinst_kernel-devicetree () {
51 cd /${KERNEL_IMAGEDEST}
52 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}
53 do
54 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
55 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
56 update-alternatives --install /${KERNEL_IMAGEDEST}/${DTS_BASE_NAME}.dtb ${DTS_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
57 done
58}
59
60pkg_postrm_kernel-devicetree () {
61 cd /${KERNEL_IMAGEDEST}
62 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}
63 do
64 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
65 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
66 update-alternatives --remove ${DTS_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
67 done
68}
diff --git a/recipes-kernel/linux/linux-machine-common.inc b/recipes-kernel/linux/linux-machine-common.inc
deleted file mode 100644
index 0f79e1bb..00000000
--- a/recipes-kernel/linux/linux-machine-common.inc
+++ /dev/null
@@ -1,5 +0,0 @@
1require linux-dtb.inc
2require linux-machine-config.inc
3
4# MicroBlaze is a uImage target, but its not called 'uImage'
5DEPENDS_append_microblaze += "u-boot-mkimage-native"
diff --git a/recipes-kernel/linux/linux-machine-config.inc b/recipes-kernel/linux/linux-machine-config.inc
deleted file mode 100644
index f4e7fa54..00000000
--- a/recipes-kernel/linux/linux-machine-config.inc
+++ /dev/null
@@ -1,45 +0,0 @@
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
17inherit xilinx-utils
18
19# If OOT_KERNEL_DEVICETREE is not set, default to the device tree's provided by
20# MACHINE_DEVICETREE
21OOT_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})
25FILESEXTRAPATHS_append := "${@get_additional_bbpath_filespath('conf/machine/boards', d)}"
26
27# Using the MACHINE_DEVICETREE and MACHINE_KCONFIG vars, append them to SRC_URI
28SRC_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.
36do_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}
diff --git a/recipes-kernel/linux/linux-machine-kconfig.inc b/recipes-kernel/linux/linux-machine-kconfig.inc
deleted file mode 100644
index 881847d0..00000000
--- a/recipes-kernel/linux/linux-machine-kconfig.inc
+++ /dev/null
@@ -1,21 +0,0 @@
1#
2# This include file implements the merging of *.cfg files from the SRC_URI for
3# the Kernel.
4#
5
6# returns all the elements from the src uri that are .cfg files
7def find_config_fragments(d):
8 sources=src_patches(d, True)
9 sources_list=[]
10 for s in sources:
11 if s.endswith('.cfg'):
12 sources_list.append(s)
13 return sources_list
14
15kernel_do_configure_prepend() {
16 # Find all ".cfg" files and merge them together into a .config
17 CFG_FILES="${@" ".join(find_config_fragments(d))}"
18 if [ ! -z "$CFG_FILES" ]; then
19 ${S}/scripts/kconfig/merge_config.sh -m $CFG_FILES
20 fi
21}
diff --git a/recipes-kernel/linux/linux-xlnx-dev.bb b/recipes-kernel/linux/linux-xlnx-dev.bb
index 89b26409..4ef20275 100644
--- a/recipes-kernel/linux/linux-xlnx-dev.bb
+++ b/recipes-kernel/linux/linux-xlnx-dev.bb
@@ -3,13 +3,10 @@
3# 3#
4# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev" 4# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
5 5
6KBRANCH = "master-next" 6KBRANCH ?= "master-next"
7KBRANCH_DEFAULT = "${KBRANCH}"
8
9include linux-xlnx.inc
10 7
11# Use the SRCREV for the last tagged revision of linux-xlnx. 8# Use the SRCREV for the last tagged revision of linux-xlnx.
12SRCREV = "f27f400f43062b28d2b6f0977e50492b851d7464" 9SRCREV ?= "f27f400f43062b28d2b6f0977e50492b851d7464"
13 10
14python () { 11python () {
15 if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-xlnx-dev": 12 if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-xlnx-dev":
@@ -21,3 +18,5 @@ python () {
21LINUX_VERSION ?= "3.14+" 18LINUX_VERSION ?= "3.14+"
22LINUX_VERSION_EXTENSION = "-xilinx-dev" 19LINUX_VERSION_EXTENSION = "-xilinx-dev"
23PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}" 20PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}"
21
22include linux-xlnx.inc
diff --git a/recipes-kernel/linux/linux-xlnx.inc b/recipes-kernel/linux/linux-xlnx.inc
index 3caddc87..4c30438b 100644
--- a/recipes-kernel/linux/linux-xlnx.inc
+++ b/recipes-kernel/linux/linux-xlnx.inc
@@ -1,25 +1,20 @@
1DESCRIPTION = "Xilinx Kernel"
2SECTION = "kernel"
3LICENSE = "GPLv2"
4
5LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
6 1
7# This version extension should match CONFIG_LOCALVERSION in defconfig 2# This version extension should match CONFIG_LOCALVERSION in defconfig
8LINUX_VERSION_EXTENSION ?= "-xilinx" 3LINUX_VERSION_EXTENSION ?= "-xilinx"
9PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCREV}" 4PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}"
10 5
11# Sources 6# Sources
12KBRANCH ?= "master" 7KBRANCH ?= "master"
13SRC_URI = "git://github.com/Xilinx/linux-xlnx.git;protocol=https;branch=${KBRANCH}" 8FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx:${THISDIR}/config:"
14FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx:" 9SRC_URI = " \
10 git://github.com/Xilinx/linux-xlnx.git;protocol=https;branch=${KBRANCH} \
11 file://xilinx-base;type=kmeta;destsuffix=xilinx-base \
12 "
15 13
16# Source Directory 14require recipes-kernel/linux/linux-yocto.inc
17S = "${WORKDIR}/git" 15
16DESCRIPTION = "Xilinx Kernel"
18 17
19# Inherit/include base functionality 18require linux-xilinx-configs.inc
20inherit kernel 19require linux-xilinx-machines.inc
21require linux-machine-common.inc
22require linux-machine-kconfig.inc
23 20
24# Override COMPATIBLE_MACHINE to include your machine in a bbappend file.
25COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq"
diff --git a/recipes-kernel/linux/linux-xlnx_3.10.bb b/recipes-kernel/linux/linux-xlnx_3.10.bb
index 6df3aeb1..7f03bc63 100644
--- a/recipes-kernel/linux/linux-xlnx_3.10.bb
+++ b/recipes-kernel/linux/linux-xlnx_3.10.bb
@@ -1,10 +1,7 @@
1# See include file for common information
2include linux-xlnx.inc
3
4PR = "r1"
5
6# Kernel version and SRCREV correspond to: 1# Kernel version and SRCREV correspond to:
7# xilinx-v14.7 tag
8LINUX_VERSION = "3.10" 2LINUX_VERSION = "3.10"
9SRCREV = "efc27505715e64526653f35274717c0fc56491e3" 3# xilinx-v14.7 tag
4SRCREV ?= "efc27505715e64526653f35274717c0fc56491e3"
5PR = "r1"
10 6
7include linux-xlnx.inc
diff --git a/recipes-kernel/linux/linux-xlnx_3.14.bb b/recipes-kernel/linux/linux-xlnx_3.14.bb
index da3e51e4..d30f5816 100644
--- a/recipes-kernel/linux/linux-xlnx_3.14.bb
+++ b/recipes-kernel/linux/linux-xlnx_3.14.bb
@@ -1,6 +1,6 @@
1include linux-xlnx.inc
2
3# Kernel version and SRCREV correspond to: xlnx_3.14 branch 1# Kernel version and SRCREV correspond to: xlnx_3.14 branch
4KBRANCH = "xlnx_3.14"
5LINUX_VERSION = "3.14" 2LINUX_VERSION = "3.14"
6SRCREV = "2b48a8aeea7367359f9eebe55c4a09a05227f32b" 3KBRANCH ?= "xlnx_3.14"
4SRCREV ?= "2b48a8aeea7367359f9eebe55c4a09a05227f32b"
5
6include linux-xlnx.inc