Lines Matching full:carveout

196 	struct rproc_mem_entry *carveout;  in rproc_da_to_va()  local
205 list_for_each_entry(carveout, &rproc->carveouts, node) { in rproc_da_to_va()
206 int offset = da - carveout->da; in rproc_da_to_va()
208 /* Verify that carveout is allocated */ in rproc_da_to_va()
209 if (!carveout->va) in rproc_da_to_va()
212 /* try next carveout if da is too small */ in rproc_da_to_va()
216 /* try next carveout if da is too large */ in rproc_da_to_va()
217 if (offset + len > carveout->len) in rproc_da_to_va()
220 ptr = carveout->va + offset; in rproc_da_to_va()
223 *is_iomem = carveout->is_iomem; in rproc_da_to_va()
234 * rproc_find_carveout_by_name() - lookup the carveout region by a name
236 * @name: carveout name to find (format string)
239 * Platform driver has the capability to register some pre-allacoted carveout
249 * Return: a valid pointer on carveout entry on success or NULL on failure.
257 struct rproc_mem_entry *carveout, *mem = NULL; in rproc_find_carveout_by_name() local
266 list_for_each_entry(carveout, &rproc->carveouts, node) { in rproc_find_carveout_by_name()
267 /* Compare carveout and requested names */ in rproc_find_carveout_by_name()
268 if (!strcmp(carveout->name, _name)) { in rproc_find_carveout_by_name()
269 mem = carveout; in rproc_find_carveout_by_name()
278 * rproc_check_carveout_da() - Check specified carveout da configuration
280 * @mem: pointer on carveout to check
285 * da, len) is part of specified carveout.
289 * Return: 0 if carveout matches request else error
299 dev_err(dev, "Registered carveout doesn't fit len request\n"); in rproc_check_carveout_da()
304 /* Address doesn't match registered carveout configuration */ in rproc_check_carveout_da()
309 /* Check requested resource belongs to registered carveout */ in rproc_check_carveout_da()
312 "Registered carveout doesn't fit da request\n"); in rproc_check_carveout_da()
318 "Registered carveout doesn't fit len request\n"); in rproc_check_carveout_da()
341 /* Search for pre-registered carveout */ in rproc_alloc_vring()
348 /* Register carveout in list */ in rproc_alloc_vring()
676 * rproc_alloc_carveout() - allocated specified carveout
702 dev_dbg(dev, "carveout va %pK, dma %pad, len 0x%zx\n", in rproc_alloc_carveout()
714 "Allocated carveout doesn't fit device address request\n"); in rproc_alloc_carveout()
759 dev_dbg(dev, "carveout mapped 0x%x to %pad\n", in rproc_alloc_carveout()
784 * rproc_release_carveout() - release acquired carveout
798 /* clean up carveout allocations */ in rproc_release_carveout()
828 struct rproc_mem_entry *carveout; in rproc_handle_carveout() local
832 dev_err(dev, "carveout rsc is truncated\n"); in rproc_handle_carveout()
838 dev_err(dev, "carveout rsc has non zero reserved bytes\n"); in rproc_handle_carveout()
842 dev_dbg(dev, "carveout rsc: name: %s, da 0x%x, pa 0x%x, len 0x%x, flags 0x%x\n", in rproc_handle_carveout()
846 * Check carveout rsc already part of a registered carveout, in rproc_handle_carveout()
849 carveout = rproc_find_carveout_by_name(rproc, rsc->name); in rproc_handle_carveout()
851 if (carveout) { in rproc_handle_carveout()
852 if (carveout->rsc_offset != FW_RSC_ADDR_ANY) { in rproc_handle_carveout()
854 "Carveout already associated to resource table\n"); in rproc_handle_carveout()
858 if (rproc_check_carveout_da(rproc, carveout, rsc->da, rsc->len)) in rproc_handle_carveout()
861 /* Update memory carveout with resource table info */ in rproc_handle_carveout()
862 carveout->rsc_offset = offset; in rproc_handle_carveout()
863 carveout->flags = rsc->flags; in rproc_handle_carveout()
868 /* Register carveout in list */ in rproc_handle_carveout()
869 carveout = rproc_mem_entry_init(dev, NULL, 0, rsc->len, rsc->da, in rproc_handle_carveout()
872 if (!carveout) { in rproc_handle_carveout()
877 carveout->flags = rsc->flags; in rproc_handle_carveout()
878 carveout->rsc_offset = offset; in rproc_handle_carveout()
879 rproc_add_carveout(rproc, carveout); in rproc_handle_carveout()
885 * rproc_add_carveout() - register an allocated carveout region
890 * Specified carveout should have been allocated before registering.
903 * @len: memory carveout length
905 * @alloc: memory carveout allocation function
906 * @release: memory carveout release function
907 * @name: carveout name
951 * @len: memory carveout length
953 * @name: carveout name
1148 * This function parses registered carveout list, performs allocation
1166 dev_err(dev, "Unable to allocate carveout %s: %d\n", in rproc_alloc_registered_carveouts()
1251 /* clean up carveout allocations */ in rproc_resource_cleanup()
1426 /* Allocate carveout resources associated to rproc */ in rproc_fw_boot()
1640 /* Allocate carveout resources associated to rproc */ in rproc_attach()