blob: 98229d99e28db57e3599db102da883cda9850ee6 [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"
21
22# CMDLINE for raspberrypi
23CMDLINE = "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
24
25# Add the kernel debugger over console kernel command line option if enabled
26CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
27
28UDEV_GE_141 ?= "1"
29
30KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
31
32# Set programmatically some variables during recipe parsing
33# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
34python __anonymous () {
35 kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
36 kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))
37 d.setVar("KERNEL_DEVICETREE", kerneldt)
38}
39
40do_kernel_configme_prepend() {
41 install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
42}
43
44do_install_prepend() {
45 install -d ${D}/lib/firmware
46}
47
48do_deploy_append() {
49 # Deploy cmdline.txt
50 install -d ${DEPLOYDIR}/bcm2835-bootfiles
51 PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
52 if [ ${PITFT} = "1" ]; then
53 PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
54 fi
55 echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
56}