Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/media/platform/qcom/iris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config VIDEO_QCOM_IRIS
select V4L2_MEM2MEM_DEV
select QCOM_MDT_LOADER
select QCOM_SCM
select QCOM_PAS
select QCOM_UBWC_CONFIG
select VIDEOBUF2_DMA_CONTIG
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/qcom/iris/iris_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct iris_core {
struct device *np_dev;
struct device *p_dev;
struct device *fw_dev;
struct qcom_scm_pas_context *pas_ctx;
struct qcom_pas_context *pas_ctx;
void __iomem *reg_base;
int irq;
struct v4l2_device v4l2_dev;
Expand Down
13 changes: 7 additions & 6 deletions drivers/media/platform/qcom/iris/iris_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <linux/firmware.h>
#include <linux/firmware/qcom/qcom_pas.h>
#include <linux/firmware/qcom/qcom_scm.h>
#include <linux/iommu.h>
#include <linux/of_address.h>
Expand Down Expand Up @@ -142,7 +143,7 @@ static int iris_load_fw_to_memory(struct iris_core *core)
{
struct device *fw_dev = core->fw_dev ? core->fw_dev : core->dev;
const struct firmware *firmware = NULL;
struct qcom_scm_pas_context *ctx;
struct qcom_pas_context *ctx;
struct iommu_domain *domain;
struct resource res;
phys_addr_t mem_phys;
Expand All @@ -163,7 +164,7 @@ static int iris_load_fw_to_memory(struct iris_core *core)
return PTR_ERR(firmware);

if (!core->pas_ctx) {
ctx = devm_qcom_scm_pas_context_alloc(core->dev, IRIS_PAS_ID, mem_phys, res_size);
ctx = devm_qcom_pas_context_alloc(core->dev, IRIS_PAS_ID, mem_phys, res_size);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
core->pas_ctx = ctx;
Expand Down Expand Up @@ -220,7 +221,7 @@ int iris_fw_load(struct iris_core *core)
return ret;
}

ret = qcom_scm_pas_prepare_and_auth_reset(core->pas_ctx);
ret = qcom_pas_prepare_and_auth_reset(core->pas_ctx);
if (ret) {
dev_err(core->dev, "auth and reset failed: %d\n", ret);
goto err_unmap;
Expand All @@ -241,7 +242,7 @@ int iris_fw_load(struct iris_core *core)
return 0;

err_pas_shutdown:
qcom_scm_pas_shutdown(IRIS_PAS_ID);
qcom_pas_shutdown(IRIS_PAS_ID);
err_unmap:
iris_fw_iommu_unmap(core);

Expand All @@ -252,13 +253,13 @@ int iris_fw_unload(struct iris_core *core)
{
int ret;

ret = qcom_scm_pas_shutdown(IRIS_PAS_ID);
ret = qcom_pas_shutdown(IRIS_PAS_ID);
iris_fw_iommu_unmap(core);

return ret;
}

int iris_set_hw_state(struct iris_core *core, bool resume)
{
return qcom_scm_set_remote_state(resume, 0);
return qcom_pas_set_remote_state(resume, IRIS_PAS_ID);
}
1 change: 1 addition & 0 deletions drivers/media/platform/qcom/venus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config VIDEO_QCOM_VENUS
select OF_DYNAMIC if ARCH_QCOM
select QCOM_MDT_LOADER
select QCOM_SCM
select QCOM_PAS
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/qcom/venus/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ struct venus_core {
size_t mapped_mem_size;
phys_addr_t mem_phys;
size_t mem_size;
struct qcom_scm_pas_context *ctx;
struct qcom_pas_context *ctx;
bool iommu_domain_owned;
} fw;
struct mutex lock;
Expand Down
19 changes: 10 additions & 9 deletions drivers/media/platform/qcom/venus/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/firmware/qcom/qcom_pas.h>
#include <linux/firmware/qcom/qcom_scm.h>
#include <linux/sizes.h>
#include <linux/soc/qcom/mdt_loader.h>
Expand Down Expand Up @@ -59,7 +60,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
int ret;

if (core->use_tz) {
ret = qcom_scm_set_remote_state(resume, 0);
ret = qcom_pas_set_remote_state(resume, VENUS_PAS_ID);
if (resume && ret == -EINVAL)
ret = 0;
return ret;
Expand Down Expand Up @@ -124,12 +125,12 @@ static int venus_load_fw(struct venus_core *core,
const struct firmware *mdt, const char *fwname,
phys_addr_t mem_phys, size_t res_size)
{
struct qcom_scm_pas_context *ctx;
struct qcom_pas_context *ctx;
struct device *dev;
int ret;

dev = core->fw.dev ? core->fw.dev : core->dev;
ctx = devm_qcom_scm_pas_context_alloc(dev, VENUS_PAS_ID, mem_phys, res_size);
ctx = devm_qcom_pas_context_alloc(dev, VENUS_PAS_ID, mem_phys, res_size);
if (!ctx) {
dev_err(core->dev, "%s: ctx is null\n", __func__);
return -ENOMEM;
Expand All @@ -138,7 +139,7 @@ static int venus_load_fw(struct venus_core *core,
ctx->use_tzmem = !!core->fw.dev;

ret = qcom_mdt_pas_load(ctx, mdt, fwname, NULL);
qcom_scm_pas_metadata_release(ctx);
qcom_pas_metadata_release(ctx);
if (ret) {
dev_err(core->dev, "%s: qcom_mdt_pas_load: %d\n", __func__, ret);
return ret;
Expand All @@ -155,9 +156,9 @@ static int venus_load_fw(struct venus_core *core,

core->fw.mapped_mem_size = res_size;

ret = qcom_scm_pas_prepare_and_auth_reset(ctx);
ret = qcom_pas_prepare_and_auth_reset(ctx);
if (ret) {
dev_err(core->dev, "%s: qcom_scm_pas_prepare_and_auth_reset: %d\n", __func__, ret);
dev_err(core->dev, "%s: qcom_pas_prepare_and_auth_reset: %d\n", __func__, ret);
if (core->fw.iommu_domain)
iommu_unmap(core->fw.iommu_domain, 0, res_size);
core->fw.mapped_mem_size = 0;
Expand Down Expand Up @@ -311,7 +312,7 @@ int venus_shutdown(struct venus_core *core)
int ret;

if (core->use_tz) {
ret = qcom_scm_pas_shutdown(VENUS_PAS_ID);
ret = qcom_pas_shutdown(VENUS_PAS_ID);
if (core->fw.iommu_domain && core->fw.mapped_mem_size) {
iommu_unmap(core->fw.iommu_domain, 0, core->fw.mapped_mem_size);
core->fw.mapped_mem_size = 0;
Expand Down Expand Up @@ -410,8 +411,8 @@ static int venus_firmware_init_auto_detect(struct venus_core *core)
int ret;

core->use_tz = false;
if (qcom_scm_is_available()) {
if (qcom_scm_pas_supported(VENUS_PAS_ID))
if (qcom_pas_is_available()) {
if (qcom_pas_supported(VENUS_PAS_ID))
core->use_tz = true;
} else {
ret = driver_deferred_probe_check_state(core->dev);
Expand Down