summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorDikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>2026-07-31 02:48:23 +0300
committerBryan O'Donoghue <bod@kernel.org>2026-09-29 12:53:45 +0100
commita9ff6152780577176fa00fcfa3480e73285099e3 (patch)
treea8edd746c815d2de741273e1976ba6cbd110a747 /tools/perf/scripts/python
parent6f4eb91fa27644ed57cbb43fa44ce8eea02bce0c (diff)
media: iris: Add Gen2 firmware autodetect and fallback
Some Iris platforms support both Gen1 and Gen2 HFI firmware images. Update the firmware loading logic to handle this generically by preferring Gen2 when available, while safely falling back to Gen1 when required. The firmware loading logic is updated with the following priority: 1. Device Tree (`firmware-name`): If specified, load unconditionally. 2. Gen2 default : If no DT override exists, select the Gen2 firmware descriptor when present and attempt to load the corresponding firmware image. 3. Gen1 Fallback: If loading the Gen2 firmware fails and a Gen1 descriptor is available, retry with the Gen1 firmware image. Loading and generation detection are split into two steps. iris_load_firmware() applies the priority above and returns the loaded image together with a candidate descriptor. iris_detect_firmware() then runs only after qcom_mdt_load() has succeeded and publishes the chosen descriptor, so the driver commits to a HFI generation only for an image that has actually been loaded. When a platform provides both Gen1 and Gen2 firmware descriptors and the firmware is loaded via a DT override, the candidate descriptor is only a default: iris_detect_firmware() inspects the loaded image to pick the generation, before authentication. It scans the memory populated by qcom_mdt_load() rather than the request_firmware() blob, so that a split .mdt image, whose version string lives in the .bNN data segments and not in the ELF headers, is classified correctly. The firmware is classified as Gen2 if the QC_IMAGE_VERSION_STRING starts with "vfw" or matches the "video-firmware.N.M" format with N >= 2. If a Gen1 firmware image is detected in this case, the driver switches to the Gen1 firmware descriptor and associated platform data so that the correct HFI implementation is used. This change makes firmware generation detection platform‑agnostic, preserves DT overrides, prefers newer Gen2 firmware when available, and maintains compatibility with platforms that only support Gen1. Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Co-developed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> [bod: initialised desc = NULL in iris_load_fw_to_memory] [bod: Removed dangling iris_session_init_caps() from iris_probe()] Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions