Commit 530ad317 authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

media: venus: firmware: Set virtual address ranges

In order to boot some of the new Venus firmware versions TZ call to set
virtual address ranges is needed. Add virtual address ranges for CP and
CP_NONPIX in resource structure and use them when loading and booting
the firmware on remote processor.
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 6d885330
...@@ -532,6 +532,10 @@ static const struct venus_resources sdm845_res_v2 = { ...@@ -532,6 +532,10 @@ static const struct venus_resources sdm845_res_v2 = {
.vmem_size = 0, .vmem_size = 0,
.vmem_addr = 0, .vmem_addr = 0,
.dma_mask = 0xe0000000 - 1, .dma_mask = 0xe0000000 - 1,
.cp_start = 0,
.cp_size = 0x70800000,
.cp_nonpixel_start = 0x1000000,
.cp_nonpixel_size = 0x24800000,
.fwname = "qcom/venus-5.2/venus.mdt", .fwname = "qcom/venus-5.2/venus.mdt",
}; };
......
...@@ -77,6 +77,10 @@ struct venus_resources { ...@@ -77,6 +77,10 @@ struct venus_resources {
unsigned int vmem_id; unsigned int vmem_id;
u32 vmem_size; u32 vmem_size;
u32 vmem_addr; u32 vmem_addr;
u32 cp_start;
u32 cp_size;
u32 cp_nonpixel_start;
u32 cp_nonpixel_size;
const char *fwname; const char *fwname;
}; };
......
...@@ -181,6 +181,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) ...@@ -181,6 +181,7 @@ static int venus_shutdown_no_tz(struct venus_core *core)
int venus_boot(struct venus_core *core) int venus_boot(struct venus_core *core)
{ {
struct device *dev = core->dev; struct device *dev = core->dev;
const struct venus_resources *res = core->res;
phys_addr_t mem_phys; phys_addr_t mem_phys;
size_t mem_size; size_t mem_size;
int ret; int ret;
...@@ -200,7 +201,23 @@ int venus_boot(struct venus_core *core) ...@@ -200,7 +201,23 @@ int venus_boot(struct venus_core *core)
else else
ret = venus_boot_no_tz(core, mem_phys, mem_size); ret = venus_boot_no_tz(core, mem_phys, mem_size);
if (ret)
return ret;
if (core->use_tz && res->cp_size) {
ret = qcom_scm_mem_protect_video_var(res->cp_start,
res->cp_size,
res->cp_nonpixel_start,
res->cp_nonpixel_size);
if (ret) {
qcom_scm_pas_shutdown(VENUS_PAS_ID);
dev_err(dev, "set virtual address ranges fail (%d)\n",
ret);
return ret; return ret;
}
}
return 0;
} }
int venus_shutdown(struct venus_core *core) int venus_shutdown(struct venus_core *core)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment