blob: 4f242d30d9d20af76fa23efddb6e6a83ae98762e [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
Patrick Williams0ca19cc2021-08-16 14:03:13 -050066 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
Andrew Geissler5c4154f2020-10-16 10:13:56 -050067 ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
68 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 -060069 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 -080070}
71
72PACKAGES = "\
73 ${PN}-broadcom-license \
74 ${PN}-bcm43430 \
75 ${PN}-bcm43455 \
Andrew Geissler12e5ffb2020-12-11 16:26:08 -060076 ${PN}-bcm43456 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080077"
78
Patrick Williams213cb262021-08-07 19:21:33 -050079LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
80LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
81LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
82LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
83FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro"
84FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430*"
85FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455*"
86FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
87RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
88RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
89RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
90RCONFLICTS:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080091 linux-firmware-bcm43430 \
92 linux-firmware-raspbian-bcm43430 \
93"
Patrick Williams213cb262021-08-07 19:21:33 -050094RREPLACES:${PN}-bcm43430 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080095 linux-firmware-bcm43430 \
96 linux-firmware-raspbian-bcm43430 \
97"
Patrick Williams213cb262021-08-07 19:21:33 -050098RCONFLICTS:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080099 linux-firmware-bcm43455 \
100 linux-firmware-raspbian-bcm43455 \
101"
Patrick Williams213cb262021-08-07 19:21:33 -0500102RREPLACES:${PN}-bcm43455 = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800103 linux-firmware-bcm43455 \
104 linux-firmware-raspbian-bcm43455 \
105"
Patrick Williams213cb262021-08-07 19:21:33 -0500106RCONFLICTS:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600107 linux-firmware-bcm43456 \
108 linux-firmware-raspbian-bcm43456 \
109"
Patrick Williams213cb262021-08-07 19:21:33 -0500110RREPLACES:${PN}-bcm43456 = "\
Andrew Geissler12e5ffb2020-12-11 16:26:08 -0600111 linux-firmware-bcm43456 \
112 linux-firmware-raspbian-bcm43456 \
113"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800114
115# Firmware files are generally not run on the CPU, so they can be
116# allarch despite being architecture specific
117INSANE_SKIP = "arch"