Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | require linux-rpi.inc |
| 2 | inherit linux-raspberrypi-base |
| 3 | |
| 4 | DESCRIPTION = "Linux Kernel for Raspberry Pi" |
| 5 | SECTION = "kernel" |
| 6 | LICENSE = "GPLv2" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
| 8 | |
| 9 | SRC_URI += " \ |
| 10 | file://defconfig \ |
| 11 | " |
| 12 | |
| 13 | COMPATIBLE_MACHINE = "raspberrypi" |
| 14 | |
| 15 | PE = "1" |
| 16 | PV = "${LINUX_VERSION}+git${SRCPV}" |
| 17 | |
| 18 | # NOTE: For now we pull in the default config from the RPi kernel GIT tree. |
| 19 | KERNEL_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" |
| 20 | KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 21 | KERNEL_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 22 | |
| 23 | # CMDLINE for raspberrypi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 24 | CMDLINE ?= "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 25 | |
| 26 | # Add the kernel debugger over console kernel command line option if enabled |
| 27 | CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}' |
| 28 | |
| 29 | UDEV_GE_141 ?= "1" |
| 30 | |
| 31 | KERNEL_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 |
| 35 | python __anonymous () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 36 | kerneltype = d.getVar('KERNEL_IMAGETYPE') |
| 37 | kerneldt = get_dts(d, d.getVar('LINUX_VERSION')) |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 38 | d.setVar("KERNEL_DEVICETREE", kerneldt) |
| 39 | } |
| 40 | |
| 41 | do_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 | |
| 45 | do_install_prepend() { |
| 46 | install -d ${D}/lib/firmware |
| 47 | } |
| 48 | |
| 49 | do_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 | } |