Lines Matching +full:dma +full:- +full:mem
1 // SPDX-License-Identifier: GPL-2.0
14 #include <linux/soc/renesas/rcar-rst.h>
23 struct rproc_mem_entry *mem) in rcar_rproc_mem_alloc() argument
25 struct device *dev = &rproc->dev; in rcar_rproc_mem_alloc()
28 dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len); in rcar_rproc_mem_alloc()
29 va = ioremap_wc(mem->dma, mem->len); in rcar_rproc_mem_alloc()
32 &mem->dma, mem->len); in rcar_rproc_mem_alloc()
33 return -ENOMEM; in rcar_rproc_mem_alloc()
37 mem->va = va; in rcar_rproc_mem_alloc()
43 struct rproc_mem_entry *mem) in rcar_rproc_mem_release() argument
45 dev_dbg(&rproc->dev, "unmap memory: %pa\n", &mem->dma); in rcar_rproc_mem_release()
46 iounmap(mem->va); in rcar_rproc_mem_release()
53 struct device *dev = rproc->dev.parent; in rcar_rproc_prepare()
54 struct device_node *np = dev->of_node; in rcar_rproc_prepare()
56 struct rproc_mem_entry *mem; in rcar_rproc_prepare() local
61 of_phandle_iterator_init(&it, np, "memory-region", NULL, 0); in rcar_rproc_prepare()
67 dev_err(&rproc->dev, in rcar_rproc_prepare()
68 "unable to acquire memory-region\n"); in rcar_rproc_prepare()
69 return -EINVAL; in rcar_rproc_prepare()
72 if (rmem->base > U32_MAX) { in rcar_rproc_prepare()
74 return -EINVAL; in rcar_rproc_prepare()
77 /* No need to translate pa to da, R-Car use same map */ in rcar_rproc_prepare()
78 da = rmem->base; in rcar_rproc_prepare()
79 mem = rproc_mem_entry_init(dev, NULL, in rcar_rproc_prepare()
80 rmem->base, in rcar_rproc_prepare()
81 rmem->size, da, in rcar_rproc_prepare()
84 it.node->name); in rcar_rproc_prepare()
86 if (!mem) { in rcar_rproc_prepare()
88 return -ENOMEM; in rcar_rproc_prepare()
91 rproc_add_carveout(rproc, mem); in rcar_rproc_prepare()
103 dev_info(&rproc->dev, "No resource table in elf\n"); in rcar_rproc_parse_fw()
110 struct rcar_rproc *priv = rproc->priv; in rcar_rproc_start()
113 if (!rproc->bootaddr) in rcar_rproc_start()
114 return -EINVAL; in rcar_rproc_start()
116 err = rcar_rst_set_rproc_boot_addr(rproc->bootaddr); in rcar_rproc_start()
118 dev_err(&rproc->dev, "failed to set rproc boot addr\n"); in rcar_rproc_start()
122 err = reset_control_deassert(priv->rst); in rcar_rproc_start()
124 dev_err(&rproc->dev, "failed to deassert reset\n"); in rcar_rproc_start()
131 struct rcar_rproc *priv = rproc->priv; in rcar_rproc_stop()
134 err = reset_control_assert(priv->rst); in rcar_rproc_stop()
136 dev_err(&rproc->dev, "failed to assert reset\n"); in rcar_rproc_stop()
155 struct device *dev = &pdev->dev; in rcar_rproc_probe()
156 struct device_node *np = dev->of_node; in rcar_rproc_probe()
161 rproc = devm_rproc_alloc(dev, np->name, &rcar_rproc_ops, in rcar_rproc_probe()
164 return -ENOMEM; in rcar_rproc_probe()
166 priv = rproc->priv; in rcar_rproc_probe()
168 priv->rst = devm_reset_control_get_exclusive(dev, NULL); in rcar_rproc_probe()
169 if (IS_ERR(priv->rst)) { in rcar_rproc_probe()
170 ret = PTR_ERR(priv->rst); in rcar_rproc_probe()
185 rproc->auto_boot = false; in rcar_rproc_probe()
203 struct device *dev = &pdev->dev; in rcar_rproc_remove()
209 { .compatible = "renesas,rcar-cr7" },
219 .name = "rcar-rproc",
227 MODULE_DESCRIPTION("Renesas R-Car Gen3 remote processor control driver");