Lines Matching +full:memory +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0
24 /* Set the #address-cells and #size-cells values for an empty tree */ in fdt_update_cell_size()
26 fdt_setprop_u32(fdt, offset, "#address-cells", EFI_DT_ADDR_CELLS_DEFAULT); in fdt_update_cell_size()
27 fdt_setprop_u32(fdt, offset, "#size-cells", EFI_DT_SIZE_CELLS_DEFAULT); in fdt_update_cell_size()
61 * non-critical: in update_fdt()
71 * Delete all memory reserve map entries. When booting via UEFI, in update_fdt()
72 * kernel will use the UEFI memory map to find reserved regions. in update_fdt()
75 while (num_rsv-- > 0) in update_fdt()
99 status = fdt_setprop_var(fdt, node, "linux,uefi-system-table", fdt_val64); in update_fdt()
105 status = fdt_setprop_var(fdt, node, "linux,uefi-mmap-start", fdt_val64); in update_fdt()
111 status = fdt_setprop_var(fdt, node, "linux,uefi-mmap-size", fdt_val32); in update_fdt()
115 status = fdt_setprop_var(fdt, node, "linux,uefi-mmap-desc-size", fdt_val32); in update_fdt()
119 status = fdt_setprop_var(fdt, node, "linux,uefi-mmap-desc-ver", fdt_val32); in update_fdt()
129 status = fdt_setprop_var(fdt, node, "kaslr-seed", fdt_val64); in update_fdt()
141 if (status == -FDT_ERR_NOSPACE) in update_fdt()
147 static efi_status_t update_fdt_memmap(void *fdt, struct efi_boot_memmap *map) in update_fdt_memmap() argument
157 fdt_val64 = cpu_to_fdt64((unsigned long)map->map); in update_fdt_memmap()
159 err = fdt_setprop_inplace_var(fdt, node, "linux,uefi-mmap-start", fdt_val64); in update_fdt_memmap()
163 fdt_val32 = cpu_to_fdt32(map->map_size); in update_fdt_memmap()
165 err = fdt_setprop_inplace_var(fdt, node, "linux,uefi-mmap-size", fdt_val32); in update_fdt_memmap()
169 fdt_val32 = cpu_to_fdt32(map->desc_size); in update_fdt_memmap()
171 err = fdt_setprop_inplace_var(fdt, node, "linux,uefi-mmap-desc-size", fdt_val32); in update_fdt_memmap()
175 fdt_val32 = cpu_to_fdt32(map->desc_ver); in update_fdt_memmap()
177 err = fdt_setprop_inplace_var(fdt, node, "linux,uefi-mmap-desc-ver", fdt_val32); in update_fdt_memmap()
191 static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv) in exit_boot_func() argument
195 p->boot_memmap = map; in exit_boot_func()
198 * Update the memory map with virtual addresses. The function will also in exit_boot_func()
202 efi_get_virtmap(map->map, map->map_size, map->desc_size, in exit_boot_func()
203 p->runtime_map, &p->runtime_entry_count); in exit_boot_func()
205 return update_fdt_memmap(p->new_fdt_addr, map); in exit_boot_func()
213 * Allocate memory for a new FDT, then add EFI and commandline related fields
215 * allocated memory is large enough. EFI allocations are in EFI_PAGE_SIZE
220 * tied to the creation of the FDT with the final memory map in it.
239 efi_err("Unable to retrieve UEFI memory map.\n"); in allocate_new_fdt_and_exit_boot()
278 efi_err("Unable to allocate memory for new device tree.\n"); in allocate_new_fdt_and_exit_boot()
300 /* Install the new virtual address map */ in allocate_new_fdt_and_exit_boot()
301 svam = efi_system_table->runtime->set_virtual_address_map; in allocate_new_fdt_and_exit_boot()
320 for (l = 0; l < priv.boot_memmap->map_size; in allocate_new_fdt_and_exit_boot()
321 l += priv.boot_memmap->desc_size) { in allocate_new_fdt_and_exit_boot()
322 p = (void *)priv.boot_memmap->map + l; in allocate_new_fdt_and_exit_boot()
324 if (p->attribute & EFI_MEMORY_RUNTIME) in allocate_new_fdt_and_exit_boot()
325 p->virt_addr = U64_MAX; in allocate_new_fdt_and_exit_boot()