Commit 50058a9a authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

[media] media: venus: update firmware path with linux-firmware place

This makes firmware name and path part of venus_resources
structure and initialize it properly depending on the SoC and
firmware version.
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent ebebc593
...@@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work) ...@@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work)
pm_runtime_get_sync(core->dev); pm_runtime_get_sync(core->dev);
ret |= venus_boot(core->dev, &core->dev_fw); ret |= venus_boot(core->dev, &core->dev_fw, core->res->fwname);
ret |= hfi_core_resume(core, true); ret |= hfi_core_resume(core, true);
...@@ -207,7 +207,7 @@ static int venus_probe(struct platform_device *pdev) ...@@ -207,7 +207,7 @@ static int venus_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_runtime_disable; goto err_runtime_disable;
ret = venus_boot(dev, &core->dev_fw); ret = venus_boot(dev, &core->dev_fw, core->res->fwname);
if (ret) if (ret)
goto err_runtime_disable; goto err_runtime_disable;
...@@ -335,6 +335,7 @@ static const struct venus_resources msm8916_res = { ...@@ -335,6 +335,7 @@ static const struct venus_resources msm8916_res = {
.vmem_size = 0, .vmem_size = 0,
.vmem_addr = 0, .vmem_addr = 0,
.dma_mask = 0xddc00000 - 1, .dma_mask = 0xddc00000 - 1,
.fwname = "qcom/venus-1.8/venus.mdt",
}; };
static const struct freq_tbl msm8996_freq_table[] = { static const struct freq_tbl msm8996_freq_table[] = {
...@@ -363,6 +364,7 @@ static const struct venus_resources msm8996_res = { ...@@ -363,6 +364,7 @@ static const struct venus_resources msm8996_res = {
.vmem_size = 0, .vmem_size = 0,
.vmem_addr = 0, .vmem_addr = 0,
.dma_mask = 0xddc00000 - 1, .dma_mask = 0xddc00000 - 1,
.fwname = "qcom/venus-4.2/venus.mdt",
}; };
static const struct of_device_id venus_dt_match[] = { static const struct of_device_id venus_dt_match[] = {
......
...@@ -48,6 +48,7 @@ struct venus_resources { ...@@ -48,6 +48,7 @@ struct venus_resources {
unsigned int vmem_id; unsigned int vmem_id;
u32 vmem_size; u32 vmem_size;
u32 vmem_addr; u32 vmem_addr;
const char *fwname;
}; };
struct venus_format { struct venus_format {
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "firmware.h" #include "firmware.h"
#define VENUS_FIRMWARE_NAME "venus.mdt"
#define VENUS_PAS_ID 9 #define VENUS_PAS_ID 9
#define VENUS_FW_MEM_SIZE SZ_8M #define VENUS_FW_MEM_SIZE SZ_8M
...@@ -32,7 +31,7 @@ static void device_release_dummy(struct device *dev) ...@@ -32,7 +31,7 @@ static void device_release_dummy(struct device *dev)
of_reserved_mem_device_release(dev); of_reserved_mem_device_release(dev);
} }
int venus_boot(struct device *parent, struct device *fw_dev) int venus_boot(struct device *parent, struct device *fw_dev, const char *fwname)
{ {
const struct firmware *mdt; const struct firmware *mdt;
phys_addr_t mem_phys; phys_addr_t mem_phys;
...@@ -67,7 +66,7 @@ int venus_boot(struct device *parent, struct device *fw_dev) ...@@ -67,7 +66,7 @@ int venus_boot(struct device *parent, struct device *fw_dev)
goto err_unreg_device; goto err_unreg_device;
} }
ret = request_firmware(&mdt, VENUS_FIRMWARE_NAME, fw_dev); ret = request_firmware(&mdt, fwname, fw_dev);
if (ret < 0) if (ret < 0)
goto err_unreg_device; goto err_unreg_device;
...@@ -78,8 +77,8 @@ int venus_boot(struct device *parent, struct device *fw_dev) ...@@ -78,8 +77,8 @@ int venus_boot(struct device *parent, struct device *fw_dev)
goto err_unreg_device; goto err_unreg_device;
} }
ret = qcom_mdt_load(fw_dev, mdt, VENUS_FIRMWARE_NAME, VENUS_PAS_ID, ret = qcom_mdt_load(fw_dev, mdt, fwname, VENUS_PAS_ID, mem_va, mem_phys,
mem_va, mem_phys, mem_size); mem_size);
release_firmware(mdt); release_firmware(mdt);
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
struct device; struct device;
int venus_boot(struct device *parent, struct device *fw_dev); int venus_boot(struct device *parent, struct device *fw_dev,
const char *fwname);
int venus_shutdown(struct device *fw_dev); int venus_shutdown(struct device *fw_dev);
#endif #endif
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