66#define FDTMEM_MAX32 0xffffffff
79 unsigned int offset,
const char *match,
80 unsigned int flags ) {
99 DBGC ( region,
"FDTMEM has malformed node: %s\n",
105 if ( ( depth == 0 ) && (
desc.depth < 0 ) )
109 if ( ! ( ( depth == 0 ) &&
desc.name && ( !
desc.data ) ) )
118 if (
strcmp ( devtype, match ) != 0 )
130 DBGC ( region,
"FDTMEM has malformed region %s: %s\n",
141 DBGC ( region,
"FDTMEM %s region %d has "
142 "malformed start address: %s\n",
148 DBGC ( region,
"FDTMEM %s region %d has "
149 "malformed size: %s\n",
190 DBGC ( region,
"FDTMEM could not locate /reserved-memory: "
222 inaccessible = (
max + 1 );
283 DBGC (
hdr,
"FDTMEM could not parse FDT: %s\n",
292 DBGC (
hdr,
"FDTMEM requires %#zx + %#zx => %#zx bytes for "
333 DBGC (
hdr,
"FDTMEM relocating %#08lx => [%#08lx,%#08lx]\n",
355 DBGC (
hdr,
"FDTMEM could not parse FDT: %s\n",
361 copy = ( (
void * )
_end );
370 DBGC (
hdr,
"FDTMEM could not register FDT: %s\n",
#define NULL
NULL pointer (VOID *)
struct golan_inbox_hdr hdr
Message header.
struct arbelprm_rc_send_wqe rc
unsigned long long uint64_t
#define assert(condition)
Assert a condition at run-time.
uint16_t offset
Offset to command line.
uint32_t next
Next descriptor address.
uint32_t addr
Buffer address.
struct ena_llq_option desc
Descriptor counts.
int fdt_describe(struct fdt *fdt, unsigned int offset, struct fdt_descriptor *desc)
Describe device tree token.
const char * fdt_string(struct fdt *fdt, unsigned int offset, const char *name)
Find string property.
int fdt_parse(struct fdt *fdt, struct fdt_header *hdr, size_t max_len)
Parse device tree.
int fdt_reg_count(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs)
Get number of regions.
int fdt_reg_size(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *size)
Get region size.
int fdt_reg_address(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *address)
Get region address.
struct fdt sysfdt
The system flattened device tree (if present)
int fdt_path(struct fdt *fdt, const char *path, unsigned int *offset)
Find node by path.
void fdt_reg_cells(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs)
Get region cell size specification.
static void fdtmem_describe(uint64_t min, uint64_t max, struct fdt *fdt, struct memmap_region *region)
Describe memory region.
static void fdtmem_describe_region(uint64_t min, int hide, struct memmap_region *region)
Describe memory region from system memory map.
static size_t fdtmem_len(struct fdt *fdt)
Get length for copy of iPXE and device tree.
static physaddr_t fdtmem_max
Maximum accessible physical address.
physaddr_t fdtmem_relocate(struct fdt_header *hdr, physaddr_t max)
Find a relocation address for iPXE.
char _end[]
End address of the iPXE image.
static int fdtmem_update_node(struct memmap_region *region, struct fdt *fdt, unsigned int offset, const char *match, unsigned int flags)
Update memory region descriptor based on device tree node.
static int fdtmem_update_tree(struct memmap_region *region, struct fdt *fdt)
Update memory region descriptor based on device tree.
#define FDTMEM_MAX32
Maximum 32-bit physical address.
int fdtmem_register(struct fdt_header *hdr, physaddr_t max)
Copy and register system device tree.
char _prefix[]
Start address of the iPXE image.
Flattened Device Tree memory map.
static memmap_sync(void)
Synchronise in-use regions with the externally visible system memory map.
#define ABS_SYMBOL(name)
Declare an absolute symbol (e.g.
#define ABS_VALUE_INIT(name)
Get value of an absolute symbol for use in a static initializer.
uint32_t start
Starting offset.
uint16_t size
Buffer size.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define be64_to_cpu(value)
#define FDT_MAX_ALIGN
Maximum alignment of any block.
#define for_each_fdt_reservation(rsv, fdt)
Iterate over memory reservations.
#define PAGE_SIZE
Page size.
#define MEMMAP_FL_INACCESSIBLE
Outside of addressable range.
static int memmap_is_usable(const struct memmap_region *region)
Check if memory region is usable.
#define MEMMAP_FL_USED
Is in use by iPXE.
#define MEMMAP_FL_MEMORY
Contains memory.
void memmap_describe(uint64_t min, int hide, struct memmap_region *region)
Describe memory region from system memory map.
static void memmap_use(struct used_region *used, physaddr_t start, size_t size)
Update an in-use memory region.
#define PROVIDE_MEMMAP_INLINE(_subsys, _api_func)
Provide a static inline memory map API implementation.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
#define PROVIDE_MEMMAP(_subsys, _api_func, _func)
Provide a memory map API implementation.
static void memmap_init(uint64_t min, struct memmap_region *region)
Initialise memory region descriptor.
#define __used_region
Declare an in-use memory region.
#define MEMMAP_FL_RESERVED
Is reserved.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Access to external ("user") memory.
void memmap_update(struct memmap_region *region, uint64_t start, uint64_t size, unsigned int flags, const char *name)
Update memory region descriptor.
void memmap_update_used(struct memmap_region *region)
Update memory region descriptor based on all in-use memory regions.
char * strerror(int errno)
Retrieve string representation of error number.
int strcmp(const char *first, const char *second)
Compare strings.
A device tree token descriptor.
A device tree region cell size specification.
uint64_t start
Starting address.
uint64_t size
Length of reservation.
size_t len
Length of tree.
A memory region descriptor.
uint64_t min
Minimum address in region.
uint64_t max
Maximum address in region.