Lines Matching full:vic
24 #include "vic.h"
31 struct vic { struct
46 static inline struct vic *to_vic(struct tegra_drm_client *client) in to_vic() argument
48 return container_of(client, struct vic, client); in to_vic()
51 static void vic_writel(struct vic *vic, u32 value, unsigned int offset) in vic_writel() argument
53 writel(value, vic->regs + offset); in vic_writel()
58 struct vic *vic = dev_get_drvdata(dev); in vic_runtime_resume() local
60 return clk_prepare_enable(vic->clk); in vic_runtime_resume()
65 struct vic *vic = dev_get_drvdata(dev); in vic_runtime_suspend() local
67 clk_disable_unprepare(vic->clk); in vic_runtime_suspend()
69 vic->booted = false; in vic_runtime_suspend()
74 static int vic_boot(struct vic *vic) in vic_boot() argument
80 if (vic->booted) in vic_boot()
84 vic_writel(vic, CG_IDLE_CG_DLY_CNT(4) | 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()
145 struct vic *vic = to_vic(drm); in vic_init() local
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()
187 host1x_channel_put(vic->channel); in vic_init()
201 struct vic *vic = to_vic(drm); in vic_exit() local
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()
227 struct vic *vic = to_vic(client); in vic_open_channel() local
230 err = pm_runtime_get_sync(vic->dev); in vic_open_channel()
234 err = vic_boot(vic); 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()
242 pm_runtime_put(vic->dev); in vic_open_channel()
251 struct vic *vic = to_vic(context->client); in vic_close_channel() local
255 pm_runtime_put(vic->dev); in vic_close_channel()
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 },
297 struct vic *vic; in vic_probe() local
300 vic = devm_kzalloc(dev, sizeof(*vic), GFP_KERNEL); in vic_probe()
301 if (!vic) in vic_probe()
304 vic->config = of_device_get_match_data(dev); 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()
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()
338 platform_set_drvdata(pdev, vic); 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()
369 host1x_client_unregister(&vic->client.base); in vic_probe()
371 falcon_exit(&vic->falcon); in vic_probe()
378 struct vic *vic = platform_get_drvdata(pdev); in vic_remove() local
381 err = host1x_client_unregister(&vic->client.base); in vic_remove()
393 falcon_exit(&vic->falcon); in vic_remove()
404 .name = "tegra-vic",