/** * struct wkup_m3_mem - WkupM3 internal memory structure * @cpu_addr: MPU virtual address of the memory region * @bus_addr: Bus address used to access the memory region * @dev_addr: Device address from Wakeup M3 view * @size: Size of the memory region
*/ struct wkup_m3_mem { void __iomem *cpu_addr;
phys_addr_t bus_addr;
u32 dev_addr;
size_t size;
};
for (i = 0; i < WKUPM3_MEM_MAX; i++) { if (da >= wkupm3->mem[i].dev_addr && da + len <=
wkupm3->mem[i].dev_addr + wkupm3->mem[i].size) {
offset = da - wkupm3->mem[i].dev_addr; /* __force to make sparse happy with type conversion */
va = (__force void *)(wkupm3->mem[i].cpu_addr + offset); break;
}
}
wkupm3->rsts = devm_reset_control_get_optional_shared(dev, "rstctrl"); if (IS_ERR(wkupm3->rsts)) return PTR_ERR(wkupm3->rsts); if (!wkupm3->rsts) { if (!(pdata && pdata->deassert_reset && pdata->assert_reset &&
pdata->reset_name)) {
dev_err(dev, "Platform data missing!\n");
ret = -ENODEV; goto err_put_rproc;
}
}
for (i = 0; i < ARRAY_SIZE(mem_names); i++) {
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
mem_names[i]);
wkupm3->mem[i].cpu_addr = devm_ioremap_resource(dev, res); if (IS_ERR(wkupm3->mem[i].cpu_addr)) {
dev_err(&pdev->dev, "devm_ioremap_resource failed for resource %d\n",
i);
ret = PTR_ERR(wkupm3->mem[i].cpu_addr); goto err_put_rproc;
}
wkupm3->mem[i].bus_addr = res->start;
wkupm3->mem[i].size = resource_size(res);
addrp = of_get_address(dev->of_node, i, &size, NULL); /* * The wkupm3 has umem at address 0 in its view, so the device * addresses for each memory region is computed as a relative * offset of the bus address for umem, and therefore needs to be * processed first.
*/ if (!strcmp(mem_names[i], "umem"))
l4_offset = be32_to_cpu(*addrp);
wkupm3->mem[i].dev_addr = be32_to_cpu(*addrp) - l4_offset;
}
dev_set_drvdata(dev, rproc);
ret = rproc_add(rproc); if (ret) {
dev_err(dev, "rproc_add failed\n"); goto err_put_rproc;
}
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.