aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_git.bb
blob: 95cd9c16474719e568798d758ad84ad8b3782b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
SUMMARY = "Linux kernel firmware files from Raspbian distribution"
DESCRIPTION = "Updated firmware files for RaspberryPi hardware. \
RPi-Distro obtains these directly from Cypress; they are not submitted \
to linux-firmware for general use."
HOMEPAGE = "https://github.com/RPi-Distro/firmware-nonfree"
SECTION = "kernel"

# In maintained upstream linux-firmware:
# * brcmfmac43430-sdio falls under LICENSE.cypress
# * brcmfmac43455-sdio falls under LICENSE.broadcom_bcm43xx
# * brcmfmac43456-sdio falls under LICENSE.broadcom_bcm43xx
#
# It is likely[^1] that both of these should be under LICENSE.cypress.
# Further, at this time the text of LICENSE.broadcom_bcm43xx is the same
# in linux-firmware and RPi-Distro/firmware-nonfree, but this may
# change.
#
# Rather than make assumptions about what's supposed to be what, we'll
# use the license implied by the source of these files, named to avoid
# conflicts with linux-firmware.
#
# [^1]: https://github.com/RPi-Distro/bluez-firmware/issues/1
LICENSE = "\
    Firmware-broadcom_bcm43xx-rpidistro \
"
LIC_FILES_CHKSUM = "\
    file://debian/config/brcm80211/LICENSE;md5=8cba1397cda6386db37210439a0da3eb \
"

# These are not common licenses, set NO_GENERIC_LICENSE for them
# so that the license files will be copied from fetched source
NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx-rpidistro] = "debian/config/brcm80211/LICENSE"

SRC_URI = "git://github.com/RPi-Distro/firmware-nonfree;branch=bullseye;protocol=https"

SRCREV = "b3eec612566ca08913f0830d299f4df70297428f"
PV = "20210315-3+rpt3"

S = "${WORKDIR}/git"

inherit allarch

CLEANBROKEN = "1"

do_compile() {
    :
}

do_install() {
    install -d ${D}${nonarch_base_libdir}/firmware/brcm ${D}${nonarch_base_libdir}/firmware/cypress

    cp debian/config/brcm80211/LICENSE ${D}${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro

    # Replace outdated linux-firmware files with updated ones from
    # raspbian firmware-nonfree. Raspbian adds blobs and nvram
    # definitions that are also necessary so copy those too.
    for fw in brcmfmac43430-sdio brcmfmac43436-sdio brcmfmac43436s-sdio brcmfmac43455-sdio brcmfmac43456-sdio ; do
        cp -R --no-dereference --preserve=mode,links -v debian/config/brcm80211/brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/
    done
    cp -R --no-dereference --preserve=mode,links -v debian/config/brcm80211/cypress/* ${D}${nonarch_base_libdir}/firmware/cypress/
    # add compat links. Fixes errors like
    # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-compute-module.txt failed with error -2
    ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
}

PACKAGES = "\
    ${PN}-broadcom-license \
    ${PN}-bcm43430 \
    ${PN}-bcm43455 \
    ${PN}-bcm43456 \
    ${PN}-bcm43436 \
    ${PN}-bcm43436s \
"

LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
LICENSE:${PN}-bcm43436 = "Firmware-broadcom_bcm43xx-rpidistro"
LICENSE:${PN}-bcm43436s = "Firmware-broadcom_bcm43xx-rpidistro"
LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro"
FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430* ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.bin"
FILES:${PN}-bcm43436 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436-*"
FILES:${PN}-bcm43436s = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436s*"
FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455* ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio.*"
FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
RDEPENDS:${PN}-bcm43436 += "${PN}-broadcom-license"
RDEPENDS:${PN}-bcm43436s += "${PN}-broadcom-license"
RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
RCONFLICTS:${PN}-bcm43430 = "\
    linux-firmware-bcm43430 \
    linux-firmware-raspbian-bcm43430 \
"

RREPLACES:${PN}-bcm43430 = "\
    linux-firmware-bcm43430 \
    linux-firmware-raspbian-bcm43430 \
"

RCONFLICTS:${PN}-bcm43436 = "\
    linux-firmware-bcm43436 \
    linux-firmware-raspbian-bcm43436 \
"

RREPLACES:${PN}-bcm43436 = "\
    linux-firmware-bcm43436 \
    linux-firmware-raspbian-bcm43436 \
"

RCONFLICTS:${PN}-bcm43436s = "\
    linux-firmware-bcm43436s \
    linux-firmware-raspbian-bcm43436s \
"

RREPLACES:${PN}-bcm43436s = "\
    linux-firmware-bcm43436s \
    linux-firmware-raspbian-bcm43436s \
"

RCONFLICTS:${PN}-bcm43455 = "\
    linux-firmware-bcm43455 \
    linux-firmware-raspbian-bcm43455 \
"
RREPLACES:${PN}-bcm43455 = "\
    linux-firmware-bcm43455 \
    linux-firmware-raspbian-bcm43455 \
"
RCONFLICTS:${PN}-bcm43456 = "\
    linux-firmware-bcm43456 \
    linux-firmware-raspbian-bcm43456 \
"
RREPLACES:${PN}-bcm43456 = "\
    linux-firmware-bcm43456 \
    linux-firmware-raspbian-bcm43456 \
"

# Firmware files are generally not run on the CPU, so they can be
# allarch despite being architecture specific
INSANE_SKIP = "arch"