video: driver: Add generic PAS TZ API and OP-TEE support - #134
Open
gouravk-qualcomm wants to merge 3 commits into
Open
video: driver: Add generic PAS TZ API and OP-TEE support#134gouravk-qualcomm wants to merge 3 commits into
gouravk-qualcomm wants to merge 3 commits into
Conversation
|
|
||
| HAS_MDT_PAS_LOAD := $(shell grep -qs 'qcom_mdt_pas_load' $(MDT_LOADER_H) && echo yes || echo no) | ||
| HAS_MDT_PAS_LOAD_MEM := $(shell grep -qs 'mem_region.*reloc_base' $(MDT_LOADER_H) && echo yes || echo no) | ||
| HAS_QCOM_PAS := $(shell test -f $(QCOM_PAS_H) && echo yes || echo no) |
Contributor
There was a problem hiding this comment.
Can we rename it to HAS_QCOM_TEE_PAS?
to indicate that TEE_PAS generic driver existence that handles SCM & PTA both.
Contributor
Author
There was a problem hiding this comment.
yes, it makes more comprehensive, updated.
|
|
||
| static inline int fw_pas_set_remote_state(bool resume, int pas_id) | ||
| { | ||
| return qcom_scm_set_remote_state(resume, 0); |
Contributor
There was a problem hiding this comment.
We can fix this bug to pass pas_id. Functionally its working cause the SCM call doesn't consume pas_id.
Generic PAS TZ API declared in a new linux/firmware/qcom/qcom_pas.h header (replacing the qcom_scm_pas_* API), so alternate TZ backends besides QTEE/SCM (e.g. OP-TEE) can be plugged in. Detect that header the same way the existing HAS_MDT_PAS_LOAD* probes detect mdt_loader.h capabilities, and set -DHAVE_QCOM_TEE_PAS ahead of the rest of the ladder so kernels that have it take priority over the legacy qcom_scm_pas_* variants. Signed-off-by: Gourav Kumar <gouravk@qti.qualcomm.com>
Generic PAS TZ service allows video firmware loading to work with multiple TZ implementation backends -- the existing QTEE-based SCM PAS service, as well as OP-TEE-based PAS service and any further future TZ backend -- instead of being hardwired to the SCM-only qcom_scm_pas_* API. On kernels where the generic API is available (HAVE_QCOM_TEE_PAS), route firmware load/unload/suspend/resume through qcom_pas_context and qcom_pas_*. The remote-state call also now passes the video PAS ID instead of a hardcoded 0, since OP-TEE backends use it for proper bookkeeping (the SCM backend ignores it either way). On kernels without the generic API, behavior is unchanged -- the existing qcom_scm_pas_* code paths are preserved as-is. Signed-off-by: Gourav Kumar <gouravk@qti.qualcomm.com>
qcom_scm_mem_protect_video_var() is not serviced when PAS is backed by OP-TEE, since the TEE itself owns secure memory protection in that configuration -- so its failure there is expected rather than fatal. On kernels with the generic PAS TZ API (HAVE_QCOM_TEE_PAS), use qcom_pas_is_tee_backed() to detect that case in fw_load() and only treat the scm_mem_protect failure as fatal when OP-TEE is not the active PAS backend. Signed-off-by: Gourav Kumar <gouravk@qti.qualcomm.com>
gouravk-qualcomm
force-pushed
the
gouravk-optee
branch
from
July 28, 2026 15:20
3367510 to
64a2d77
Compare
pgujjula-qcom
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the overlay's existing multi-kernel PAS compatibility
with a 4th variant to stay compatible with both the legacy and the
new generic API and adds the OP-TEE-specific handling needed
once that backend is in use.
Signed-off-by: Gourav Kumar gouravk@qti.qualcomm.com