Bartosz Golaszewski
178e19c0df
firmware: qcom: scm: add support for SHM bridge operations
...
SHM Bridge is a safety mechanism allowing to limit the amount of memory
shared between the kernel and the TrustZone to regions explicitly marked
as such.
Add low-level primitives for enabling SHM bridge support as well as
creating and destroying SHM bridges to qcom-scm.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Acked-by: Andrew Halaney <ahalaney@redhat.com >
Tested-by: Andrew Halaney <ahalaney@redhat.com > # sc8280xp-lenovo-thinkpad-x13s
Tested-by: Deepti Jaggi <quic_djaggi@quicinc.com > #sa8775p-ride
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com >
Link: https://lore.kernel.org/r/20240527-shm-bridge-v10-10-ce7afaa58d3a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2024-06-23 16:08:20 -05:00
Bartosz Golaszewski
449d0d84bc
firmware: qcom: scm: smc: switch to using the SCM allocator
...
We need to allocate, map and pass a buffer to the trustzone if we have
more than 4 arguments for a given SCM call. Let's use the new TrustZone
allocator for that memory and shrink the code in process.
As this code lives in a different compilation unit than the rest of the
SCM code, we need to provide a helper in the form of
qcom_scm_get_tzmem_pool() that allows the SMC low-level routines to
access the SCM memory pool.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Andrew Halaney <ahalaney@redhat.com >
Tested-by: Andrew Halaney <ahalaney@redhat.com > # sc8280xp-lenovo-thinkpad-x13s
Tested-by: Deepti Jaggi <quic_djaggi@quicinc.com > #sa8775p-ride
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com >
Link: https://lore.kernel.org/r/20240527-shm-bridge-v10-4-ce7afaa58d3a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2024-06-23 16:08:05 -05:00
Connor Abbott
158ed777e3
firmware: qcom: scm: Add gpu_init_regs call
...
This will used by drm/msm to initialize GPU registers that Qualcomm's
firmware doesn't make writeable to the kernel.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Connor Abbott <cwabbott0@gmail.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Acked-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20240430-a750-raytracing-v3-2-7f57c5ac082d@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2024-06-21 00:15:26 -05:00
Bartosz Golaszewski
d79a27ea8e
firmware: qcom: scm: remove unneeded 'extern' specifiers
...
'extern' specifiers do nothing for function declarations. Remove them
from the private qcom-scm header.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Andrew Halaney <ahalaney@redhat.com >
Tested-by: Andrew Halaney <ahalaney@redhat.com > # sc8280xp-lenovo-thinkpad-x13s
Link: https://lore.kernel.org/r/20231017092732.19983-4-brgl@bgdev.pl
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-10-22 09:14:54 -07:00
Bartosz Golaszewski
3294d01f7a
firmware: qcom: scm: add a missing forward declaration for struct device
...
We reference struct device in the private scm header but we neither
include linux/device.h nor forward declare it. Fix it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Andrew Halaney <ahalaney@redhat.com >
Tested-by: Andrew Halaney <ahalaney@redhat.com > # sc8280xp-lenovo-thinkpad-x13s
Link: https://lore.kernel.org/r/20231017092732.19983-3-brgl@bgdev.pl
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-10-22 09:14:54 -07:00
Bartosz Golaszewski
bdac188ec3
firmware: qcom: move Qualcomm code into its own directory
...
We're getting more and more qcom specific .c files in drivers/firmware/
and about to get even more. Create a separate directory for Qualcomm
firmware drivers and move existing sources in there.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Acked-by: Elliot Berman <quic_eberman@quicinc.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com >
Tested-by: Andrew Halaney <ahalaney@redhat.com > # sc8280xp-lenovo-thinkpad-x13s
Link: https://lore.kernel.org/r/20231017092732.19983-2-brgl@bgdev.pl
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-10-22 09:14:54 -07:00