Lines Matching full:core

20 #include "core.h"
28 static void venus_reset_cpu(struct venus_core *core) in venus_reset_cpu() argument
30 u32 fw_size = core->fw.mapped_mem_size; in venus_reset_cpu()
33 if (IS_IRIS2_1(core)) in venus_reset_cpu()
34 wrapper_base = core->wrapper_tz_base; in venus_reset_cpu()
36 wrapper_base = core->wrapper_base; in venus_reset_cpu()
45 if (IS_IRIS2_1(core)) { in venus_reset_cpu()
57 int venus_set_hw_state(struct venus_core *core, bool resume) in venus_set_hw_state() argument
61 if (core->use_tz) { in venus_set_hw_state()
69 venus_reset_cpu(core); in venus_set_hw_state()
71 if (IS_IRIS2_1(core)) in venus_set_hw_state()
73 core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); in venus_set_hw_state()
76 core->wrapper_base + WRAPPER_A9SS_SW_RESET); in venus_set_hw_state()
82 static int venus_load_fw(struct venus_core *core, const char *fwname, in venus_load_fw() argument
96 dev = core->dev; in venus_load_fw()
135 if (core->use_tz) in venus_load_fw()
148 static int venus_boot_no_tz(struct venus_core *core, phys_addr_t mem_phys, in venus_boot_no_tz() argument
155 dev = core->fw.dev; in venus_boot_no_tz()
159 iommu = core->fw.iommu_domain; in venus_boot_no_tz()
160 core->fw.mapped_mem_size = mem_size; in venus_boot_no_tz()
169 venus_reset_cpu(core); in venus_boot_no_tz()
174 static int venus_shutdown_no_tz(struct venus_core *core) in venus_shutdown_no_tz() argument
176 const size_t mapped = core->fw.mapped_mem_size; in venus_shutdown_no_tz()
180 struct device *dev = core->fw.dev; in venus_shutdown_no_tz()
181 void __iomem *wrapper_base = core->wrapper_base; in venus_shutdown_no_tz()
182 void __iomem *wrapper_tz_base = core->wrapper_tz_base; in venus_shutdown_no_tz()
184 if (IS_IRIS2_1(core)) { in venus_shutdown_no_tz()
196 iommu = core->fw.iommu_domain; in venus_shutdown_no_tz()
198 if (core->fw.mapped_mem_size && iommu) { in venus_shutdown_no_tz()
204 core->fw.mapped_mem_size = 0; in venus_shutdown_no_tz()
210 int venus_boot(struct venus_core *core) in venus_boot() argument
212 struct device *dev = core->dev; in venus_boot()
213 const struct venus_resources *res = core->res; in venus_boot()
220 (core->use_tz && !qcom_scm_is_available())) in venus_boot()
226 fwpath = core->res->fwname; in venus_boot()
228 ret = venus_load_fw(core, fwpath, &mem_phys, &mem_size); in venus_boot()
234 core->fw.mem_size = mem_size; in venus_boot()
235 core->fw.mem_phys = mem_phys; in venus_boot()
237 if (core->use_tz) in venus_boot()
240 ret = venus_boot_no_tz(core, mem_phys, mem_size); in venus_boot()
245 if (core->use_tz && res->cp_size) { in venus_boot()
271 int venus_shutdown(struct venus_core *core) in venus_shutdown() argument
275 if (core->use_tz) in venus_shutdown()
278 ret = venus_shutdown_no_tz(core); in venus_shutdown()
283 int venus_firmware_init(struct venus_core *core) in venus_firmware_init() argument
291 np = of_get_child_by_name(core->dev->of_node, "video-firmware"); in venus_firmware_init()
293 core->use_tz = true; in venus_firmware_init()
299 info.parent = core->dev; in venus_firmware_init()
313 dev_err(core->dev, "dma configure fail\n"); in venus_firmware_init()
317 core->fw.dev = &pdev->dev; in venus_firmware_init()
319 iommu_dom = iommu_paging_domain_alloc(core->fw.dev); in venus_firmware_init()
321 dev_err(core->fw.dev, "Failed to allocate iommu domain\n"); in venus_firmware_init()
326 ret = iommu_attach_device(iommu_dom, core->fw.dev); in venus_firmware_init()
328 dev_err(core->fw.dev, "could not attach device\n"); in venus_firmware_init()
332 core->fw.iommu_domain = iommu_dom; in venus_firmware_init()
346 void venus_firmware_deinit(struct venus_core *core) in venus_firmware_deinit() argument
350 if (!core->fw.dev) in venus_firmware_deinit()
353 iommu = core->fw.iommu_domain; in venus_firmware_deinit()
355 iommu_detach_device(iommu, core->fw.dev); in venus_firmware_deinit()
357 if (core->fw.iommu_domain) { in venus_firmware_deinit()
359 core->fw.iommu_domain = NULL; in venus_firmware_deinit()
362 platform_device_unregister(to_platform_device(core->fw.dev)); in venus_firmware_deinit()