From f3ecec38aa8ae4137b1a0e11b925d0e736e8ffda Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Thu, 10 May 2018 19:33:45 -0500 Subject: [PATCH] linux-firmware: restore and merge bluez-firmware The attempt to Raspbian updated firmware blobs in packages separate from linux-firmware introduced unresolvable conflicts with the standard linux-firmware roll-up package. Revert to using an augmented linux-firmware recipe that overrides and adds firmware from two Raspbian repositories that have up-to-date images. Closes #244 Signed-off-by: Peter A. Bigot --- conf/machine/raspberrypi0-wifi.conf | 5 +- conf/machine/raspberrypi3-64.conf | 7 +- conf/machine/raspberrypi3.conf | 7 +- docs/layer-contents.md | 16 +- .../bluez-firmware/bluez-firmware-raspbian.bb | 43 ------ .../bluez-firmware/files/LICENCE.cypress | 139 ------------------ recipes-connectivity/bluez5/bluez5_%.bbappend | 1 - .../linux-firmware/linux-firmware-raspbian.bb | 55 ------- .../linux-firmware/linux-firmware_%.bbappend | 77 ++++++++++ 9 files changed, 101 insertions(+), 249 deletions(-) delete mode 100644 recipes-connectivity/bluez-firmware/bluez-firmware-raspbian.bb delete mode 100644 recipes-connectivity/bluez-firmware/files/LICENCE.cypress delete mode 100644 recipes-kernel/linux-firmware/linux-firmware-raspbian.bb create mode 100644 recipes-kernel/linux-firmware/linux-firmware_%.bbappend diff --git a/conf/machine/raspberrypi0-wifi.conf b/conf/machine/raspberrypi0-wifi.conf index 590c669..accdf3c 100644 --- a/conf/machine/raspberrypi0-wifi.conf +++ b/conf/machine/raspberrypi0-wifi.conf @@ -6,7 +6,10 @@ DEFAULTTUNE ?= "arm1176jzfshf" require conf/machine/include/tune-arm1176jzf-s.inc include conf/machine/include/rpi-base.inc -MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-raspbian-bcm43430" +MACHINE_EXTRA_RRECOMMENDS += "\ + linux-firmware-bcm43430 \ + linux-firmware-bcm43430a1-hcd \ +" SDIMG_KERNELIMAGE ?= "kernel.img" UBOOT_MACHINE ?= "rpi_0_w_defconfig" diff --git a/conf/machine/raspberrypi3-64.conf b/conf/machine/raspberrypi3-64.conf index 3e7aade..4a5a494 100644 --- a/conf/machine/raspberrypi3-64.conf +++ b/conf/machine/raspberrypi3-64.conf @@ -4,7 +4,12 @@ MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" -MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-raspbian-bcm43430 linux-firmware-raspbian-bcm43455" +MACHINE_EXTRA_RRECOMMENDS += "\ + linux-firmware-bcm43430 \ + linux-firmware-bcm43455 \ + linux-firmware-bcm43430a1-hcd \ + linux-firmware-bcm4345c0-hcd \ +" require conf/machine/include/arm/arch-armv8.inc include conf/machine/include/rpi-base.inc diff --git a/conf/machine/raspberrypi3.conf b/conf/machine/raspberrypi3.conf index 61c60e6..8b5cce5 100644 --- a/conf/machine/raspberrypi3.conf +++ b/conf/machine/raspberrypi3.conf @@ -6,7 +6,12 @@ DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4" require conf/machine/include/tune-cortexa7.inc include conf/machine/include/rpi-base.inc -MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-raspbian-bcm43430 linux-firmware-raspbian-bcm43455" +MACHINE_EXTRA_RRECOMMENDS += "\ + linux-firmware-bcm43430 \ + linux-firmware-bcm43455 \ + linux-firmware-bcm43430a1-hcd \ + linux-firmware-bcm4345c0-hcd \ +" SDIMG_KERNELIMAGE ?= "kernel7.img" UBOOT_MACHINE = "rpi_3_32b_config" diff --git a/docs/layer-contents.md b/docs/layer-contents.md index 0ba60f5..f71d396 100644 --- a/docs/layer-contents.md +++ b/docs/layer-contents.md @@ -23,12 +23,12 @@ For other uses it's recommended to base images on `core-image-minimal` or `core-image-base` as appropriate. The old image names (`rpi-hwup-image` and `rpi-basic-image`) are deprecated. -## WiFi firmware blobs +## WiFi and Bluetooth Firmware -Be aware that the WiFi firmwares for the supported boards are not provided by -`linux-firmware` but by a custom recipe which only packages the needed blobs -for these boards. This is because the upstream `linux-firmware` doesn't support -or has outdated files for the blobs we need. The recipe -`linux-firmware-raspbian` is based on a fork of `linux-firmware` which -includes everything we need in order to fully support the WiFi hardware. All -machines define `MACHINE_EXTRA_RRECOMMENDS` accordingly. +Be aware that the WiFi and Bluetooth firmware for the supported boards +is not available in the base version of `linux-firmware` from OE-Core +(poky). The files are added from Raspbian repositories in this layer's +bbappends to that recipe. All machines define +`MACHINE_EXTRA_RRECOMMENDS` to include the required wireless firmware; +raspberrypi3 supports 3, 3B, and 3B+ and so include multiple firmware +packages. diff --git a/recipes-connectivity/bluez-firmware/bluez-firmware-raspbian.bb b/recipes-connectivity/bluez-firmware/bluez-firmware-raspbian.bb deleted file mode 100644 index df4e570..0000000 --- a/recipes-connectivity/bluez-firmware/bluez-firmware-raspbian.bb +++ /dev/null @@ -1,43 +0,0 @@ -SUMMARY = "Firmware files for Bluetooth support for Raspberry Pi" -HOMEPAGE = "https://github.com/RPi-Distro/bluez-firmware" -SECTION = "kernel" -LICENSE = "cypress-wireless" -NO_GENERIC_LICENSE[cypress-wireless] = "LICENCE.cypress" -LIC_FILES_CHKSUM = "\ - file://LICENCE.cypress;md5=cbc5f665d04f741f1e006d2096236ba7 \ - file://debian/copyright;md5=1c734a245a410aa1f9eebcb2e9b62105 \ -" - -SRC_URI = "\ - git://github.com/RPi-Distro/bluez-firmware \ - file://LICENCE.cypress \ -" -SRCREV = "e28cd7ee8615de33aa7ec2b41d556af61a4a2707" -UPSTREAM_VERSION_UNKNOWN = "1" - -S = "${WORKDIR}/git" - -inherit allarch - -python do_populate_lic_prepend() { - # Put the license into the source where license.bbclass wants it - import shutil - workdir = d.getVar('WORKDIR') - srcdir = d.getVar('S') - shutil.copy(os.path.join(workdir, 'LICENCE.cypress'), srcdir) -} - -do_install() { - install -d ${D}${nonarch_base_libdir}/firmware/brcm/ - install -m 0644 ${S}/broadcom/BCM4345C0.hcd ${D}${nonarch_base_libdir}/firmware/brcm - install -m 0644 ${S}/broadcom/BCM43430A1.hcd ${D}${nonarch_base_libdir}/firmware/brcm - install -m 0644 ${WORKDIR}/LICENCE.cypress ${D}${nonarch_base_libdir}/firmware -} - -FILES_${PN} = "\ - ${nonarch_base_libdir}/firmware \ -" - -# Firmware files are generally not ran on the CPU, so they can be -# allarch despite being architecture specific -INSANE_SKIP = "arch" diff --git a/recipes-connectivity/bluez-firmware/files/LICENCE.cypress b/recipes-connectivity/bluez-firmware/files/LICENCE.cypress deleted file mode 100644 index b320f27..0000000 --- a/recipes-connectivity/bluez-firmware/files/LICENCE.cypress +++ /dev/null @@ -1,139 +0,0 @@ -### CYPRESS WIRELESS CONNECTIVITY DEVICES -### DRIVER END USER LICENSE AGREEMENT (SOURCE AND BINARY DISTRIBUTION) - -PLEASE READ THIS END USER LICENSE AGREEMENT ("Agreement") CAREFULLY BEFORE -DOWNLOADING, INSTALLING, OR USING THIS SOFTWARE, ANY ACCOMPANYING -DOCUMENTATION, OR ANY UPDATES PROVIDED BY CYPRESS ("Software"). BY -DOWNLOADING, INSTALLING, OR USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND -BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS -AGREEMENT, PROMPTLY RETURN AND DO NOT USE THE SOFTWARE. IF YOU HAVE -PURCHASED THE SOFTWARE, YOUR RIGHT TO RETURN THE SOFTWARE EXPIRES 30 DAYS -AFTER YOUR PURCHASE AND APPLIES ONLY TO THE ORIGINAL PURCHASER. - -Software Provided in Binary Code Form. This paragraph applies to any Software -provided in binary code form. Subject to the terms and conditions of this -Agreement, Cypress Semiconductor Corporation ("Cypress") grants you a -non-exclusive, non-transferable license under its copyright rights in the -Software to reproduce and distribute the Software in object code form only, -solely for use in connection with Cypress integrated circuit products -("Purpose"). - -Software Provided in Source Code Form. This paragraph applies to any Software -provided in source code form ("Cypress Source Code"). Subject to the terms and -conditions of this Agreement, Cypress grants you a non-exclusive, -non-transferable license under its copyright rights in the Cypress Source Code -to reproduce, modify, compile, and distribute the Cypress Source Code (whether -in source code form or as compiled into binary code form) solely for the -Purpose. Cypress retains ownership of the Cypress Source Code and any compiled -version thereof. Subject to Cypress' ownership of the underlying Cypress -Source Code, you retain ownership of any modifications you make to the -Cypress Source Code. You agree not to remove any Cypress copyright or other -notices from the Cypress Source Code and any modifications thereof. Any -reproduction, modification, translation, compilation, or representation of -the Cypress Source Code except as permitted in this paragraph is prohibited -without the express written permission of Cypress. - -Free and Open Source Software. Portions of the Software may be licensed under -free and/or open source licenses such as the GNU General Public License -("FOSS"). FOSS is subject to the applicable license agreement and not this -Agreement. If you are entitled to receive the source code from Cypress for any -FOSS included with the Software, either the source code will be included with -the Software or you may obtain the source code at no charge from -. The applicable license terms will -accompany each source code package. To review the license terms applicable to -any FOSS for which Cypress is not required to provide you with source code, -please see the Software's installation directory on your computer. - -Proprietary Rights. The Software, including all intellectual property rights -therein, is and will remain the sole and exclusive property of Cypress or its -suppliers. Except as otherwise expressly provided in this Agreement, you may -not: (i) modify, adapt, or create derivative works based upon the Software; -(ii) copy the Software; (iii) except and only to the extent explicitly -permitted by applicable law despite this limitation, decompile, translate, -reverse engineer, disassemble or otherwise reduce the Software to -human-readable form; or (iv) use the Software other than for the Purpose. - -No Support. Cypress may, but is not required to, provide technical support for -the Software. - -Term and Termination. This Agreement is effective until terminated, and either -party may terminate this Agreement at any time with or without cause. Your -license rights under this Agreement will terminate immediately without notice -from Cypress if you fail to comply with any provision of this Agreement. Upon -termination, you must destroy all copies of Software in your possession or -control. Termination of this Agreement will not affect any licenses validly -granted as of the termination date to any end users of the Software. The -following paragraphs shall survive any termination of this Agreement: "Free and -Open Source Software," "Proprietary Rights," "Compliance With Law," -"Disclaimer," "Limitation of Liability," and "General." - -Compliance With Law. Each party agrees to comply with all applicable laws, -rules and regulations in connection with its activities under this Agreement. -Without limiting the foregoing, the Software may be subject to export control -laws and regulations of the United States and other countries. You agree to -comply strictly with all such laws and regulations and acknowledge that you -have the responsibility to obtain licenses to export, re-export, or import -the Software. - -Disclaimer. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES -NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THE SOFTWARE, -INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the -right to make changes to the Software without notice. Cypress does not assume -any liability arising out of the application or use of Software or any -product or circuit described in the Software. Cypress does not authorize its -products for use as critical components in life-support systems where a -malfunction or failure may reasonably be expected to result in significant -injury to the user. The inclusion of Cypress' product in a life-support -system or application implies that the manufacturer of such system or -application assumes all risk of such use and in doing so indemnifies Cypress -against all charges. - -Limitation of Liability. IN NO EVENT WILL CYPRESS OR ITS SUPPLIERS, -RESELLERS, OR DISTRIBUTORS BE LIABLE FOR ANY LOST REVENUE, PROFIT, OR DATA, -OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES -HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE -USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF CYPRESS OR ITS SUPPLIERS, -RESELLERS, OR DISTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. IN NO EVENT SHALL CYPRESS' OR ITS SUPPLIERS' RESELLERS', OR -DISTRIBUTORS' TOTAL LIABILITY TO YOU, WHETHER IN CONTRACT, TORT (INCLUDING -NEGLIGENCE), OR OTHERWISE, EXCEED THE PRICE PAID BY YOU FOR THE SOFTWARE. -THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF THE ABOVE-STATED WARRANTY FAILS -OF ITS ESSENTIAL PURPOSE. BECAUSE SOME STATES OR JURISDICTIONS DO NOT ALLOW -LIMITATION OR EXCLUSION OF CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE -LIMITATION MAY NOT APPLY TO YOU. - -Restricted Rights. The Software under this Agreement is commercial computer -software as that term is described in 48 C.F.R. 252.227-7014(a)(1). If -acquired by or on behalf of a civilian agency, the U.S. Government acquires -this commercial computer software and/or commercial computer software -documentation subject to the terms of this Agreement as specified in 48 -C.F.R. 12.212 (Computer Software) and 12.211 (Technical Data) of the Federal -Acquisition Regulations ("FAR") and its successors. If acquired by or on -behalf of any agency within the Department of Defense ("DOD"), the U.S. -Government acquires this commercial computer software and/or commercial -computer software documentation subject to the terms of this Agreement as -specified in 48 C.F.R. 227.7202-3 of the DOD FAR Supplement ("DFAR") and its -successors. - -General. This Agreement will bind and inure to the benefit of each party's -successors and assigns, provided that you may not assign or transfer this -Agreement, in whole or in part, without Cypress' written consent. This -Agreement shall be governed by and construed in accordance with the laws of -the State of California, United States of America, as if performed wholly -within the state and without giving effect to the principles of conflict of -law. The parties consent to personal and exclusive jurisdiction of and venue -in, the state and federal courts within Santa Clara County, California; -provided however, that nothing in this Agreement will limit Cypress' right to -bring legal action in any venue in order to protect or enforce its -intellectual property rights. No failure of either party to exercise or -enforce any of its rights under this Agreement will act as a waiver of such -rights. If any portion hereof is found to be void or unenforceable, the -remaining provisions of this Agreement shall remain in full force and -effect. This Agreement is the complete and exclusive agreement between the -parties with respect to the subject matter hereof, superseding and replacing -any and all prior agreements, communications, and understandings (both -written and oral) regarding such subject matter. Any notice to Cypress will -be deemed effective when actually received and must be sent to Cypress -Semiconductor Corporation, ATTN: Chief Legal Officer, 198 Champion Court, San -Jose, CA 95134 USA. diff --git a/recipes-connectivity/bluez5/bluez5_%.bbappend b/recipes-connectivity/bluez5/bluez5_%.bbappend index c75f4b6..d1b84df 100644 --- a/recipes-connectivity/bluez5/bluez5_%.bbappend +++ b/recipes-connectivity/bluez5/bluez5_%.bbappend @@ -19,7 +19,6 @@ enable_bcm_bluetooth() { BCM_BT_RDEPENDS = "\ udev-rules-rpi \ - bluez-firmware-raspbian \ pi-bluetooth \ " diff --git a/recipes-kernel/linux-firmware/linux-firmware-raspbian.bb b/recipes-kernel/linux-firmware/linux-firmware-raspbian.bb deleted file mode 100644 index d11a53b..0000000 --- a/recipes-kernel/linux-firmware/linux-firmware-raspbian.bb +++ /dev/null @@ -1,55 +0,0 @@ -SUMMARY = "Firmware files for use with Linux kernel" -SECTION = "kernel" - -LICENSE = "Firmware-broadcom_bcm43xx" - -LIC_FILES_CHKSUM = "file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc" - -INHIBIT_DEFAULT_DEPS = "1" - -# These are not common licenses, set NO_GENERIC_LICENSE for them -# so that the license files will be copied from fetched source -NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx] = "LICENCE.broadcom_bcm43xx" - -SRCREV = "86e88fbf0345da49555d0ec34c80b4fbae7d0cd3" -PV = "0.0+git${SRCPV}" - -SRC_URI = "git://github.com/RPi-Distro/firmware-nonfree" - -UPSTREAM_VERSION_UNKNOWN = "1" - -S = "${WORKDIR}/git" - -inherit allarch - -CLEANBROKEN = "1" - -do_compile() { - : -} - -do_install() { - install -d ${D}${nonarch_base_libdir}/firmware/brcm - cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware - cp -r ./brcm/brcmfmac43430* ${D}${nonarch_base_libdir}/firmware/brcm - cp -r ./brcm/brcmfmac43455* ${D}${nonarch_base_libdir}/firmware/brcm -} - -PACKAGES = " \ - ${PN}-broadcom-license \ - ${PN}-bcm43430 \ - ${PN}-bcm43455 \ - " - -LICENSE_${PN}-bcm43430 = "Firmware-broadcom_bcm43xx" -LICENSE_${PN}-bcm43455 = "Firmware-broadcom_bcm43xx" -LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx" -FILES_${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx" -FILES_${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430*" -FILES_${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455*" -RDEPENDS_${PN}-bcm43430 += "${PN}-broadcom-license" -RDEPENDS_${PN}-bcm43455 += "${PN}-broadcom-license" - -# Firmware files are generally not ran on the CPU, so they can be -# allarch despite being architecture specific -INSANE_SKIP = "arch" diff --git a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend new file mode 100644 index 0000000..34d2b67 --- /dev/null +++ b/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"