for (i = 0; i < ST_SLIM_MEM_MAX; i++) { if (da != slim_rproc->mem[i].bus_addr) continue;
if (len <= slim_rproc->mem[i].size) { /* __force to make sparse happy with type conversion */
va = (__force void *)slim_rproc->mem[i].cpu_addr; break;
}
}
dev_dbg(&rproc->dev, "da = 0x%llx len = 0x%zx va = 0x%p\n",
da, len, va);
/** * st_slim_rproc_alloc() - allocate and initialise slim rproc * @pdev: Pointer to the platform_device struct * @fw_name: Name of firmware for rproc to use * * Function for allocating and initialising a slim rproc for use by * device drivers whose IP is based around the SLIM core. It * obtains and enables any clocks required by the SLIM core and also * ioremaps the various IO. * * Return: st_slim_rproc pointer or PTR_ERR() on error.
*/
slim_rproc->slimcore = devm_platform_ioremap_resource_byname(pdev, "slimcore"); if (IS_ERR(slim_rproc->slimcore)) {
dev_err(&pdev->dev, "failed to ioremap slimcore IO\n");
err = PTR_ERR(slim_rproc->slimcore); goto err;
}
slim_rproc->peri = devm_platform_ioremap_resource_byname(pdev, "peripherals"); if (IS_ERR(slim_rproc->peri)) {
dev_err(&pdev->dev, "failed to ioremap peripherals IO\n");
err = PTR_ERR(slim_rproc->peri); goto err;
}
err = slim_clk_get(slim_rproc, dev); if (err) goto err;
err = slim_clk_enable(slim_rproc); if (err) {
dev_err(dev, "Failed to enable clocks\n"); goto err_clk_put;
}
/* Register as a remoteproc device */
err = rproc_add(rproc); if (err) {
dev_err(dev, "registration of slim remoteproc failed\n"); goto err_clk_dis;
}
return slim_rproc;
err_clk_dis:
slim_clk_disable(slim_rproc);
err_clk_put: for (i = 0; i < ST_SLIM_MAX_CLK && slim_rproc->clks[i]; i++)
clk_put(slim_rproc->clks[i]);
err:
rproc_free(rproc); return ERR_PTR(err);
}
EXPORT_SYMBOL(st_slim_rproc_alloc);
/** * st_slim_rproc_put() - put slim rproc resources * @slim_rproc: Pointer to the st_slim_rproc struct * * Function for calling respective _put() functions on slim_rproc resources. *
*/ void st_slim_rproc_put(struct st_slim_rproc *slim_rproc)
{ int clk;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.