Lines Matching +full:dma +full:- +full:mem
1 // SPDX-License-Identifier: GPL-2.0
13 #include <linux/soc/renesas/rcar-rst.h>
22 struct rproc_mem_entry *mem) in rcar_rproc_mem_alloc() argument
24 struct device *dev = &rproc->dev; in rcar_rproc_mem_alloc()
27 dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len); in rcar_rproc_mem_alloc()
28 va = ioremap_wc(mem->dma, mem->len); in rcar_rproc_mem_alloc()
31 &mem->dma, mem->len); in rcar_rproc_mem_alloc()
32 return -ENOMEM; in rcar_rproc_mem_alloc()
36 mem->va = va; in rcar_rproc_mem_alloc()
42 struct rproc_mem_entry *mem) in rcar_rproc_mem_release() argument
44 dev_dbg(&rproc->dev, "unmap memory: %pa\n", &mem->dma); in rcar_rproc_mem_release()
45 iounmap(mem->va); in rcar_rproc_mem_release()
52 struct device *dev = rproc->dev.parent; in rcar_rproc_prepare()
53 struct device_node *np = dev->of_node; in rcar_rproc_prepare()
55 struct rproc_mem_entry *mem; in rcar_rproc_prepare() local
60 of_phandle_iterator_init(&it, np, "memory-region", NULL, 0); in rcar_rproc_prepare()
65 dev_err(&rproc->dev, in rcar_rproc_prepare()
66 "unable to acquire memory-region\n"); in rcar_rproc_prepare()
67 return -EINVAL; in rcar_rproc_prepare()
70 if (rmem->base > U32_MAX) in rcar_rproc_prepare()
71 return -EINVAL; in rcar_rproc_prepare()
73 /* No need to translate pa to da, R-Car use same map */ in rcar_rproc_prepare()
74 da = rmem->base; in rcar_rproc_prepare()
75 mem = rproc_mem_entry_init(dev, NULL, in rcar_rproc_prepare()
76 rmem->base, in rcar_rproc_prepare()
77 rmem->size, da, in rcar_rproc_prepare()
80 it.node->name); in rcar_rproc_prepare()
82 if (!mem) in rcar_rproc_prepare()
83 return -ENOMEM; in rcar_rproc_prepare()
85 rproc_add_carveout(rproc, mem); in rcar_rproc_prepare()
97 dev_info(&rproc->dev, "No resource table in elf\n"); in rcar_rproc_parse_fw()
104 struct rcar_rproc *priv = rproc->priv; in rcar_rproc_start()
107 if (!rproc->bootaddr) in rcar_rproc_start()
108 return -EINVAL; in rcar_rproc_start()
110 err = rcar_rst_set_rproc_boot_addr(rproc->bootaddr); in rcar_rproc_start()
112 dev_err(&rproc->dev, "failed to set rproc boot addr\n"); in rcar_rproc_start()
116 err = reset_control_deassert(priv->rst); in rcar_rproc_start()
118 dev_err(&rproc->dev, "failed to deassert reset\n"); in rcar_rproc_start()
125 struct rcar_rproc *priv = rproc->priv; in rcar_rproc_stop()
128 err = reset_control_assert(priv->rst); in rcar_rproc_stop()
130 dev_err(&rproc->dev, "failed to assert reset\n"); in rcar_rproc_stop()
149 struct device *dev = &pdev->dev; in rcar_rproc_probe()
150 struct device_node *np = dev->of_node; in rcar_rproc_probe()
155 rproc = devm_rproc_alloc(dev, np->name, &rcar_rproc_ops, in rcar_rproc_probe()
158 return -ENOMEM; in rcar_rproc_probe()
160 priv = rproc->priv; in rcar_rproc_probe()
162 priv->rst = devm_reset_control_get_exclusive(dev, NULL); in rcar_rproc_probe()
163 if (IS_ERR(priv->rst)) { in rcar_rproc_probe()
164 ret = PTR_ERR(priv->rst); in rcar_rproc_probe()
179 rproc->auto_boot = false; in rcar_rproc_probe()
197 struct device *dev = &pdev->dev; in rcar_rproc_remove()
205 { .compatible = "renesas,rcar-cr7" },
215 .name = "rcar-rproc",
223 MODULE_DESCRIPTION("Renesas R-Car Gen3 remote processor control driver");