blob: 9265d557a24530ad5122bc5770a9288bc3334515 [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001require linux-rpi.inc
2inherit linux-raspberrypi-base
3
4DESCRIPTION = "Linux Kernel for Raspberry Pi"
5SECTION = "kernel"
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
8
9SRC_URI += " \
10 file://defconfig \
11 "
12
13COMPATIBLE_MACHINE = "raspberrypi"
14
15PE = "1"
16PV = "${LINUX_VERSION}+git${SRCPV}"
17
18# NOTE: For now we pull in the default config from the RPi kernel GIT tree.
19KERNEL_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig"
20KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"
Brad Bishop3a5fbf52017-12-04 02:17:07 -050021KERNEL_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig"
Patrick Williams8b8bc412016-08-17 15:02:23 -050022
23# CMDLINE for raspberrypi
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024CMDLINE ?= "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
Patrick Williams8b8bc412016-08-17 15:02:23 -050025
26# Add the kernel debugger over console kernel command line option if enabled
27CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
28
29UDEV_GE_141 ?= "1"
30
31KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
32
33# Set programmatically some variables during recipe parsing
34# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
35python __anonymous () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050036 kerneltype = d.getVar('KERNEL_IMAGETYPE')
37 kerneldt = get_dts(d, d.getVar('LINUX_VERSION'))
Patrick Williams8b8bc412016-08-17 15:02:23 -050038 d.setVar("KERNEL_DEVICETREE", kerneldt)
39}
40
41do_kernel_configme_prepend() {
42 install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
43}
44
45do_install_prepend() {
46 install -d ${D}/lib/firmware
47}
48
49do_deploy_append() {
50 # Deploy cmdline.txt
51 install -d ${DEPLOYDIR}/bcm2835-bootfiles
52 PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
53 if [ ${PITFT} = "1" ]; then
54 PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
55 fi
56 echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
57}