blob: 5de6c9c234c4cc013a2adbac68f8cc62e7941998 [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001# This version extension should match CONFIG_LOCALVERSION in defconfig
2XILINX_RELEASE_VERSION ?= ""
3LINUX_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}"
4PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}"
5
6# Sources, by default allow for the use of SRCREV pointing to orphaned tags/commits
7KBRANCH ?= ""
8SRCBRANCHARG = "${@['nobranch=1', 'branch=${KBRANCH}'][d.getVar('KBRANCH', True) != '']}"
9
10FILESOVERRIDES_append = ":${XILINX_RELEASE_VERSION}"
11KERNELURI ?= "git://github.com/Xilinx/linux-xlnx.git;protocol=https"
12SRC_URI = "${KERNELURI};${SRCBRANCHARG}"
13
14SRCREV_machine ?= "${SRCREV}"
15
16require recipes-kernel/linux/linux-yocto.inc
17require linux-microblaze.inc
18
19DESCRIPTION = "Xilinx Kernel"
20
Brad Bishop26bdd442019-08-16 17:08:17 -040021EXTKERNELSRC = "${@'1' if d.getVar('EXTERNALSRC') else ''}"
22
Brad Bishop286d45c2018-10-02 15:21:57 -040023# Force the use of the KBUILD_DEFCONFIG even if some other defconfig was generated in the ${WORKDIR}
24do_kernel_metadata_prepend () {
25 [ -n "${KBUILD_DEFCONFIG}" ] && [ -e ${WORKDIR}/defconfig ] && rm ${WORKDIR}/defconfig
26}
27
Brad Bishop26bdd442019-08-16 17:08:17 -040028do_configure_prepend () {
29 if [ -n "${KBUILD_DEFCONFIG}" ] && [ -n "${EXTKERNELSRC}" ]; then
30 cp ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
31 fi
32}
33
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034inherit kernel-simpleimage
35
Brad Bishop286d45c2018-10-02 15:21:57 -040036# Default to be only compatible with specific machines or soc families
37COMPATIBLE_MACHINE ?= "^$"
38COMPATIBLE_MACHINE_zynq = ".*"
39COMPATIBLE_MACHINE_zynqmp = ".*"
40COMPATIBLE_MACHINE_microblaze = ".*"
Brad Bishop26bdd442019-08-16 17:08:17 -040041COMPATIBLE_MACHINE_versal = ".*"
Brad Bishop286d45c2018-10-02 15:21:57 -040042
43# Use DEFCONFIGs for configuring linux-xlnx kernels
44KCONFIG_MODE ?= "alldefconfig"
45KBUILD_DEFCONFIG_zynqmp = "xilinx_zynqmp_defconfig"
46KBUILD_DEFCONFIG_zynq = "xilinx_zynq_defconfig"
47KBUILD_DEFCONFIG_microblaze = "mmu_defconfig"
Brad Bishop26bdd442019-08-16 17:08:17 -040048KBUILD_DEFCONFIG_versal = "xilinx_versal_defconfig"
Brad Bishop286d45c2018-10-02 15:21:57 -040049
50# Add meta-xilinx kmeta, used for MicroBlaze BSP fragments
51FILESEXTRAPATHS_prepend := "${THISDIR}:"
52SRC_URI_append = " file://xilinx-kmeta;type=kmeta;name=xilinx-kmeta;destsuffix=xilinx-kmeta"
53
54# MicroBlaze BSP fragments
55KERNEL_FEATURES_append_kc705-microblazeel = " bsp/kc705-microblazeel/kc705-microblazeel.scc"
56
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080057KERNEL_FEATURES_append_zynqmp = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' bsp/xilinx/xen.scc', '', d)}"
58
Brad Bishop26bdd442019-08-16 17:08:17 -040059KERNEL_FEATURES_append_zynqmp = "${@' features/overlay/overlay.scc' if d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else ''}"
60
61KERNEL_FEATURES_append_versal = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' bsp/xilinx/xen.scc', '', d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062