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()
221 block->export = of_property_read_bool(child, "export"); in sram_reserve_regions()
222 block->pool = of_property_read_bool(child, "pool"); in sram_reserve_regions()
223 block->protect_exec = of_property_read_bool(child, "protect-exec"); in sram_reserve_regions()
225 if ((block->export || block->pool || block->protect_exec) && in sram_reserve_regions()
226 block->size) { in sram_reserve_regions()
238 block->label = devm_kasprintf(sram->dev, GFP_KERNEL, in sram_reserve_regions()
241 block->label = devm_kstrdup(sram->dev, in sram_reserve_regions()
243 if (!block->label) { in sram_reserve_regions()
249 block->export ? "exported " : "", block->label, in sram_reserve_regions()
250 block->start, block->start + block->size); in sram_reserve_regions()
253 block->start, block->start + block->size); in sram_reserve_regions()
256 block++; in sram_reserve_regions()
278 list_for_each_entry(block, &reserve_list, list) { in sram_reserve_regions()
280 if (block->start < cur_start) { in sram_reserve_regions()
283 block->start, cur_start); in sram_reserve_regions()
289 if ((block->export || block->pool || block->protect_exec) && in sram_reserve_regions()
290 block->size) { in sram_reserve_regions()
291 ret = sram_add_partition(sram, block, in sram_reserve_regions()
292 res->start + block->start); in sram_reserve_regions()
300 if (block->start == cur_start) { in sram_reserve_regions()
301 cur_start = block->start + block->size; in sram_reserve_regions()
310 cur_size = block->start - cur_start; in sram_reserve_regions()
326 cur_start = block->start + block->size; in sram_reserve_regions()