diff options
| author | Peter A. Bigot <pab@pabigot.com> | 2018-11-13 14:44:21 -0600 |
|---|---|---|
| committer | Andrei Gherzan <andrei@gherzan.ro> | 2018-11-23 16:25:34 +0200 |
| commit | bfc35b773ff405394d066d7d8efb32ced3ac0410 (patch) | |
| tree | 504a7dfe9e97d06dcb71391a018281ba3f96cd34 | |
| parent | 10cee099bc6f1f805367e866598af6bf44e8f1b7 (diff) | |
| download | meta-raspberrypi-bfc35b773ff405394d066d7d8efb32ced3ac0410.tar.gz | |
linux-firmware: replace machine override with new recipes
Raspberry Pi hardware requires firmware that supersedes or is not
present in the standard linux-firmware distribution. These files are
maintained in the RPi-Distro project on github.
Several attempts have been made to reconcile conflicts between what's in
linux-firmware and what the hardware needs. The existing approach is
functional but not maintainable since it combines material from three
repositories into a single package that claims to be linux-firmware.
Remove the appends that change the content of linux-firmware for rpi
hardware. Add two new recipes that follow the RPi-Distro repositories:
* firmware-nonfree which forked from linux-firmware and replaces
content is provided as linux-firmware-rpidistro;
* bluez-firmware which forked from (very old) bluez and adds content is
provided as bluez-firmware-rpidistro.
The packages are named to make clear that these come from RPi-Distro,
rather than generic sources. Licensing attempts to record the state of
licensing as documented in RPi-Distro.
Resolves: #298
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
| -rw-r--r-- | conf/machine/raspberrypi0-wifi.conf | 4 | ||||
| -rw-r--r-- | conf/machine/raspberrypi3-64.conf | 8 | ||||
| -rw-r--r-- | conf/machine/raspberrypi3.conf | 8 | ||||
| -rw-r--r-- | recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_git.bb | 84 | ||||
| -rw-r--r-- | recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_git.bb | 96 | ||||
| -rw-r--r-- | recipes-kernel/linux-firmware/linux-firmware_%.bbappend | 69 |
6 files changed, 190 insertions, 79 deletions
diff --git a/conf/machine/raspberrypi0-wifi.conf b/conf/machine/raspberrypi0-wifi.conf index 7d7f1da..2c4f760 100644 --- a/conf/machine/raspberrypi0-wifi.conf +++ b/conf/machine/raspberrypi0-wifi.conf | |||
| @@ -7,8 +7,8 @@ require conf/machine/include/tune-arm1176jzf-s.inc | |||
| 7 | include conf/machine/include/rpi-base.inc | 7 | include conf/machine/include/rpi-base.inc |
| 8 | 8 | ||
| 9 | MACHINE_EXTRA_RRECOMMENDS += "\ | 9 | MACHINE_EXTRA_RRECOMMENDS += "\ |
| 10 | linux-firmware-bcm43430 \ | 10 | linux-firmware-rpidistro-bcm43430 \ |
| 11 | linux-firmware-bcm43430a1-hcd \ | 11 | bluez-firmware-rpidistro-bcm43430a1-hcd \ |
| 12 | " | 12 | " |
| 13 | 13 | ||
| 14 | SDIMG_KERNELIMAGE ?= "kernel.img" | 14 | SDIMG_KERNELIMAGE ?= "kernel.img" |
diff --git a/conf/machine/raspberrypi3-64.conf b/conf/machine/raspberrypi3-64.conf index 456373d..635e4f6 100644 --- a/conf/machine/raspberrypi3-64.conf +++ b/conf/machine/raspberrypi3-64.conf | |||
| @@ -5,10 +5,10 @@ | |||
| 5 | MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" | 5 | MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" |
| 6 | 6 | ||
| 7 | MACHINE_EXTRA_RRECOMMENDS += "\ | 7 | MACHINE_EXTRA_RRECOMMENDS += "\ |
| 8 | linux-firmware-bcm43430 \ | 8 | linux-firmware-rpidistro-bcm43430 \ |
| 9 | linux-firmware-bcm43455 \ | 9 | linux-firmware-rpidistro-bcm43455 \ |
| 10 | linux-firmware-bcm43430a1-hcd \ | 10 | bluez-firmware-rpidistro-bcm43430a1-hcd \ |
| 11 | linux-firmware-bcm4345c0-hcd \ | 11 | bluez-firmware-rpidistro-bcm4345c0-hcd \ |
| 12 | " | 12 | " |
| 13 | 13 | ||
| 14 | require conf/machine/include/arm/arch-armv8.inc | 14 | require conf/machine/include/arm/arch-armv8.inc |
diff --git a/conf/machine/raspberrypi3.conf b/conf/machine/raspberrypi3.conf index 4fcff18..df64cbb 100644 --- a/conf/machine/raspberrypi3.conf +++ b/conf/machine/raspberrypi3.conf | |||
| @@ -7,10 +7,10 @@ require conf/machine/include/tune-cortexa7.inc | |||
| 7 | include conf/machine/include/rpi-base.inc | 7 | include conf/machine/include/rpi-base.inc |
| 8 | 8 | ||
| 9 | MACHINE_EXTRA_RRECOMMENDS += "\ | 9 | MACHINE_EXTRA_RRECOMMENDS += "\ |
| 10 | linux-firmware-bcm43430 \ | 10 | linux-firmware-rpidistro-bcm43430 \ |
| 11 | linux-firmware-bcm43455 \ | 11 | linux-firmware-rpidistro-bcm43455 \ |
| 12 | linux-firmware-bcm43430a1-hcd \ | 12 | bluez-firmware-rpidistro-bcm43430a1-hcd \ |
| 13 | linux-firmware-bcm4345c0-hcd \ | 13 | bluez-firmware-rpidistro-bcm4345c0-hcd \ |
| 14 | " | 14 | " |
| 15 | 15 | ||
| 16 | SDIMG_KERNELIMAGE ?= "kernel7.img" | 16 | SDIMG_KERNELIMAGE ?= "kernel7.img" |
diff --git a/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_git.bb b/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_git.bb new file mode 100644 index 0000000..b16b2c1 --- /dev/null +++ b/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_git.bb | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | SUMMARY = "Linux kernel Bluetooth firmware files from Raspbian distribution" | ||
| 2 | DESCRIPTION = "Updated Bluetooth firmware files for RaspberryPi hardware. \ | ||
| 3 | RPi-Distro obtains these directly from Cypress; they are not submitted \ | ||
| 4 | to linux-firmware for general use." | ||
| 5 | HOMEPAGE = "https://github.com/RPi-Distro/bluez-firmware" | ||
| 6 | SECTION = "kernel" | ||
| 7 | |||
| 8 | # Upstream has provided[^1] licensing information in the Debian | ||
| 9 | # copyright file. The wording of the Cypress license subsequently | ||
| 10 | # changed in linux-firmware. | ||
| 11 | # | ||
| 12 | # Rather than make assumptions about what's supposed to be what, we'll | ||
| 13 | # use the license implied by the source of these files, named to avoid | ||
| 14 | # conflicts with linux-firmware. | ||
| 15 | # | ||
| 16 | # [^1]: https://github.com/RPi-Distro/bluez-firmware/issues/1 | ||
| 17 | LICENSE = "Firmware-cypress-rpidistro" | ||
| 18 | LIC_FILES_CHKSUM = "\ | ||
| 19 | file://LICENCE.cypress-rpidistro;md5=852f9d10cbedba1f6c439729bd0617b4 \ | ||
| 20 | " | ||
| 21 | |||
| 22 | # These are not common licenses, set NO_GENERIC_LICENSE for them | ||
| 23 | # so that the license files will be copied from fetched source | ||
| 24 | NO_GENERIC_LICENSE[Firmware-cypress-rpidistro] = "LICENCE.cypress-rpidistro" | ||
| 25 | |||
| 26 | SRC_URI = "git://github.com/RPi-Distro/bluez-firmware" | ||
| 27 | SRCREV = "ade2bae1aaaebede09abb8fb546f767a0e4c7804" | ||
| 28 | PV = "0.0+git${SRCPV}" | ||
| 29 | |||
| 30 | S = "${WORKDIR}/git" | ||
| 31 | |||
| 32 | inherit allarch | ||
| 33 | |||
| 34 | CLEANBROKEN = "1" | ||
| 35 | |||
| 36 | do_extract_lic() { | ||
| 37 | # Extract the license from the Debian copyright file | ||
| 38 | sed -e '1,23d' ${S}/debian/copyright > ${S}/LICENCE.cypress-rpidistro | ||
| 39 | } | ||
| 40 | # Must be before both do_install and do_populate_lic. Putting it before | ||
| 41 | # their common ancestor works; other approaches do not. | ||
| 42 | addtask extract_lic after do_unpack before do_patch | ||
| 43 | |||
| 44 | do_compile() { | ||
| 45 | : | ||
| 46 | } | ||
| 47 | |||
| 48 | do_install() { | ||
| 49 | install -d ${D}${nonarch_base_libdir}/firmware/brcm | ||
| 50 | |||
| 51 | cp LICENCE.cypress-rpidistro ${D}${nonarch_base_libdir}/firmware | ||
| 52 | install -m 0644 broadcom/BCM434*.hcd ${D}${nonarch_base_libdir}/firmware/brcm/ | ||
| 53 | } | ||
| 54 | |||
| 55 | PACKAGES = "\ | ||
| 56 | ${PN}-cypress-license \ | ||
| 57 | ${PN}-bcm43430a1-hcd \ | ||
| 58 | ${PN}-bcm4345c0-hcd \ | ||
| 59 | " | ||
| 60 | |||
| 61 | LICENSE_${PN}-bcm43430a1-hcd = "Firmware-cypress-rpidistro" | ||
| 62 | LICENSE_${PN}-bcm4345c0-hcd = "Firmware-cypress-rpidistro" | ||
| 63 | LICENSE_${PN}-cypress-license = "Firmware-cypress-rpidistro" | ||
| 64 | |||
| 65 | FILES_${PN}-cypress-license = "\ | ||
| 66 | ${nonarch_base_libdir}/firmware/LICENCE.cypress-rpidistro \ | ||
| 67 | " | ||
| 68 | FILES_${PN}-bcm43430a1-hcd = "\ | ||
| 69 | ${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd \ | ||
| 70 | " | ||
| 71 | FILES_${PN}-bcm4345c0-hcd = "\ | ||
| 72 | ${nonarch_base_libdir}/firmware/brcm/BCM4345C0.hcd \ | ||
| 73 | " | ||
| 74 | |||
| 75 | RDEPENDS_${PN}-bcm43430a1-hcd += "${PN}-cypress-license" | ||
| 76 | RDEPENDS_${PN}-bcm4345c0-hcd += "${PN}-cypress-license" | ||
| 77 | RCONFLICTS_${PN}-bcm43430a1-hcd = "linux-firmware-bcm43430a1-hcd" | ||
| 78 | RREPLACES_${PN}-bcm43430a1-hcd = "linux-firmware-bcm43430a1-hcd" | ||
| 79 | RCONFLICTS_${PN}-bcm43435c0-hcd = "linux-firmware-bcm4345c0-hcd" | ||
| 80 | RREPLACES_${PN}-bcm43435c0-hcd = "linux-firmware-bcm4345c0-hcd" | ||
| 81 | |||
| 82 | # Firmware files are generally not run on the CPU, so they can be | ||
| 83 | # allarch despite being architecture specific | ||
| 84 | INSANE_SKIP = "arch" | ||
diff --git a/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_git.bb b/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_git.bb new file mode 100644 index 0000000..1f63c32 --- /dev/null +++ b/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_git.bb | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | SUMMARY = "Linux kernel firmware files from Raspbian distribution" | ||
| 2 | DESCRIPTION = "Updated firmware files for RaspberryPi hardware. \ | ||
| 3 | RPi-Distro obtains these directly from Cypress; they are not submitted \ | ||
| 4 | to linux-firmware for general use." | ||
| 5 | HOMEPAGE = "https://github.com/RPi-Distro/firmware-nonfree" | ||
| 6 | SECTION = "kernel" | ||
| 7 | |||
| 8 | # In maintained upstream linux-firmware: | ||
| 9 | # * brcmfmac43430-sdio falls under LICENCE.cypress | ||
| 10 | # * brcmfmac43455-sdio falls under LICENCE.broadcom_bcm43xx | ||
| 11 | # | ||
| 12 | # It is likely[^1] that both of these should be under LICENCE.cypress. | ||
| 13 | # Further, at this time the text of LICENCE.broadcom_bcm43xx is the same | ||
| 14 | # in linux-firmware and RPi-Distro/firmware-nonfree, but this may | ||
| 15 | # change. | ||
| 16 | # | ||
| 17 | # Rather than make assumptions about what's supposed to be what, we'll | ||
| 18 | # use the license implied by the source of these files, named to avoid | ||
| 19 | # conflicts with linux-firmware. | ||
| 20 | # | ||
| 21 | # [^1]: https://github.com/RPi-Distro/bluez-firmware/issues/1 | ||
| 22 | LICENSE = "\ | ||
| 23 | Firmware-broadcom_bcm43xx-rpidistro \ | ||
| 24 | & WHENCE \ | ||
| 25 | " | ||
| 26 | LIC_FILES_CHKSUM = "\ | ||
| 27 | file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \ | ||
| 28 | file://WHENCE;md5=a9c2c217f513c20e1d16b384b3e2c12d \ | ||
| 29 | " | ||
| 30 | |||
| 31 | # These are not common licenses, set NO_GENERIC_LICENSE for them | ||
| 32 | # so that the license files will be copied from fetched source | ||
| 33 | NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx-rpidistro] = "LICENCE.broadcom_bcm43xx" | ||
| 34 | NO_GENERIC_LICENSE[WHENCE] = "WHENCE" | ||
| 35 | |||
| 36 | SRC_URI = "git://github.com/RPi-Distro/firmware-nonfree" | ||
| 37 | SRCREV = "b518de45ced519e8f7a499f4778100173402ae43" | ||
| 38 | PV = "0.0+git${SRCPV}" | ||
| 39 | |||
| 40 | S = "${WORKDIR}/git" | ||
| 41 | |||
| 42 | inherit allarch | ||
| 43 | |||
| 44 | CLEANBROKEN = "1" | ||
| 45 | |||
| 46 | do_compile() { | ||
| 47 | : | ||
| 48 | } | ||
| 49 | |||
| 50 | do_install() { | ||
| 51 | install -d ${D}${nonarch_base_libdir}/firmware/brcm | ||
| 52 | |||
| 53 | cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro | ||
| 54 | |||
| 55 | # Replace outdated linux-firmware files with updated ones from | ||
| 56 | # raspbian firmware-nonfree. Raspbian adds blobs and nvram | ||
| 57 | # definitions that are also necessary so copy those too. | ||
| 58 | for fw in brcmfmac43430-sdio brcmfmac43455-sdio ; do | ||
| 59 | install -m 0644 brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/ | ||
| 60 | done | ||
| 61 | } | ||
| 62 | |||
| 63 | PACKAGES = "\ | ||
| 64 | ${PN}-broadcom-license \ | ||
| 65 | ${PN}-bcm43430 \ | ||
| 66 | ${PN}-bcm43455 \ | ||
| 67 | " | ||
| 68 | |||
| 69 | LICENSE_${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro" | ||
| 70 | LICENSE_${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro" | ||
| 71 | LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro" | ||
| 72 | FILES_${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro" | ||
| 73 | FILES_${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430*" | ||
| 74 | FILES_${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455*" | ||
| 75 | RDEPENDS_${PN}-bcm43430 += "${PN}-broadcom-license" | ||
| 76 | RDEPENDS_${PN}-bcm43455 += "${PN}-broadcom-license" | ||
| 77 | RCONFLICTS_${PN}-bcm43430 = "\ | ||
| 78 | linux-firmware-bcm43430 \ | ||
| 79 | linux-firmware-raspbian-bcm43430 \ | ||
| 80 | " | ||
| 81 | RREPLACES_${PN}-bcm43430 = "\ | ||
| 82 | linux-firmware-bcm43430 \ | ||
| 83 | linux-firmware-raspbian-bcm43430 \ | ||
| 84 | " | ||
| 85 | RCONFLICTS_${PN}-bcm43455 = "\ | ||
| 86 | linux-firmware-bcm43455 \ | ||
| 87 | linux-firmware-raspbian-bcm43455 \ | ||
| 88 | " | ||
| 89 | RREPLACES_${PN}-bcm43455 = "\ | ||
| 90 | linux-firmware-bcm43455 \ | ||
| 91 | linux-firmware-raspbian-bcm43455 \ | ||
| 92 | " | ||
| 93 | |||
| 94 | # Firmware files are generally not run on the CPU, so they can be | ||
| 95 | # allarch despite being architecture specific | ||
| 96 | INSANE_SKIP = "arch" | ||
diff --git a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend deleted file mode 100644 index 4443736..0000000 --- a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | # Augments upstream linux-firmware with additional and updated images | ||
| 2 | # from Raspbian: | ||
| 3 | # https://github.com/RPi-Distro/firmware-nonfree | ||
| 4 | # https://github.com/RPi-Distro/bluez-firmware | ||
| 5 | |||
| 6 | SRC_URI_append_rpi = " \ | ||
| 7 | git://github.com/RPi-Distro/firmware-nonfree;destsuffix=raspbian-nf;name=raspbian-nf \ | ||
| 8 | git://github.com/RPi-Distro/bluez-firmware;destsuffix=raspbian-bluez;name=raspbian-bluez \ | ||
| 9 | " | ||
| 10 | |||
| 11 | SRCREV_raspbian-nf = "b518de45ced519e8f7a499f4778100173402ae43" | ||
| 12 | SRCREV_raspbian-bluez = "ade2bae1aaaebede09abb8fb546f767a0e4c7804" | ||
| 13 | SRCREV_FORMAT_rpi = "default+raspbian-nf+raspbian-bluez" | ||
| 14 | |||
| 15 | do_install_append_rpi() { | ||
| 16 | install -d ${D}${nonarch_base_libdir}/firmware/brcm/ | ||
| 17 | |||
| 18 | # Replace outdated linux-firmware files with updated ones from | ||
| 19 | # raspbian firmware-nonfree. Raspbian adds blobs and nvram | ||
| 20 | # definitions that are also necessary so copy those too. | ||
| 21 | for fw in brcmfmac43430-sdio brcmfmac43455-sdio ; do | ||
| 22 | install -m 0644 ${WORKDIR}/raspbian-nf/brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/ | ||
| 23 | done | ||
| 24 | |||
| 25 | # Add missing Cypress Bluetooth files from raspbian bluez-firmware | ||
| 26 | for fw in BCM43430A1.hcd BCM4345C0.hcd ; do | ||
| 27 | install -m 0644 ${WORKDIR}/raspbian-bluez/broadcom/${fw} ${D}${nonarch_base_libdir}/firmware/brcm/ | ||
| 28 | done | ||
| 29 | } | ||
| 30 | |||
| 31 | # NB: Must prepend, else these become empty and their content is left in | ||
| 32 | # the roll-up package which precedes them. | ||
| 33 | PACKAGES_prepend_rpi = "\ | ||
| 34 | ${PN}-bcm43430a1-hcd \ | ||
| 35 | ${PN}-bcm4345c0-hcd \ | ||
| 36 | " | ||
| 37 | |||
| 38 | # ${PN}-bcm43455 package and brcmfmac43455-sdio from linux-firmware | ||
| 39 | # is already included in the oe-core recipe, so don't add it to PACKAGES | ||
| 40 | # again, the version from raspbian-nf seems a bit newer: | ||
| 41 | # $ strings ./1_0.0+gitAUTOINC+d114732723+86e88fbf03+e28cd7ee86-r0/git/brcm/brcmfmac43455-sdio.bin | grep Ver | ||
| 42 | # Version: 7.45.18.0 CRC: d7226371 Date: Sun 2015-03-01 07:31:57 PST Ucode Ver: 1026.2 FWID: 01-6a2c8ad4 | ||
| 43 | # $ strings ./1_0.0+gitAUTOINC+d114732723+86e88fbf03+e28cd7ee86-r0/raspbian-nf/brcm/brcmfmac43455-sdio.bin | grep Ver | ||
| 44 | # Version: 7.45.154 (r684107 CY) CRC: b1f79383 Date: Tue 2018-02-27 03:18:17 PST Ucode Ver: 1043.2105 FWID 01-4fbe0b04 | ||
| 45 | |||
| 46 | # For additional Broadcom | ||
| 47 | LICENSE_${PN}-bcm43455 = "Firmware-broadcom_bcm43xx" | ||
| 48 | |||
| 49 | FILES_${PN}-bcm43430_append_rpi = " \ | ||
| 50 | ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \ | ||
| 51 | " | ||
| 52 | FILES_${PN}-bcm43455 = " \ | ||
| 53 | ${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.* \ | ||
| 54 | " | ||
| 55 | |||
| 56 | RDEPENDS_${PN}-bcm43455 += "${PN}-broadcom-license" | ||
| 57 | |||
| 58 | LICENSE_${PN}-bcm43430a1-hcd = "Firmware-cypress" | ||
| 59 | LICENSE_${PN}-bcm4345c0-hcd = "Firmware-cypress" | ||
| 60 | |||
| 61 | FILES_${PN}-bcm43430a1-hcd = " \ | ||
| 62 | ${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd \ | ||
| 63 | " | ||
| 64 | FILES_${PN}-bcm4345c0-hcd = " \ | ||
| 65 | ${nonarch_base_libdir}/firmware/brcm/BCM4345C0.hcd \ | ||
| 66 | " | ||
| 67 | |||
| 68 | RDEPENDS_${PN}-bcm43430a1-hcd += "${PN}-cypress-license" | ||
| 69 | RDEPENDS_${PN}-bcm4345c0-hcd += "${PN}-cypress-license" | ||
