aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/firmware/firmware-qcom.inc
blob: 22cb02c117aa48599bb8dde0340c8c2222cb0ada (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
inherit allarch

FILES:${PN} += "${nonarch_base_libdir}/firmware/"

INSANE_SKIP:${PN} += "arch already-stripped"

# Default settings
# package name part in linux-firmware-qcom-...-audio
FW_QCOM_NAME ?= "unset"
# Subdir inside /lib/firmware/qcom. Typically it is equal to FW_QCOM_NAME but might differ in complex cases (like C630 Yoga).
FW_QCOM_SUBDIR ?= "${FW_QCOM_NAME}"
FW_QCOM_BASE_PATH = "${nonarch_base_libdir}/firmware/qcom"
FW_QCOM_PATH = "${FW_QCOM_BASE_PATH}/${FW_QCOM_SUBDIR}"

SPLIT_FIRMWARE_PACKAGES ?= ""

PACKAGE_BEFORE_PN += "${SPLIT_FIRMWARE_PACKAGES}"
# RRECOMMEND all non-split packages split from this recipe. Split firmware files re usually replaced with the squashed ones.
RRECOMMENDS:${PN} += "${@ ' '.join(filter(lambda p: not p.endswith('-split'), d.getVar('SPLIT_FIRMWARE_PACKAGES').split())) }"

# Default settings for several split packages
FILES:${PN}-dspso += "${FW_QCOM_BASE_PATH}/*/*dspso.bin"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-audio = "${FW_QCOM_PATH}/adsp.mbn ${FW_QCOM_PATH}/adsp*.jsn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-audio-split = "${FW_QCOM_PATH}/adsp.mdt ${FW_QCOM_PATH}/adsp.b*"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-compute = "${FW_QCOM_PATH}/cdsp.mbn ${FW_QCOM_PATH}/cdsp*.jsn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-compute-split = "${FW_QCOM_PATH}/cdsp.mdt ${FW_QCOM_PATH}/cdsp.b*"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-modem = "${FW_QCOM_PATH}/mba.mbn ${FW_QCOM_PATH}/modem.mbn ${FW_QCOM_PATH}/modem*.jsn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-modem-split = "${FW_QCOM_PATH}/modem.mdt ${FW_QCOM_PATH}/modem.b*"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-sensors = "${FW_QCOM_PATH}/slpi.mbn ${FW_QCOM_PATH}/slpi*.jsn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-sensors-split = "${FW_QCOM_PATH}/slpi.mdt ${FW_QCOM_PATH}/slpi.b*"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-wifi = "${FW_QCOM_PATH}/wcnss.mbn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-wifi-split = "${FW_QCOM_PATH}/wcnss.mdt ${FW_QCOM_PATH}/wcnss.b*"

python() {
    pn = d.getVar("PN")
    insanes = d.getVar("INSANE_SKIP:%s" % pn)
    for pkg in d.getVar("SPLIT_FIRMWARE_PACKAGES").split():
        # Depend on the main package to get the license file
        d.appendVar("RDEPENDS:" + pkg, " " + pn)
        # and append the INSANE_SKIP of the main package to pass QA
        d.appendVar("INSANE_SKIP:" + pkg, " " + insanes)
        # If it's a package with the split frmware, depend on non-split files (for jsn files, etc)
        if pkg.endswith("-split"):
            d.appendVar("RDEPENDS:" + pkg, " " + pkg[:-6])
    if d.getVar("FW_QCOM_NAME") == "unset" and d.getVar("SPLIT_FIRMWARE_PACKAGES") != "":
        bb.error("%s: split firmware-qcom packages engaged, but FW_QCOM_NAME is not defined" % pn)
}

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_DEFAULT_DEPS = "1"