Lines Matching refs:block

55 static int sram_add_pool(struct sram_dev *sram, struct sram_reserve *block,  in sram_add_pool()  argument
61 NUMA_NO_NODE, block->label); in sram_add_pool()
66 block->size, NUMA_NO_NODE); in sram_add_pool()
75 static int sram_add_export(struct sram_dev *sram, struct sram_reserve *block, in sram_add_export() argument
88 part->battr.size = block->size; in sram_add_export()
93 static int sram_add_partition(struct sram_dev *sram, struct sram_reserve *block, in sram_add_partition() argument
105 virt_base = devm_ioremap_resource(sram->dev, &block->res); in sram_add_partition()
107 virt_base = devm_ioremap_resource_wc(sram->dev, &block->res); in sram_add_partition()
110 dev_err(sram->dev, "could not map SRAM at %pr\n", &block->res); in sram_add_partition()
116 part->base = sram->virt_base + block->start; in sram_add_partition()
119 if (block->pool) { in sram_add_partition()
120 ret = sram_add_pool(sram, block, start, part); in sram_add_partition()
124 if (block->export) { in sram_add_partition()
125 ret = sram_add_export(sram, block, start, part); in sram_add_partition()
129 if (block->protect_exec) { in sram_add_partition()
130 ret = sram_check_protect_exec(sram, block, part); in sram_add_partition()
134 ret = sram_add_pool(sram, block, start, part); in sram_add_partition()
177 struct sram_reserve *rblocks, *block; in sram_reserve_regions() local
196 block = &rblocks[0]; in sram_reserve_regions()
216 block->start = child_res.start - res->start; in sram_reserve_regions()
217 block->size = resource_size(&child_res); in sram_reserve_regions()
218 block->res = child_res; in sram_reserve_regions()
219 list_add_tail(&block->list, &reserve_list); in sram_reserve_regions()
222 block->export = true; in sram_reserve_regions()
225 block->pool = true; in sram_reserve_regions()
228 block->protect_exec = true; in sram_reserve_regions()
230 if ((block->export || block->pool || block->protect_exec) && in sram_reserve_regions()
231 block->size) { in sram_reserve_regions()
245 block->label = devm_kstrdup(sram->dev, in sram_reserve_regions()
247 if (!block->label) { in sram_reserve_regions()
253 block->export ? "exported " : "", block->label, in sram_reserve_regions()
254 block->start, block->start + block->size); in sram_reserve_regions()
257 block->start, block->start + block->size); in sram_reserve_regions()
260 block++; in sram_reserve_regions()
282 list_for_each_entry(block, &reserve_list, list) { in sram_reserve_regions()
284 if (block->start < cur_start) { in sram_reserve_regions()
287 block->start, cur_start); in sram_reserve_regions()
293 if ((block->export || block->pool || block->protect_exec) && in sram_reserve_regions()
294 block->size) { in sram_reserve_regions()
295 ret = sram_add_partition(sram, block, in sram_reserve_regions()
296 res->start + block->start); in sram_reserve_regions()
304 if (block->start == cur_start) { in sram_reserve_regions()
305 cur_start = block->start + block->size; in sram_reserve_regions()
314 cur_size = block->start - cur_start; in sram_reserve_regions()
330 cur_start = block->start + block->size; in sram_reserve_regions()