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