Lines Matching +full:tegra210 +full:- +full:pmc
20 #include <soc/tegra/pmc.h>
53 writel(value, vic->regs + offset); in vic_writel()
60 return clk_prepare_enable(vic->clk); in vic_runtime_resume()
67 clk_disable_unprepare(vic->clk); in vic_runtime_suspend()
69 vic->booted = false; in vic_runtime_suspend()
80 if (vic->booted) in vic_boot()
89 err = falcon_boot(&vic->falcon); in vic_boot()
93 hdr = vic->falcon.firmware.vaddr; in vic_boot()
95 hdr = vic->falcon.firmware.vaddr + in vic_boot()
99 falcon_execute_method(&vic->falcon, VIC_SET_APPLICATION_ID, 1); in vic_boot()
100 falcon_execute_method(&vic->falcon, VIC_SET_FCE_UCODE_SIZE, in vic_boot()
102 falcon_execute_method(&vic->falcon, VIC_SET_FCE_UCODE_OFFSET, in vic_boot()
103 (vic->falcon.firmware.paddr + fce_bin_data_offset) in vic_boot()
106 err = falcon_wait_idle(&vic->falcon); in vic_boot()
108 dev_err(vic->dev, in vic_boot()
113 vic->booted = true; in vic_boot()
121 struct tegra_drm *tegra = falcon->data; in vic_falcon_alloc()
129 struct tegra_drm *tegra = falcon->data; in vic_falcon_free()
142 struct iommu_group *group = iommu_group_get(client->dev); in vic_init()
143 struct drm_device *dev = dev_get_drvdata(client->parent); in vic_init()
144 struct tegra_drm *tegra = dev->dev_private; in vic_init()
148 if (group && tegra->domain) { in vic_init()
149 err = iommu_attach_group(tegra->domain, group); in vic_init()
151 dev_err(vic->dev, "failed to attach to domain: %d\n", in vic_init()
156 vic->domain = tegra->domain; in vic_init()
159 if (!vic->falcon.data) { in vic_init()
160 vic->falcon.data = tegra; in vic_init()
161 err = falcon_load_firmware(&vic->falcon); in vic_init()
166 vic->channel = host1x_channel_request(client->dev); in vic_init()
167 if (!vic->channel) { in vic_init()
168 err = -ENOMEM; in vic_init()
172 client->syncpts[0] = host1x_syncpt_request(client, 0); in vic_init()
173 if (!client->syncpts[0]) { in vic_init()
174 err = -ENOMEM; in vic_init()
185 host1x_syncpt_free(client->syncpts[0]); in vic_init()
187 host1x_channel_put(vic->channel); in vic_init()
189 if (group && tegra->domain) in vic_init()
190 iommu_detach_group(tegra->domain, group); in vic_init()
198 struct iommu_group *group = iommu_group_get(client->dev); in vic_exit()
199 struct drm_device *dev = dev_get_drvdata(client->parent); in vic_exit()
200 struct tegra_drm *tegra = dev->dev_private; in vic_exit()
208 host1x_syncpt_free(client->syncpts[0]); in vic_exit()
209 host1x_channel_put(vic->channel); in vic_exit()
211 if (vic->domain) { in vic_exit()
212 iommu_detach_group(vic->domain, group); in vic_exit()
213 vic->domain = NULL; in vic_exit()
230 err = pm_runtime_get_sync(vic->dev); in vic_open_channel()
236 pm_runtime_put(vic->dev); in vic_open_channel()
240 context->channel = host1x_channel_get(vic->channel); in vic_open_channel()
241 if (!context->channel) { in vic_open_channel()
242 pm_runtime_put(vic->dev); in vic_open_channel()
243 return -ENOMEM; in vic_open_channel()
251 struct vic *vic = to_vic(context->client); in vic_close_channel()
253 host1x_channel_put(context->channel); in vic_close_channel()
255 pm_runtime_put(vic->dev); in vic_close_channel()
271 #define NVIDIA_TEGRA_210_VIC_FIRMWARE "nvidia/tegra210/vic04_ucode.bin"
286 { .compatible = "nvidia,tegra124-vic", .data = &vic_t124_config },
287 { .compatible = "nvidia,tegra210-vic", .data = &vic_t210_config },
288 { .compatible = "nvidia,tegra186-vic", .data = &vic_t186_config },
294 struct device *dev = &pdev->dev; in vic_probe()
302 return -ENOMEM; in vic_probe()
304 vic->config = of_device_get_match_data(dev); in vic_probe()
308 return -ENOMEM; in vic_probe()
312 dev_err(&pdev->dev, "failed to get registers\n"); in vic_probe()
313 return -ENXIO; in vic_probe()
316 vic->regs = devm_ioremap_resource(dev, regs); in vic_probe()
317 if (IS_ERR(vic->regs)) in vic_probe()
318 return PTR_ERR(vic->regs); in vic_probe()
320 vic->clk = devm_clk_get(dev, NULL); in vic_probe()
321 if (IS_ERR(vic->clk)) { in vic_probe()
322 dev_err(&pdev->dev, "failed to get clock\n"); in vic_probe()
323 return PTR_ERR(vic->clk); in vic_probe()
326 vic->falcon.dev = dev; in vic_probe()
327 vic->falcon.regs = vic->regs; in vic_probe()
328 vic->falcon.ops = &vic_falcon_ops; in vic_probe()
330 err = falcon_init(&vic->falcon); in vic_probe()
334 err = falcon_read_firmware(&vic->falcon, vic->config->firmware); in vic_probe()
340 INIT_LIST_HEAD(&vic->client.base.list); in vic_probe()
341 vic->client.base.ops = &vic_client_ops; in vic_probe()
342 vic->client.base.dev = dev; in vic_probe()
343 vic->client.base.class = HOST1X_CLASS_VIC; in vic_probe()
344 vic->client.base.syncpts = syncpts; in vic_probe()
345 vic->client.base.num_syncpts = 1; in vic_probe()
346 vic->dev = dev; in vic_probe()
348 INIT_LIST_HEAD(&vic->client.list); in vic_probe()
349 vic->client.version = vic->config->version; in vic_probe()
350 vic->client.ops = &vic_ops; in vic_probe()
352 err = host1x_client_register(&vic->client.base); in vic_probe()
359 pm_runtime_enable(&pdev->dev); in vic_probe()
360 if (!pm_runtime_enabled(&pdev->dev)) { in vic_probe()
361 err = vic_runtime_resume(&pdev->dev); in vic_probe()
369 host1x_client_unregister(&vic->client.base); in vic_probe()
371 falcon_exit(&vic->falcon); in vic_probe()
381 err = host1x_client_unregister(&vic->client.base); in vic_remove()
383 dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", in vic_remove()
388 if (pm_runtime_enabled(&pdev->dev)) in vic_remove()
389 pm_runtime_disable(&pdev->dev); in vic_remove()
391 vic_runtime_suspend(&pdev->dev); in vic_remove()
393 falcon_exit(&vic->falcon); in vic_remove()
404 .name = "tegra-vic",