blob: 95cd9c16474719e568798d758ad84ad8b3782b34 [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
Andrew Geissler595f6302022-01-24 19:11:47 +000036SRCREV = "b3eec612566ca08913f0830d299f4df70297428f"
37PV = "20210315-3+rpt3"
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/
Andrew Geissler5c4154f2020-10-16 10:13:56 -050061 # add compat links. Fixes errors like
Andrew Geissler595f6302022-01-24 19:11:47 +000062 # 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 -050063 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064}
65
66PACKAGES = "\
67 ${PN}-broadcom-license \
68 ${PN}-bcm43430 \
69 ${PN}-bcm43455 \
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060070 ${PN}-bcm43456 \
Andrew Geissler595f6302022-01-24 19:11:47 +000071 ${PN}-bcm43436 \
72 ${PN}-bcm43436s \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080073"
74
Patrick Williams213cb262021-08-07 19:21:33 -050075LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
Andrew Geissler595f6302022-01-24 19:11:47 +000076LICENSE:${PN}-bcm43436 = "Firmware-broadcom_bcm43xx-rpidistro"
77LICENSE:${PN}-bcm43436s = "Firmware-broadcom_bcm43xx-rpidistro"
Patrick Williams213cb262021-08-07 19:21:33 -050078LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
79LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
80LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
Andrew Geissler595f6302022-01-24 19:11:47 +000081FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro"
82FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430* ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.bin"
83FILES:${PN}-bcm43436 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436-*"
84FILES:${PN}-bcm43436s = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436s*"
85FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455* ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio.*"
Patrick Williams213cb262021-08-07 19:21:33 -050086FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
87RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
Andrew Geissler595f6302022-01-24 19:11:47 +000088RDEPENDS:${PN}-bcm43436 += "${PN}-broadcom-license"
89RDEPENDS:${PN}-bcm43436s += "${PN}-broadcom-license"
Patrick Williams213cb262021-08-07 19:21:33 -050090RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
91RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
92RCONFLICTS:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080093 linux-firmware-bcm43430 \
94 linux-firmware-raspbian-bcm43430 \
95"
Andrew Geissler595f6302022-01-24 19:11:47 +000096
Patrick Williams213cb262021-08-07 19:21:33 -050097RREPLACES:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080098 linux-firmware-bcm43430 \
99 linux-firmware-raspbian-bcm43430 \
100"
Andrew Geissler595f6302022-01-24 19:11:47 +0000101
102RCONFLICTS:${PN}-bcm43436 = "\
103 linux-firmware-bcm43436 \
104 linux-firmware-raspbian-bcm43436 \
105"
106
107RREPLACES:${PN}-bcm43436 = "\
108 linux-firmware-bcm43436 \
109 linux-firmware-raspbian-bcm43436 \
110"
111
112RCONFLICTS:${PN}-bcm43436s = "\
113 linux-firmware-bcm43436s \
114 linux-firmware-raspbian-bcm43436s \
115"
116
117RREPLACES:${PN}-bcm43436s = "\
118 linux-firmware-bcm43436s \
119 linux-firmware-raspbian-bcm43436s \
120"
121
Patrick Williams213cb262021-08-07 19:21:33 -0500122RCONFLICTS:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800123 linux-firmware-bcm43455 \
124 linux-firmware-raspbian-bcm43455 \
125"
Patrick Williams213cb262021-08-07 19:21:33 -0500126RREPLACES:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800127 linux-firmware-bcm43455 \
128 linux-firmware-raspbian-bcm43455 \
129"
Patrick Williams213cb262021-08-07 19:21:33 -0500130RCONFLICTS:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600131 linux-firmware-bcm43456 \
132 linux-firmware-raspbian-bcm43456 \
133"
Patrick Williams213cb262021-08-07 19:21:33 -0500134RREPLACES:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600135 linux-firmware-bcm43456 \
136 linux-firmware-raspbian-bcm43456 \
137"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800138
139# Firmware files are generally not run on the CPU, so they can be
140# allarch despite being architecture specific
141INSANE_SKIP = "arch"