blob: bd5ed6254f7b82a9a8d8dfa381f2e50e3ddc6d8d [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Linux kernel Bluetooth firmware files from Raspbian distribution"
2DESCRIPTION = "Updated Bluetooth 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/bluez-firmware"
6SECTION = "kernel"
7
8# Upstream has provided[^1] licensing information in the Debian
9# copyright file. The wording of the Cypress license subsequently
10# changed in linux-firmware.
11#
12# Rather than make assumptions about what's supposed to be what, we'll
13# use the license implied by the source of these files, named to avoid
14# conflicts with linux-firmware.
15#
16# [^1]: https://github.com/RPi-Distro/bluez-firmware/issues/1
17LICENSE = "Firmware-cypress-rpidistro"
18LIC_FILES_CHKSUM = "\
Patrick Williams03514f12024-04-05 07:04:11 -050019 file://LICENCE.cypress-rpidistro;md5=be80828daf682762f392131141288a74 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020"
21
22# These are not common licenses, set NO_GENERIC_LICENSE for them
23# so that the license files will be copied from fetched source
24NO_GENERIC_LICENSE[Firmware-cypress-rpidistro] = "LICENCE.cypress-rpidistro"
25
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050026SRC_URI = " \
Patrick Williams03514f12024-04-05 07:04:11 -050027 git://github.com/RPi-Distro/bluez-firmware;branch=bookworm;protocol=https \
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050028"
Patrick Williams03514f12024-04-05 07:04:11 -050029SRCREV = "78d6a07730e2d20c035899521ab67726dc028e1c"
30PV = "1.2-9+rpt3"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031
32S = "${WORKDIR}/git"
33
34inherit allarch
35
36CLEANBROKEN = "1"
37
38do_extract_lic() {
39 # Extract the license from the Debian copyright file
40 sed -e '1,23d' ${S}/debian/copyright > ${S}/LICENCE.cypress-rpidistro
41}
42# Must be before both do_install and do_populate_lic. Putting it before
43# their common ancestor works; other approaches do not.
Patrick Williams03907ee2022-05-01 06:28:52 -050044addtask extract_lic after do_unpack before do_patch do_create_spdx
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045
46do_compile() {
47 :
48}
49
50do_install() {
51 install -d ${D}${nonarch_base_libdir}/firmware/brcm
52
53 cp LICENCE.cypress-rpidistro ${D}${nonarch_base_libdir}/firmware
Patrick Williams03514f12024-04-05 07:04:11 -050054 install -m 0644 debian/firmware/broadcom/BCM434*.hcd ${D}${nonarch_base_libdir}/firmware/brcm/
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080055}
56
57PACKAGES = "\
58 ${PN}-cypress-license \
59 ${PN}-bcm43430a1-hcd \
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070060 ${PN}-bcm43430b0-hcd \
Patrick Williams03514f12024-04-05 07:04:11 -050061 ${PN}-bcm4343a2-hcd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062 ${PN}-bcm4345c0-hcd \
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070063 ${PN}-bcm4345c5-hcd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064"
65
Patrick Williams213cb262021-08-07 19:21:33 -050066LICENSE:${PN}-bcm43430a1-hcd = "Firmware-cypress-rpidistro"
67LICENSE:${PN}-bcm43430b0-hcd = "Firmware-cypress-rpidistro"
Patrick Williams03514f12024-04-05 07:04:11 -050068LICENSE:${PN}-bcm4343a2-hcd = "Firmware-cypress-rpidistro"
Patrick Williams213cb262021-08-07 19:21:33 -050069LICENSE:${PN}-bcm4345c0-hcd = "Firmware-cypress-rpidistro"
70LICENSE:${PN}-bcm4345c5-hcd = "Firmware-cypress-rpidistro"
71LICENSE:${PN}-cypress-license = "Firmware-cypress-rpidistro"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080072
Patrick Williams213cb262021-08-07 19:21:33 -050073FILES:${PN}-cypress-license = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074 ${nonarch_base_libdir}/firmware/LICENCE.cypress-rpidistro \
75"
Patrick Williams213cb262021-08-07 19:21:33 -050076FILES:${PN}-bcm43430a1-hcd = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080077 ${nonarch_base_libdir}/firmware/brcm/BCM43430A1.hcd \
78"
Patrick Williams213cb262021-08-07 19:21:33 -050079FILES:${PN}-bcm43430b0-hcd = "\
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070080 ${nonarch_base_libdir}/firmware/brcm/BCM43430B0.hcd \
81"
Patrick Williams03514f12024-04-05 07:04:11 -050082FILES:${PN}-bcm4343a2-hcd = "\
83 ${nonarch_base_libdir}/firmware/brcm/BCM4343A2.hcd \
84"
Patrick Williams213cb262021-08-07 19:21:33 -050085FILES:${PN}-bcm4345c0-hcd = "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080086 ${nonarch_base_libdir}/firmware/brcm/BCM4345C0.hcd \
87"
Patrick Williams213cb262021-08-07 19:21:33 -050088FILES:${PN}-bcm4345c5-hcd = "\
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070089 ${nonarch_base_libdir}/firmware/brcm/BCM4345C5.hcd \
90"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080091
Patrick Williams213cb262021-08-07 19:21:33 -050092RDEPENDS:${PN}-bcm43430a1-hcd += "${PN}-cypress-license"
93RDEPENDS:${PN}-bcm43430b0-hcd += "${PN}-cypress-license"
Patrick Williams03514f12024-04-05 07:04:11 -050094RDEPENDS:${PN}-bcm4343a2-hcd += "${PN}-cypress-license"
Patrick Williams213cb262021-08-07 19:21:33 -050095RDEPENDS:${PN}-bcm4345c0-hcd += "${PN}-cypress-license"
96RDEPENDS:${PN}-bcm4345c5-hcd += "${PN}-cypress-license"
97RCONFLICTS:${PN}-bcm43430a1-hcd = "linux-firmware-bcm43430a1-hcd"
98RREPLACES:${PN}-bcm43430a1-hcd = "linux-firmware-bcm43430a1-hcd"
99RCONFLICTS:${PN}-bcm43430b0-hcd = "linux-firmware-bcm43430b0-hcd"
100RREPLACES:${PN}-bcm43430b0-hcd = "linux-firmware-bcm43430b0-hcd"
Patrick Williams03514f12024-04-05 07:04:11 -0500101RCONFLICTS:${PN}-bcm4343a2-hcd = "linux-firmware-bcm4343a2-hcd"
102RREPLACES:${PN}-bcm4343a2-hcd = "linux-firmware-bcm4343a2-hcd"
Patrick Williams213cb262021-08-07 19:21:33 -0500103RCONFLICTS:${PN}-bcm43435c0-hcd = "linux-firmware-bcm4345c0-hcd"
104RREPLACES:${PN}-bcm43435c0-hcd = "linux-firmware-bcm4345c0-hcd"
105RCONFLICTS:${PN}-bcm43435c5-hcd = "linux-firmware-bcm4345c5-hcd"
106RREPLACES:${PN}-bcm43435c5-hcd = "linux-firmware-bcm4345c5-hcd"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800107
108# Firmware files are generally not run on the CPU, so they can be
109# allarch despite being architecture specific
110INSANE_SKIP = "arch"