[fdtmem] Add ability to parse FDT memory map for a relocation address

Add code to parse the devicetree memory nodes, memory reservations
block, and reserved memory nodes to construct an ordered and
non-overlapping description of the system memory map, and use this to
identify a suitable address to which iPXE may be relocated at runtime.

We choose to place iPXE on a superpage boundary (as required by the
paging code), and to use the highest available address within
accessible memory.  This mirrors the approach taken for x86 BIOS
builds, where we have long assumed that any image format that we might
need to support may require specific fixed addresses towards the
bottom of the memory map, but is very unlikely to require specific
fixed addresses towards the top of the memory map (since those
addresses may not exist, depending on the amount of installed RAM).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-11 17:35:47 +01:00
parent 2e45106c0a
commit 6fe9ce66ae
5 changed files with 413 additions and 0 deletions

View File

@@ -401,6 +401,14 @@ paging_mode_names:
#endif
.endm
/* Maximum physical alignment
*
* We align to a "megapage" boundary to simplify the task of
* setting up page table mappings.
*/
.globl _max_align
.equ _max_align, ( 1 << VPN1_LSB )
/*****************************************************************************
*
* Disable paging