From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- .../linux-firmware/linux-firmware_%.bbappend | 77 ++++++++++++ ...check-lxdiaglog.sh-Allow-specification-of.patch | 62 ++++++++++ .../recipes-kernel/linux/linux-raspberrypi-dev.bb | 22 ++++ .../recipes-kernel/linux/linux-raspberrypi.inc | 136 +++++++++++++++++++++ .../recipes-kernel/linux/linux-raspberrypi_4.14.bb | 9 ++ .../recipes-kernel/linux/linux-raspberrypi_4.9.bb | 11 ++ 6 files changed, 317 insertions(+) create mode 100644 meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend create mode 100644 meta-raspberrypi/recipes-kernel/linux/files/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch create mode 100644 meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb create mode 100644 meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc create mode 100644 meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb create mode 100644 meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb (limited to 'meta-raspberrypi/recipes-kernel') diff --git a/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend new file mode 100644 index 0000000000..34d2b67655 --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend @@ -0,0 +1,77 @@ +# Augments upstream linux-firmware with additional and updated images +# from Raspbian: +# https://github.com/RPi-Distro/firmware-nonfree +# https://github.com/RPi-Distro/bluez-firmware + +LICENSE_append_rpi = "\ + & Firmware-cypress \ +" + +LIC_FILES_CHKSUM_append_rpi = "\ + file://LICENCE.cypress;md5=cbc5f665d04f741f1e006d2096236ba7 \ +" +NO_GENERIC_LICENSE[Firmware-cypress] = "LICENCE.cypress" + +SRC_URI_append_rpi = " \ + git://github.com/RPi-Distro/firmware-nonfree;destsuffix=raspbian-nf;name=raspbian-nf \ + git://github.com/RPi-Distro/bluez-firmware;destsuffix=raspbian-bluez;name=raspbian-bluez \ +" + +SRCREV_raspbian-nf = "86e88fbf0345da49555d0ec34c80b4fbae7d0cd3" +SRCREV_raspbian-bluez = "e28cd7ee8615de33aa7ec2b41d556af61a4a2707" +SRCREV_FORMAT_rpi = "default+raspbian-nf+raspbian-bluez" + +do_install_append_rpi() { + install -d ${D}${nonarch_base_libdir}/firmware/brcm/ + + # Replace outdated linux-firmware files with updated ones from + # raspbian firmware-nonfree. Raspbian adds blobs and nvram + # definitions that are also necessary so copy those too. + for fw in brcmfmac43430-sdio brcmfmac43455-sdio ; do + install -m 0644 ${WORKDIR}/raspbian-nf/brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/ + done + + # Add missing Cypress Bluetooth files from raspbian bluez-firmware + for fw in BCM43430A1.hcd BCM4345C0.hcd ; do + install -m 0644 ${WORKDIR}/raspbian-bluez/broadcom/${fw} ${D}${nonarch_base_libdir}/firmware/brcm/ + done +} + +# NB: Must prepend, else these become empty and their content is left in +# the roll-up package which precedes them. +PACKAGES_prepend_rpi = "\ + ${PN}-bcm43455 \ + ${PN}-cypress-license \ + ${PN}-bcm43430a1-hcd \ + ${PN}-bcm4345c0-hcd \ +" + +# For additional Broadcom +LICENSE_${PN}-bcm43455 = "Firmware-broadcom_bcm43xx" + +FILES_${PN}-bcm43430_append_rpi = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \ +" +FILES_${PN}-bcm43455 = " \ + ${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.* \ +" + +RDEPENDS_${PN}-bcm43455 += "${PN}-broadcom-license" + +# For additional Cypress +FILES_${PN}-cypress-license = "\ + ${nonarch_base_libdir}/firmware/LICENCE.cypress \ +" + +LICENSE_${PN}-bcm43430a1-hcd = "Firmware-cypress" +LICENSE_${PN}-bcm4345c0-hcd = "Firmware-cypress" + +FILES_${PN}-bcm43430a1-hcd = " \ + ${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd \ +" +FILES_${PN}-bcm4345c0-hcd = " \ + ${nonarch_base_libdir}/firmware/brcm/BCM4345C0.hcd \ +" + +RDEPENDS_${PN}-bcm43430a1-hcd += "${PN}-cypress-license" +RDEPENDS_${PN}-bcm4345c0-hcd += "${PN}-cypress-license" diff --git a/meta-raspberrypi/recipes-kernel/linux/files/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch b/meta-raspberrypi/recipes-kernel/linux/files/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch new file mode 100644 index 0000000000..a9e9213b76 --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/files/0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch @@ -0,0 +1,62 @@ +From e6ebc8e654bba53f28af5229a1069fc74fa58b7b Mon Sep 17 00:00:00 2001 +From: Jason Wessel +Date: Thu, 25 Sep 2014 11:26:49 -0700 +Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses + location + +In some cross build environments such as the Yocto Project build +environment it provides an ncurses library that is compiled +differently than the host's version. This causes display corruption +problems when the host's curses includes are used instead of the +includes from the provided compiler are overridden. There is a second +case where there is no curses libraries at all on the host system and +menuconfig will just fail entirely. + +The solution is simply to allow an override variable in +check-lxdialog.sh for environments such as the Yocto Project. Adding +a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing +compiling and linking against the right headers and libraries. + +Upstream-Status: submitted [https://lkml.org/lkml/2013/3/3/103] + +Signed-off-by: Jason Wessel +cc: Michal Marek +cc: linux-kbuild@vger.kernel.org +Signed-off-by: Bruce Ashfield +Signed-off-by: California Sullivan +--- + scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + mode change 100755 => 100644 scripts/kconfig/lxdialog/check-lxdialog.sh + +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +old mode 100755 +new mode 100644 +index 5075ebf2d3b9..ba9242101190 +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -4,6 +4,10 @@ + # What library to link + ldflags() + { ++ if [ "$CROSS_CURSES_LIB" != "" ]; then ++ echo "$CROSS_CURSES_LIB" ++ exit ++ fi + pkg-config --libs ncursesw 2>/dev/null && exit + pkg-config --libs ncurses 2>/dev/null && exit + for ext in so a dll.a dylib ; do +@@ -21,6 +25,10 @@ ldflags() + # Where is ncurses.h? + ccflags() + { ++ if [ x"$CROSS_CURSES_INC" != x ]; then ++ echo "$CROSS_CURSES_INC" ++ exit ++ fi + if pkg-config --cflags ncursesw 2>/dev/null; then + echo '-DCURSES_LOC="" -DNCURSES_WIDECHAR=1' + elif pkg-config --cflags ncurses 2>/dev/null; then +-- +2.14.3 + diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb new file mode 100644 index 0000000000..4a7db1a4ea --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb @@ -0,0 +1,22 @@ +python __anonymous() { + if "linux-raspberrypi-dev" not in d.getVar("PREFERRED_PROVIDER_virtual/kernel"): + msg = "Skipping linux-raspberrypi-dev as it is not the preferred " + \ + "provider of virtual/kernel." + raise bb.parse.SkipRecipe(msg) +} + +FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:" + +LINUX_VERSION ?= "4.16" +LINUX_RPI_DEV_BRANCH ?= "rpi-4.16.y" + +SRCREV = "${AUTOREV}" +SRC_URI = " \ + git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_DEV_BRANCH} \ + file://0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch \ + " +require linux-raspberrypi.inc + +# Disable version check so that we don't have to edit this recipe every time +# upstream bumps the version +KERNEL_VERSION_SANITY_SKIP = "1" diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc new file mode 100644 index 0000000000..65c2ab7590 --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc @@ -0,0 +1,136 @@ +DESCRIPTION = "Linux Kernel for Raspberry Pi" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +COMPATIBLE_MACHINE = "^rpi$" + +PE = "1" +PV = "${LINUX_VERSION}+git${SRCPV}" + +inherit kernel siteinfo +require recipes-kernel/linux/linux-yocto.inc + +KCONFIG_MODE = "--alldefconfig" +KBUILD_DEFCONFIG_raspberrypi0-wifi ?= "bcmrpi_defconfig" +KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" +KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" +KBUILD_DEFCONFIG_raspberrypi3 ?= "bcm2709_defconfig" +KBUILD_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig" + +# CMDLINE for raspberrypi +SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}" +CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + +# Add the kernel debugger over console kernel command line option if enabled +CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}' + +# Disable rpi logo on boot +CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}' + +# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf +# to enable kernel debugging. +CMDLINE_DEBUG ?= "" +CMDLINE_append = " ${CMDLINE_DEBUG}" + +KERNEL_INITRAMFS ?= '${@oe.utils.conditional("INITRAMFS_IMAGE_BUNDLE", "1", "1", "", d)}' + +KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" + +# A LOADADDR is needed when building a uImage format kernel. This value is not +# set by default in rpi-4.8.y and later branches so we need to provide it +# manually. This value unused if KERNEL_IMAGETYPE is not uImage. +KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000" + +# Set a variable in .configure +# $1 - Configure variable to be set +# $2 - value [n/y/value] +kernel_configure_variable() { + # Remove the config + CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" + if test "$2" = "n" + then + echo "# CONFIG_$1 is not set" >> ${B}/.config + else + echo "CONFIG_$1=$2" >> ${B}/.config + fi +} + +config_setup() { + # From kernel.bbclass. Unfortunately, this is needed to support builds that + # use devtool. The reason is as follows: + # + # - In devtool builds, externalsrc.bbclass gets inherited and sets a list of + # SRCTREECOVEREDTASKS, which don't get run because they affect the source + # tree and, when using devtool, we want the developer's changes to be the + # single source of truth. kernel-yocto.bbclass adds do_kernel_configme to + # SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal + # non-devtool build, do_kernel_configme creates ${B}.config. + # + # - Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme + # doesn't run, because the first few lines of do_configure in kernel.bbclass + # populate ${B}.config from either ${S}.config (if it exists) for custom + # developer changes, or otherwise from ${WORDIR}/defconfig. + # + # - In linux-raspberrypi, we add do_configure_prepend, which tweaks + # ${B}.config. Since this runs *before* the kernel.bbclass do_configure, + # ${B}.config doesn't yet exist and we hit an error. Thus we need to move + # the logic from do_configure up to before our do_configure_prepend. Because + # we are copying only a portion of do_configure and not the whole thing, + # there is no clean way to do it using OE functionality, so we just + # copy-and-paste. + if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then + mv "${S}/.config" "${B}/.config" + fi + + # Copy defconfig to .config if .config does not exist. This allows + # recipes to manage the .config themselves in do_configure_prepend(). + if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then + cp "${WORKDIR}/defconfig" "${B}/.config" + fi +} + +do_configure_prepend() { + config_setup + + mv -f ${B}/.config ${B}/.config.patched + CONF_SED_SCRIPT="" + + # Localversion + kernel_configure_variable LOCALVERSION "\"\"" + + if [ ! -z "${KERNEL_INITRAMFS}" ]; then + kernel_configure_variable OVERLAY_FS y + kernel_configure_variable SQUASHFS y + kernel_configure_variable UBIFS_FS y + fi + + # Activate the configuration options for VC4 + VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" + if [ ${VC4GRAPHICS} = "1" ]; then + kernel_configure_variable I2C_BCM2835 y + kernel_configure_variable DRM y + kernel_configure_variable DRM_FBDEV_EMULATION y + kernel_configure_variable DRM_VC4 y + fi + + # Keep this the last line + # Remove all modified configs and add the rest to .config + sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config' + rm -f ${B}/.config.patched +} + +do_compile_append_raspberrypi3-64() { + cc_extra=$(get_cc_option) + oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} +} + +do_deploy_append() { + # Deploy cmdline.txt + install -d ${DEPLOYDIR}/bcm2835-bootfiles + PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + if [ ${PITFT} = "1" ]; then + PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" + fi + echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt +} diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb new file mode 100644 index 0000000000..0478576de5 --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb @@ -0,0 +1,9 @@ +LINUX_VERSION ?= "4.14.39" + +SRCREV = "865ddc1393f558198e7e7ce70928ff2e49c4f7f6" +SRC_URI = " \ + git://github.com/raspberrypi/linux.git;branch=rpi-4.14.y \ + file://0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch \ + " + +require linux-raspberrypi.inc diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb new file mode 100644 index 0000000000..21fcfef93d --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb @@ -0,0 +1,11 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +LINUX_VERSION ?= "4.9.80" + +SRCREV = "ffd7bf4085b09447e5db96edd74e524f118ca3fe" +SRC_URI = " \ + git://github.com/raspberrypi/linux.git;branch=rpi-4.9.y \ + file://0001-menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch \ + " + +require linux-raspberrypi.inc -- cgit v1.2.3