Lines Matching +full:firmware +full:- +full:initialised

1 // SPDX-License-Identifier: GPL-2.0-only
27 * bootargs, kaslr-seed, rng-seed, useable-memory-range and elfcorehdr.
32 * fdt_find_and_del_mem_rsv - delete memory reservation with given address and size
50 return -EINVAL; in fdt_find_and_del_mem_rsv()
57 return -EINVAL; in fdt_find_and_del_mem_rsv()
64 return -ENOENT; in fdt_find_and_del_mem_rsv()
68 * get_addr_size_cells - Get address and size of root node
81 return -EINVAL; in get_addr_size_cells()
92 * do_get_kexec_buffer - Get address and size of device tree property
111 return -ENOENT; in do_get_kexec_buffer()
121 * ima_get_kexec_buffer - get IMA buffer from the previous kernel
135 prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len); in ima_get_kexec_buffer()
137 return -ENOENT; in ima_get_kexec_buffer()
143 /* Do some sanity on the returned size for the ima-kexec buffer */ in ima_get_kexec_buffer()
145 return -ENOENT; in ima_get_kexec_buffer()
152 end_pfn = PHYS_PFN(tmp_addr + tmp_size - 1); in ima_get_kexec_buffer()
156 return -EINVAL; in ima_get_kexec_buffer()
166 * ima_free_kexec_buffer - free memory used by the IMA buffer
175 prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL); in ima_free_kexec_buffer()
177 return -ENOENT; in ima_free_kexec_buffer()
179 ret = do_get_kexec_buffer(prop->value, prop->length, &addr, &size); in ima_free_kexec_buffer()
192 * remove_ima_buffer - remove the IMA buffer property and reservation from @fdt
210 prop = fdt_getprop(fdt, chosen_node, "linux,ima-kexec-buffer", &len); in remove_ima_buffer()
215 fdt_delprop(fdt, chosen_node, "linux,ima-kexec-buffer"); in remove_ima_buffer()
226 * setup_ima_buffer - add IMA buffer information to the fdt
238 if (!image->ima_buffer_size) in setup_ima_buffer()
242 "linux,ima-kexec-buffer", in setup_ima_buffer()
243 image->ima_buffer_addr, in setup_ima_buffer()
244 image->ima_buffer_size); in setup_ima_buffer()
246 return -EINVAL; in setup_ima_buffer()
248 ret = fdt_add_mem_rsv(fdt, image->ima_buffer_addr, in setup_ima_buffer()
249 image->ima_buffer_size); in setup_ima_buffer()
251 return -EINVAL; in setup_ima_buffer()
254 image->ima_buffer_addr, image->ima_buffer_size); in setup_ima_buffer()
267 * of_kexec_alloc_and_setup_fdt - Alloc and setup a new Flattened Device Tree
305 if (ret == -EINVAL) { in of_kexec_alloc_and_setup_fdt()
311 if (chosen_node == -FDT_ERR_NOTFOUND) in of_kexec_alloc_and_setup_fdt()
320 if (ret && ret != -FDT_ERR_NOTFOUND) in of_kexec_alloc_and_setup_fdt()
322 ret = fdt_delprop(fdt, chosen_node, "linux,usable-memory-range"); in of_kexec_alloc_and_setup_fdt()
323 if (ret && ret != -FDT_ERR_NOTFOUND) in of_kexec_alloc_and_setup_fdt()
327 prop = fdt_getprop(fdt, chosen_node, "linux,initrd-start", NULL); in of_kexec_alloc_and_setup_fdt()
333 prop = fdt_getprop(fdt, chosen_node, "linux,initrd-end", NULL); in of_kexec_alloc_and_setup_fdt()
335 ret = -EINVAL; in of_kexec_alloc_and_setup_fdt()
342 * kexec reserves exact initrd size, while firmware may in of_kexec_alloc_and_setup_fdt()
345 tmp_size = tmp_end - tmp_start; in of_kexec_alloc_and_setup_fdt()
347 if (ret == -ENOENT) in of_kexec_alloc_and_setup_fdt()
350 if (ret == -EINVAL) in of_kexec_alloc_and_setup_fdt()
354 /* add initrd-* */ in of_kexec_alloc_and_setup_fdt()
356 ret = fdt_setprop_u64(fdt, chosen_node, "linux,initrd-start", in of_kexec_alloc_and_setup_fdt()
361 ret = fdt_setprop_u64(fdt, chosen_node, "linux,initrd-end", in of_kexec_alloc_and_setup_fdt()
371 ret = fdt_delprop(fdt, chosen_node, "linux,initrd-start"); in of_kexec_alloc_and_setup_fdt()
372 if (ret && (ret != -FDT_ERR_NOTFOUND)) in of_kexec_alloc_and_setup_fdt()
375 ret = fdt_delprop(fdt, chosen_node, "linux,initrd-end"); in of_kexec_alloc_and_setup_fdt()
376 if (ret && (ret != -FDT_ERR_NOTFOUND)) in of_kexec_alloc_and_setup_fdt()
380 if (image->type == KEXEC_TYPE_CRASH) { in of_kexec_alloc_and_setup_fdt()
383 "linux,elfcorehdr", image->elf_load_addr, in of_kexec_alloc_and_setup_fdt()
384 image->elf_headers_sz); in of_kexec_alloc_and_setup_fdt()
392 ret = fdt_add_mem_rsv(fdt, image->elf_load_addr, in of_kexec_alloc_and_setup_fdt()
393 image->elf_headers_sz); in of_kexec_alloc_and_setup_fdt()
397 /* add linux,usable-memory-range */ in of_kexec_alloc_and_setup_fdt()
399 "linux,usable-memory-range", crashk_res.start, in of_kexec_alloc_and_setup_fdt()
400 crashk_res.end - crashk_res.start + 1); in of_kexec_alloc_and_setup_fdt()
406 "linux,usable-memory-range", in of_kexec_alloc_and_setup_fdt()
408 crashk_low_res.end - crashk_low_res.start + 1); in of_kexec_alloc_and_setup_fdt()
421 if (ret && (ret != -FDT_ERR_NOTFOUND)) in of_kexec_alloc_and_setup_fdt()
425 /* add kaslr-seed */ in of_kexec_alloc_and_setup_fdt()
426 ret = fdt_delprop(fdt, chosen_node, "kaslr-seed"); in of_kexec_alloc_and_setup_fdt()
427 if (ret == -FDT_ERR_NOTFOUND) in of_kexec_alloc_and_setup_fdt()
435 ret = fdt_setprop_u64(fdt, chosen_node, "kaslr-seed", seed); in of_kexec_alloc_and_setup_fdt()
439 pr_notice("RNG is not initialised: omitting \"%s\" property\n", in of_kexec_alloc_and_setup_fdt()
440 "kaslr-seed"); in of_kexec_alloc_and_setup_fdt()
443 /* add rng-seed */ in of_kexec_alloc_and_setup_fdt()
447 ret = fdt_setprop_placeholder(fdt, chosen_node, "rng-seed", in of_kexec_alloc_and_setup_fdt()
453 pr_notice("RNG is not initialised: omitting \"%s\" property\n", in of_kexec_alloc_and_setup_fdt()
454 "rng-seed"); in of_kexec_alloc_and_setup_fdt()
457 ret = fdt_setprop(fdt, chosen_node, "linux,booted-from-kexec", NULL, 0); in of_kexec_alloc_and_setup_fdt()