blob: 81ccc2cf8cbdb632ee08427f22fe2260ece1aa28 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Linux kernel firmware files from Raspbian distribution"
2DESCRIPTION = "Updated firmware files for RaspberryPi hardware. \
3RPi-Distro obtains these directly from Cypress; they are not submitted \
4to linux-firmware for general use."
5HOMEPAGE = "https://github.com/RPi-Distro/firmware-nonfree"
6SECTION = "kernel"
7
8# In maintained upstream linux-firmware:
Andrew Geissler595f6302022-01-24 19:11:47 +00009# * brcmfmac43430-sdio falls under LICENSE.cypress
10# * brcmfmac43455-sdio falls under LICENSE.broadcom_bcm43xx
11# * brcmfmac43456-sdio falls under LICENSE.broadcom_bcm43xx
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012#
Andrew Geissler595f6302022-01-24 19:11:47 +000013# It is likely[^1] that both of these should be under LICENSE.cypress.
14# Further, at this time the text of LICENSE.broadcom_bcm43xx is the same
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015# in linux-firmware and RPi-Distro/firmware-nonfree, but this may
16# change.
17#
18# Rather than make assumptions about what's supposed to be what, we'll
19# use the license implied by the source of these files, named to avoid
20# conflicts with linux-firmware.
21#
22# [^1]: https://github.com/RPi-Distro/bluez-firmware/issues/1
23LICENSE = "\
24 Firmware-broadcom_bcm43xx-rpidistro \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025"
26LIC_FILES_CHKSUM = "\
Andrew Geissler595f6302022-01-24 19:11:47 +000027 file://debian/config/brcm80211/LICENSE;md5=8cba1397cda6386db37210439a0da3eb \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028"
29
30# These are not common licenses, set NO_GENERIC_LICENSE for them
31# so that the license files will be copied from fetched source
Andrew Geissler595f6302022-01-24 19:11:47 +000032NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx-rpidistro] = "debian/config/brcm80211/LICENSE"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033
Andrew Geissler595f6302022-01-24 19:11:47 +000034SRC_URI = "git://github.com/RPi-Distro/firmware-nonfree;branch=bullseye;protocol=https"
Brad Bishopf76da502019-10-10 08:51:21 -040035
Patrick Williams03907ee2022-05-01 06:28:52 -050036SRCREV = "99d5c588e95ec9c9b86d7e88d3cf85b4f729d2bc"
37PV = "20210315-3+rpt4"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080038
39S = "${WORKDIR}/git"
40
41inherit allarch
42
43CLEANBROKEN = "1"
44
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045do_compile() {
46 :
47}
48
49do_install() {
Andrew Geissler595f6302022-01-24 19:11:47 +000050 install -d ${D}${nonarch_base_libdir}/firmware/brcm ${D}${nonarch_base_libdir}/firmware/cypress
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051
Andrew Geissler595f6302022-01-24 19:11:47 +000052 cp debian/config/brcm80211/LICENSE ${D}${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053
54 # Replace outdated linux-firmware files with updated ones from
55 # raspbian firmware-nonfree. Raspbian adds blobs and nvram
56 # definitions that are also necessary so copy those too.
Andrew Geissler595f6302022-01-24 19:11:47 +000057 for fw in brcmfmac43430-sdio brcmfmac43436-sdio brcmfmac43436s-sdio brcmfmac43455-sdio brcmfmac43456-sdio ; do
58 cp -R --no-dereference --preserve=mode,links -v debian/config/brcm80211/brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059 done
Andrew Geissler595f6302022-01-24 19:11:47 +000060 cp -R --no-dereference --preserve=mode,links -v debian/config/brcm80211/cypress/* ${D}${nonarch_base_libdir}/firmware/cypress/
Patrick Williams03907ee2022-05-01 06:28:52 -050061 rm ${D}${nonarch_base_libdir}/firmware/cypress/README.txt
Andrew Geissler5c4154f2020-10-16 10:13:56 -050062 # add compat links. Fixes errors like
Andrew Geissler595f6302022-01-24 19:11:47 +000063 # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-compute-module.txt failed with error -2
Patrick Williams0ca19cc2021-08-16 14:03:13 -050064 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
Andrew Geisslerd5838332022-05-27 11:33:10 -050065 # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin failed with error -2
66 ln -s brcmfmac43455-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080067}
68
69PACKAGES = "\
70 ${PN}-broadcom-license \
71 ${PN}-bcm43430 \
72 ${PN}-bcm43455 \
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060073 ${PN}-bcm43456 \
Andrew Geissler595f6302022-01-24 19:11:47 +000074 ${PN}-bcm43436 \
75 ${PN}-bcm43436s \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076"
77
Patrick Williams213cb262021-08-07 19:21:33 -050078LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
Andrew Geissler595f6302022-01-24 19:11:47 +000079LICENSE:${PN}-bcm43436 = "Firmware-broadcom_bcm43xx-rpidistro"
80LICENSE:${PN}-bcm43436s = "Firmware-broadcom_bcm43xx-rpidistro"
Patrick Williams213cb262021-08-07 19:21:33 -050081LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
82LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
83LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
Andrew Geissler595f6302022-01-24 19:11:47 +000084FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro"
Patrick Williams03907ee2022-05-01 06:28:52 -050085FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430* ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.bin ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.clm_blob"
Andrew Geissler595f6302022-01-24 19:11:47 +000086FILES:${PN}-bcm43436 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436-*"
87FILES:${PN}-bcm43436s = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436s*"
Patrick Williams03907ee2022-05-01 06:28:52 -050088FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455* ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio*"
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
90RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
Andrew Geissler595f6302022-01-24 19:11:47 +000091RDEPENDS:${PN}-bcm43436 += "${PN}-broadcom-license"
92RDEPENDS:${PN}-bcm43436s += "${PN}-broadcom-license"
Patrick Williams213cb262021-08-07 19:21:33 -050093RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
94RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
95RCONFLICTS:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080096 linux-firmware-bcm43430 \
97 linux-firmware-raspbian-bcm43430 \
98"
Andrew Geissler595f6302022-01-24 19:11:47 +000099
Patrick Williams213cb262021-08-07 19:21:33 -0500100RREPLACES:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800101 linux-firmware-bcm43430 \
102 linux-firmware-raspbian-bcm43430 \
103"
Andrew Geissler595f6302022-01-24 19:11:47 +0000104
105RCONFLICTS:${PN}-bcm43436 = "\
106 linux-firmware-bcm43436 \
107 linux-firmware-raspbian-bcm43436 \
108"
109
110RREPLACES:${PN}-bcm43436 = "\
111 linux-firmware-bcm43436 \
112 linux-firmware-raspbian-bcm43436 \
113"
114
115RCONFLICTS:${PN}-bcm43436s = "\
116 linux-firmware-bcm43436s \
117 linux-firmware-raspbian-bcm43436s \
118"
119
120RREPLACES:${PN}-bcm43436s = "\
121 linux-firmware-bcm43436s \
122 linux-firmware-raspbian-bcm43436s \
123"
124
Patrick Williams213cb262021-08-07 19:21:33 -0500125RCONFLICTS:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800126 linux-firmware-bcm43455 \
127 linux-firmware-raspbian-bcm43455 \
128"
Patrick Williams213cb262021-08-07 19:21:33 -0500129RREPLACES:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800130 linux-firmware-bcm43455 \
131 linux-firmware-raspbian-bcm43455 \
132"
Patrick Williams213cb262021-08-07 19:21:33 -0500133RCONFLICTS:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600134 linux-firmware-bcm43456 \
135 linux-firmware-raspbian-bcm43456 \
136"
Patrick Williams213cb262021-08-07 19:21:33 -0500137RREPLACES:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600138 linux-firmware-bcm43456 \
139 linux-firmware-raspbian-bcm43456 \
140"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800141
142# Firmware files are generally not run on the CPU, so they can be
143# allarch despite being architecture specific
144INSANE_SKIP = "arch"