Lines Matching full:carveout

195 	struct rproc_mem_entry *carveout;  in rproc_da_to_va()  local
204 list_for_each_entry(carveout, &rproc->carveouts, node) { in rproc_da_to_va()
205 int offset = da - carveout->da; in rproc_da_to_va()
207 /* Verify that carveout is allocated */ in rproc_da_to_va()
208 if (!carveout->va) in rproc_da_to_va()
211 /* try next carveout if da is too small */ in rproc_da_to_va()
215 /* try next carveout if da is too large */ in rproc_da_to_va()
216 if (offset + len > carveout->len) in rproc_da_to_va()
219 ptr = carveout->va + offset; in rproc_da_to_va()
222 *is_iomem = carveout->is_iomem; in rproc_da_to_va()
233 * rproc_find_carveout_by_name() - lookup the carveout region by a name
235 * @name: carveout name to find (format string)
238 * Platform driver has the capability to register some pre-allacoted carveout
248 * Return: a valid pointer on carveout entry on success or NULL on failure.
256 struct rproc_mem_entry *carveout, *mem = NULL; in rproc_find_carveout_by_name() local
265 list_for_each_entry(carveout, &rproc->carveouts, node) { in rproc_find_carveout_by_name()
266 /* Compare carveout and requested names */ in rproc_find_carveout_by_name()
267 if (!strcmp(carveout->name, _name)) { in rproc_find_carveout_by_name()
268 mem = carveout; in rproc_find_carveout_by_name()
277 * rproc_check_carveout_da() - Check specified carveout da configuration
279 * @mem: pointer on carveout to check
284 * da, len) is part of specified carveout.
288 * Return: 0 if carveout matches request else error
298 dev_err(dev, "Registered carveout doesn't fit len request\n"); in rproc_check_carveout_da()
303 /* Address doesn't match registered carveout configuration */ in rproc_check_carveout_da()
308 /* Check requested resource belongs to registered carveout */ in rproc_check_carveout_da()
311 "Registered carveout doesn't fit da request\n"); in rproc_check_carveout_da()
317 "Registered carveout doesn't fit len request\n"); in rproc_check_carveout_da()
340 /* Search for pre-registered carveout */ in rproc_alloc_vring()
347 /* Register carveout in list */ in rproc_alloc_vring()
668 * rproc_alloc_carveout() - allocated specified carveout
694 dev_dbg(dev, "carveout va %pK, dma %pad, len 0x%zx\n", in rproc_alloc_carveout()
706 "Allocated carveout doesn't fit device address request\n"); in rproc_alloc_carveout()
751 dev_dbg(dev, "carveout mapped 0x%x to %pad\n", in rproc_alloc_carveout()
776 * rproc_release_carveout() - release acquired carveout
790 /* clean up carveout allocations */ in rproc_release_carveout()
820 struct rproc_mem_entry *carveout; in rproc_handle_carveout() local
824 dev_err(dev, "carveout rsc is truncated\n"); in rproc_handle_carveout()
830 dev_err(dev, "carveout rsc has non zero reserved bytes\n"); in rproc_handle_carveout()
834 dev_dbg(dev, "carveout rsc: name: %s, da 0x%x, pa 0x%x, len 0x%x, flags 0x%x\n", in rproc_handle_carveout()
838 * Check carveout rsc already part of a registered carveout, in rproc_handle_carveout()
841 carveout = rproc_find_carveout_by_name(rproc, rsc->name); in rproc_handle_carveout()
843 if (carveout) { in rproc_handle_carveout()
844 if (carveout->rsc_offset != FW_RSC_ADDR_ANY) { in rproc_handle_carveout()
846 "Carveout already associated to resource table\n"); in rproc_handle_carveout()
850 if (rproc_check_carveout_da(rproc, carveout, rsc->da, rsc->len)) in rproc_handle_carveout()
853 /* Update memory carveout with resource table info */ in rproc_handle_carveout()
854 carveout->rsc_offset = offset; in rproc_handle_carveout()
855 carveout->flags = rsc->flags; in rproc_handle_carveout()
860 /* Register carveout in list */ in rproc_handle_carveout()
861 carveout = rproc_mem_entry_init(dev, NULL, 0, rsc->len, rsc->da, in rproc_handle_carveout()
864 if (!carveout) { in rproc_handle_carveout()
869 carveout->flags = rsc->flags; in rproc_handle_carveout()
870 carveout->rsc_offset = offset; in rproc_handle_carveout()
871 rproc_add_carveout(rproc, carveout); in rproc_handle_carveout()
877 * rproc_add_carveout() - register an allocated carveout region
882 * Specified carveout should have been allocated before registering.
895 * @len: memory carveout length
897 * @alloc: memory carveout allocation function
898 * @release: memory carveout release function
899 * @name: carveout name
943 * @len: memory carveout length
945 * @name: carveout name
1140 * This function parses registered carveout list, performs allocation
1158 dev_err(dev, "Unable to allocate carveout %s: %d\n", in rproc_alloc_registered_carveouts()
1243 /* clean up carveout allocations */ in rproc_resource_cleanup()
1418 /* Allocate carveout resources associated to rproc */ in rproc_fw_boot()
1632 /* Allocate carveout resources associated to rproc */ in rproc_attach()