Skip to content

Commit bc91965

Browse files
authored
Simplify a way to sideload proprietary firmware (#1692)
In case of Qualcomm HDK platforms not all the firmware is included into the NON-HLOS.bin image. Typically Adreno, IPA and Iris firmware are provided separately. Currently we have firmware-qcom-adreno.inc, which lets users to sideload Adreno firmware only. Let users provide all missing firmware files as an archive instead.
2 parents 948b130 + e30df9b commit bc91965

File tree

8 files changed

+43
-49
lines changed

8 files changed

+43
-49
lines changed

recipes-bsp/firmware/firmware-qcom-adreno.inc

Lines changed: 0 additions & 40 deletions
This file was deleted.

recipes-bsp/firmware/firmware-qcom-nhlos.inc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Handle NON-HLOS.bin unpacking in a generic way
22
# Include the file to be able to dissect the image using handle_nonhlos_image()
33
# If NHLOS_URI is defined, the image will be dissected automatically
4+
#
5+
# Additionally PROPRIETARY_URI can be specified. Its contents will be used to
6+
# provide additional firmware files (like Adreno or IPA), which are not a part
7+
# of NON-HLOS.bin.
48

59
NHLOS_URI ??= ""
10+
PROPRIETARY_URI ??= ""
611

712
# List all firmware files to be installed
813
FW_QCOM_LIST ??= ""
@@ -11,7 +16,7 @@ DEPENDS += "pil-squasher-native mtools-native"
1116

1217
# Conditionally populate SRC_URI. We have to do it here rather than in python
1318
# script to let base.bbclass to pick up dependencies
14-
SRC_URI += "${NHLOS_URI}"
19+
SRC_URI += "${NHLOS_URI} ${PROPRIETARY_URI}${@ ';subdir=proprietary' if d.getVar('PROPRIETARY_URI') != '' else '' }"
1520

1621
unpack_nhlos_image() {
1722
mkdir -p ${B}/firmware
@@ -48,11 +53,11 @@ do_install:prepend() {
4853
install -d ${D}${FW_QCOM_PATH}
4954

5055
for fw in ${FW_QCOM_LIST} ; do
51-
if [ -r ${B}/$fw ] ; then
56+
if [ -r ${S}/proprietary/$fw ] ; then
57+
install -m 0644 ${S}/proprietary/$fw ${D}${FW_QCOM_PATH}
58+
elif [ -r ${B}/$fw ] ; then
5259
install -m 0644 ${B}/$fw ${D}${FW_QCOM_PATH}
53-
fi
54-
55-
if [ -r ${B}/firmware/image/$fw ] ; then
60+
elif [ -r ${B}/firmware/image/$fw ] ; then
5661
install -m 0644 ${B}/firmware/image/$fw ${D}${FW_QCOM_PATH}
5762
fi
5863
done

recipes-bsp/firmware/firmware-qcom-qar2130p.bb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ S = "${UNPACKDIR}"
1919

2020
require recipes-bsp/firmware/firmware-qcom.inc
2121
require recipes-bsp/firmware/firmware-qcom-nhlos.inc
22-
require recipes-bsp/firmware/firmware-qcom-adreno.inc
2322

2423
SPLIT_FIRMWARE_PACKAGES = "\
2524
linux-firmware-qcom-${FW_QCOM_NAME}-adreno \
@@ -30,9 +29,9 @@ SPLIT_FIRMWARE_PACKAGES = "\
3029
"
3130

3231
do_install:prepend() {
33-
if [ -n "${ADRENO_URI}" ] ; then
32+
if [ -r "${UNPACKDIR}/proprietary/a621_gmu.bin" ] ; then
3433
install -d ${D}${FW_QCOM_BASE_PATH}
35-
install -m 0644 ${UNPACKDIR}/adreno/${ADRENO_PATH}/a621_gmu.bin ${D}${FW_QCOM_BASE_PATH}
34+
install -m 0644 ${UNPACKDIR}/proprietary/a621_gmu.bin ${D}${FW_QCOM_BASE_PATH}
3635
fi
3736

3837
if [ -n "${NHLOS_URI}" ] ; then

recipes-bsp/firmware/firmware-qcom-sdm845-hdk.bb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FW_QCOM_SUBDIR = "sdm845/Qualcomm/SDM845-HDK"
1111

1212
# ADSP, CDSP, modem and WLAN are a part of linux-firmware
1313
FW_QCOM_LIST = "\
14+
ipa_fws.mbn \
1415
slpi.mbn slpir.jsn \
1516
"
1617

@@ -20,5 +21,6 @@ require recipes-bsp/firmware/firmware-qcom.inc
2021
require recipes-bsp/firmware/firmware-qcom-nhlos.inc
2122

2223
SPLIT_FIRMWARE_PACKAGES = "\
24+
linux-firmware-qcom-${FW_QCOM_NAME}-ipa \
2325
linux-firmware-qcom-${FW_QCOM_NAME}-sensors \
2426
"

recipes-bsp/firmware/firmware-qcom-sm8150-hdk.bb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,13 @@ SPLIT_FIRMWARE_PACKAGES = "\
2828
linux-firmware-qcom-${FW_QCOM_NAME}-ipa \
2929
linux-firmware-qcom-${FW_QCOM_NAME}-modem \
3030
linux-firmware-qcom-${FW_QCOM_NAME}-sensors \
31+
linux-firmware-qcom-${FW_QCOM_NAME}-venus \
3132
linux-firmware-qcom-${FW_QCOM_NAME}-wifi \
3233
"
34+
35+
do_install:prepend() {
36+
if [ -r "${S}/proprietary/venus.mbn" ] ; then
37+
install -d ${D}${FW_QCOM_BASE_PATH}/vpu
38+
install -m 0644 ${S}/proprietary/venus.mbn ${D}${FW_QCOM_BASE_PATH}/vpu/vpu10_2v.mbn
39+
fi
40+
}

recipes-bsp/firmware/firmware-qcom-sm8350-hdk.bb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,14 @@ SPLIT_FIRMWARE_PACKAGES = "\
2727
linux-firmware-qcom-${FW_QCOM_NAME}-ipa \
2828
linux-firmware-qcom-${FW_QCOM_NAME}-modem \
2929
linux-firmware-qcom-${FW_QCOM_NAME}-sensors \
30+
linux-firmware-qcom-${FW_QCOM_NAME}-venus \
3031
"
32+
33+
# Different vpu20_4v.mbn files are not compatible and support different
34+
# platforms. Use platform-specific name for the file in generic location.
35+
do_install:prepend() {
36+
if [ -r "${S}/proprietary/vpu20_4v.mbn" ] ; then
37+
install -d ${D}${FW_QCOM_BASE_PATH}/vpu
38+
install -m 0644 ${S}/proprietary/vpu20_4v.mbn ${D}${FW_QCOM_BASE_PATH}/vpu/vpu20_4v_sm8350.mbn
39+
fi
40+
}

recipes-bsp/firmware/firmware-qcom-sm8450-hdk.bb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,14 @@ SPLIT_FIRMWARE_PACKAGES = "\
2727
linux-firmware-qcom-${FW_QCOM_NAME}-ipa \
2828
linux-firmware-qcom-${FW_QCOM_NAME}-modem \
2929
linux-firmware-qcom-${FW_QCOM_NAME}-sensors \
30+
linux-firmware-qcom-${FW_QCOM_NAME}-venus \
3031
"
32+
33+
# Different vpu20_4v.mbn files are not compatible and support different
34+
# platforms. Use platform-specific name for the file in generic location.
35+
do_install:prepend() {
36+
if [ -r "${S}/proprietary/vpu20_4v.mbn" ] ; then
37+
install -d ${D}${FW_QCOM_BASE_PATH}/vpu
38+
install -m 0644 ${S}/proprietary/vpu20_4v.mbn ${D}${FW_QCOM_BASE_PATH}/vpu/vpu20_4v_sm8450.mbn
39+
fi
40+
}

recipes-bsp/firmware/firmware-qcom.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ FILES:linux-firmware-qcom-${FW_QCOM_NAME}-ipa = "${FW_QCOM_PATH}/ipa_fws.mbn* ${
2929
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-modem = "${FW_QCOM_PATH}/mba.mbn* ${FW_QCOM_PATH}/modem.mbn* ${FW_QCOM_PATH}/modem*.jsn"
3030
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-q6 = "${FW_QCOM_PATH}/q6.mbn*"
3131
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-sensors = "${FW_QCOM_PATH}/slpi.mbn* ${FW_QCOM_PATH}/slpi*.jsn"
32-
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-venus = "${FW_QCOM_PATH}/venus.mbn* ${FW_QCOM_PATH}/vidc*"
32+
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-venus = "${FW_QCOM_PATH}/venus.mbn* ${FW_QCOM_PATH}/vidc* ${FW_QCOM_BASE_PATH}/vpu*"
3333
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-wifi = "${FW_QCOM_PATH}/wcnss.mbn* ${FW_QCOM_PATH}/wlanmdsp.mbn*"
3434

3535
# Possible values are "xz" and "zst".

0 commit comments

Comments
 (0)