blob: 37e2e570935baa62af250c7830c40ab1dc0126a7 [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:
9# * brcmfmac43430-sdio falls under LICENCE.cypress
10# * brcmfmac43455-sdio falls under LICENCE.broadcom_bcm43xx
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060011# * brcmfmac43456-sdio falls under LICENCE.broadcom_bcm43xx
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012#
13# It is likely[^1] that both of these should be under LICENCE.cypress.
14# Further, at this time the text of LICENCE.broadcom_bcm43xx is the same
15# 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 \
25 & WHENCE \
26"
27LIC_FILES_CHKSUM = "\
28 file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
Brad Bishopf76da502019-10-10 08:51:21 -040029 file://WHENCE;md5=7b12b2224438186e4c97c4c7f3a5cc28 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030"
31
32# These are not common licenses, set NO_GENERIC_LICENSE for them
33# so that the license files will be copied from fetched source
34NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx-rpidistro] = "LICENCE.broadcom_bcm43xx"
35NO_GENERIC_LICENSE[WHENCE] = "WHENCE"
36
Brad Bishopf76da502019-10-10 08:51:21 -040037SRC_URI = "git://github.com/RPi-Distro/firmware-nonfree"
38
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070039SRCREV = "83938f78ca2d5a0ffe0c223bb96d72ccc7b71ca5"
40PV = "20190114-1+rpt11"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041
42S = "${WORKDIR}/git"
43
44inherit allarch
45
46CLEANBROKEN = "1"
47
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048do_compile() {
49 :
50}
51
52do_install() {
53 install -d ${D}${nonarch_base_libdir}/firmware/brcm
54
55 cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro
56
57 # Replace outdated linux-firmware files with updated ones from
58 # raspbian firmware-nonfree. Raspbian adds blobs and nvram
59 # definitions that are also necessary so copy those too.
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060060 for fw in brcmfmac43430-sdio brcmfmac43455-sdio brcmfmac43456-sdio ; do
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080061 install -m 0644 brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/
62 done
Andrew Geissler5c4154f2020-10-16 10:13:56 -050063 # add compat links. Fixes errors like
64 # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2
65 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt
66 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
67 ln -s brcmfmac43430-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060068 ln -s brcmfmac43430-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069}
70
71PACKAGES = "\
72 ${PN}-broadcom-license \
73 ${PN}-bcm43430 \
74 ${PN}-bcm43455 \
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060075 ${PN}-bcm43456 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076"
77
Patrick Williams213cb262021-08-07 19:21:33 -050078LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
79LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
80LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
81LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
82FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro"
83FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430*"
84FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455*"
85FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
86RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
87RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
88RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
89RCONFLICTS:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080090 linux-firmware-bcm43430 \
91 linux-firmware-raspbian-bcm43430 \
92"
Patrick Williams213cb262021-08-07 19:21:33 -050093RREPLACES:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080094 linux-firmware-bcm43430 \
95 linux-firmware-raspbian-bcm43430 \
96"
Patrick Williams213cb262021-08-07 19:21:33 -050097RCONFLICTS:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080098 linux-firmware-bcm43455 \
99 linux-firmware-raspbian-bcm43455 \
100"
Patrick Williams213cb262021-08-07 19:21:33 -0500101RREPLACES:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800102 linux-firmware-bcm43455 \
103 linux-firmware-raspbian-bcm43455 \
104"
Patrick Williams213cb262021-08-07 19:21:33 -0500105RCONFLICTS:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600106 linux-firmware-bcm43456 \
107 linux-firmware-raspbian-bcm43456 \
108"
Patrick Williams213cb262021-08-07 19:21:33 -0500109RREPLACES:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600110 linux-firmware-bcm43456 \
111 linux-firmware-raspbian-bcm43456 \
112"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800113
114# Firmware files are generally not run on the CPU, so they can be
115# allarch despite being architecture specific
116INSANE_SKIP = "arch"