diff options
| author | Nathan Rossi <nathan.rossi@xilinx.com> | 2014-10-08 19:36:20 +1000 |
|---|---|---|
| committer | Nathan Rossi <nathan.rossi@xilinx.com> | 2014-10-27 17:58:46 +1000 |
| commit | 5ace286d7b941572edb8d3a61a8e045cfee35dc0 (patch) | |
| tree | 6b0c3390a4403816fce9f542f6a94e174d065c5c | |
| parent | b3b8dc0c79b22f3746983ac35589578188b6fe97 (diff) | |
| download | meta-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.inc | 68 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-machine-common.inc | 5 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-machine-config.inc | 45 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-machine-kconfig.inc | 21 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-xlnx-dev.bb | 9 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-xlnx.inc | 27 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-xlnx_3.10.bb | 11 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-xlnx_3.14.bb | 8 |
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 | ||
| 2 | FILES_kernel-devicetree = "/boot/devicetree*" | ||
| 3 | OOT_KERNEL_DEVICETREE_FLAGS ?= "-R 8 -p 0x3000" | ||
| 4 | |||
| 5 | python __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 | |||
| 15 | do_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 | |||
| 31 | do_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 | |||
| 50 | pkg_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 | |||
| 60 | pkg_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 @@ | |||
| 1 | require linux-dtb.inc | ||
| 2 | require linux-machine-config.inc | ||
| 3 | |||
| 4 | # MicroBlaze is a uImage target, but its not called 'uImage' | ||
| 5 | DEPENDS_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 | |||
| 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 | } | ||
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 | ||
| 7 | def 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 | |||
| 15 | kernel_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 | ||
| 6 | KBRANCH = "master-next" | 6 | KBRANCH ?= "master-next" |
| 7 | KBRANCH_DEFAULT = "${KBRANCH}" | ||
| 8 | |||
| 9 | include 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. |
| 12 | SRCREV = "f27f400f43062b28d2b6f0977e50492b851d7464" | 9 | SRCREV ?= "f27f400f43062b28d2b6f0977e50492b851d7464" |
| 13 | 10 | ||
| 14 | python () { | 11 | python () { |
| 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 () { | |||
| 21 | LINUX_VERSION ?= "3.14+" | 18 | LINUX_VERSION ?= "3.14+" |
| 22 | LINUX_VERSION_EXTENSION = "-xilinx-dev" | 19 | LINUX_VERSION_EXTENSION = "-xilinx-dev" |
| 23 | PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}" | 20 | PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}" |
| 21 | |||
| 22 | include 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 @@ | |||
| 1 | DESCRIPTION = "Xilinx Kernel" | ||
| 2 | SECTION = "kernel" | ||
| 3 | LICENSE = "GPLv2" | ||
| 4 | |||
| 5 | LIC_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 |
| 8 | LINUX_VERSION_EXTENSION ?= "-xilinx" | 3 | LINUX_VERSION_EXTENSION ?= "-xilinx" |
| 9 | PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCREV}" | 4 | PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}" |
| 10 | 5 | ||
| 11 | # Sources | 6 | # Sources |
| 12 | KBRANCH ?= "master" | 7 | KBRANCH ?= "master" |
| 13 | SRC_URI = "git://github.com/Xilinx/linux-xlnx.git;protocol=https;branch=${KBRANCH}" | 8 | FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx:${THISDIR}/config:" |
| 14 | FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx:" | 9 | SRC_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 | 14 | require recipes-kernel/linux/linux-yocto.inc |
| 17 | S = "${WORKDIR}/git" | 15 | |
| 16 | DESCRIPTION = "Xilinx Kernel" | ||
| 18 | 17 | ||
| 19 | # Inherit/include base functionality | 18 | require linux-xilinx-configs.inc |
| 20 | inherit kernel | 19 | require linux-xilinx-machines.inc |
| 21 | require linux-machine-common.inc | ||
| 22 | require linux-machine-kconfig.inc | ||
| 23 | 20 | ||
| 24 | # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. | ||
| 25 | COMPATIBLE_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 | ||
| 2 | include linux-xlnx.inc | ||
| 3 | |||
| 4 | PR = "r1" | ||
| 5 | |||
| 6 | # Kernel version and SRCREV correspond to: | 1 | # Kernel version and SRCREV correspond to: |
| 7 | # xilinx-v14.7 tag | ||
| 8 | LINUX_VERSION = "3.10" | 2 | LINUX_VERSION = "3.10" |
| 9 | SRCREV = "efc27505715e64526653f35274717c0fc56491e3" | 3 | # xilinx-v14.7 tag |
| 4 | SRCREV ?= "efc27505715e64526653f35274717c0fc56491e3" | ||
| 5 | PR = "r1" | ||
| 10 | 6 | ||
| 7 | include 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 @@ | |||
| 1 | include 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 |
| 4 | KBRANCH = "xlnx_3.14" | ||
| 5 | LINUX_VERSION = "3.14" | 2 | LINUX_VERSION = "3.14" |
| 6 | SRCREV = "2b48a8aeea7367359f9eebe55c4a09a05227f32b" | 3 | KBRANCH ?= "xlnx_3.14" |
| 4 | SRCREV ?= "2b48a8aeea7367359f9eebe55c4a09a05227f32b" | ||
| 5 | |||
| 6 | include linux-xlnx.inc | ||
