Re: [PATCH v2 2/2] drivers: remoteproc: Add C906L controller for Sophgo CV1800B SoC
From: Krzysztof Kozlowski
Date: Wed Jul 30 2025 - 02:46:46 EST
On 28/07/2025 13:03, Junhui Liu wrote:
> +
> +static int cv1800b_c906l_mem_alloc(struct rproc *rproc,
> + struct rproc_mem_entry *mem)
> +{
> + void __iomem *va;
> +
> + va = ioremap_wc(mem->dma, mem->len);
> + if (!va)
> + return -ENOMEM;
> +
> + /* Update memory entry va */
> + mem->va = (void *)va;
> +
> + return 0;
> +}
> +
> +static int cv1800b_c906l_mem_release(struct rproc *rproc,
> + struct rproc_mem_entry *mem)
> +{
> + iounmap((void __iomem *)mem->va);
> + return 0;
> +}
> +
> +static int cv1800b_c906l_add_carveout(struct rproc *rproc)
> +{
> + struct device *dev = rproc->dev.parent;
> + struct device_node *np = dev->of_node;
> + struct of_phandle_iterator it;
> + struct rproc_mem_entry *mem;
> + struct reserved_mem *rmem;
> + int i = 0;
> +
> + /* Register associated reserved memory regions */
> + of_phandle_iterator_init(&it, np, "memory-region", NULL, 0);
> + while (of_phandle_iterator_next(&it) == 0) {
> + rmem = of_reserved_mem_lookup(it.node);
> + if (!rmem) {
> + of_node_put(it.node);
> + return -EINVAL;
> + }
> +
> + if (!strcmp(it.node->name, "vdev0buffer")) {
Why are you adding undocumented ABI? And so hidden, not even using
standard OF API!
How does this behaves when I change your DTS to call it
"whateverbuffer"? Does it work? Obviously not.
No, stop doing that.
Best regards,
Krzysztof