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",
static int memmap_is_usable(const struct memmap_region *region)
Check if memory region is usable.
static void memmap_use(struct used_region *used, physaddr_t start, size_t size)
Update an in-use memory region.
struct arbelprm_rc_send_wqe rc
PROVIDE_MEMMAP_INLINE(fdt, memmap_sync)
#define FDTMEM_MAX32
Maximum 32-bit physical address.
void memmap_update(struct memmap_region *region, uint64_t start, uint64_t size, unsigned int flags, const char *name)
Update memory region descriptor.
uint64_t max
Maximum address in region.
static size_t fdtmem_len(struct fdt *fdt)
Get length for copy of iPXE and device tree.
size_t ABS_SYMBOL(_memsz)
Total in-memory size (calculated by linker)
size_t len
Length of tree.
int fdt_parse(struct fdt *fdt, struct fdt_header *hdr, size_t max_len)
Parse device tree.
struct golan_inbox_hdr hdr
Message header.
uint16_t size
Buffer size.
int fdt_describe(struct fdt *fdt, unsigned int offset, struct fdt_descriptor *desc)
Describe device tree token.
int fdt_path(struct fdt *fdt, const char *path, unsigned int *offset)
Find node by path.
Flattened Device Tree memory map.
A device tree region cell size specification.
unsigned long long uint64_t
#define PAGE_SIZE
Page size.
#define MEMMAP_FL_USED
Is in use by iPXE.
#define for_each_fdt_reservation(rsv, fdt)
Iterate over memory reservations.
uint32_t start
Starting offset.
struct ena_llq_option desc
Descriptor counts.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct used_region fdtmem_used __used_region
In-use memory region for iPXE and system device tree copy.
static void fdtmem_describe(uint64_t min, uint64_t max, struct fdt *fdt, struct memmap_region *region)
Describe memory region.
void memmap_describe(uint64_t min, int hide, struct memmap_region *region)
Describe memory region from system memory map.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
Access to external ("user") memory.
PROVIDE_MEMMAP(fdt, memmap_describe, fdtmem_describe_region)
static unsigned int count
Number of entries.
void fdt_reg_cells(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs)
Get region cell size specification.
const char * fdt_string(struct fdt *fdt, unsigned int offset, const char *name)
Find string property.
uint64_t size
Length of reservation.
char * strerror(int errno)
Retrieve string representation of error number.
#define be64_to_cpu(value)
static int fdtmem_update_tree(struct memmap_region *region, struct fdt *fdt)
Update memory region descriptor based on device tree.
uint32_t addr
Buffer address.
int fdt_reg_count(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs)
Get number of regions.
static physaddr_t fdtmem_max
Maximum accessible physical address.
int fdt_reg_address(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *address)
Get region address.
char _end[]
End address of the iPXE image.
uint32_t next
Next descriptor address.
int fdtmem_register(struct fdt_header *hdr, physaddr_t max)
Copy and register system device tree.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void fdtmem_describe_region(uint64_t min, int hide, struct memmap_region *region)
Describe memory region from system memory map.
int strcmp(const char *first, const char *second)
Compare strings.
#define MEMMAP_FL_RESERVED
Is reserved.
#define MEMMAP_FL_MEMORY
Contains memory.
static memmap_sync(void)
Synchronise in-use regions with the externally visible system memory map.
uint64_t start
Starting address.
const char * name
Region name.
uint64_t min
Minimum address in region.
#define MEMMAP_FL_INACCESSIBLE
Outside of addressable range.
A memory region descriptor.
static void memmap_init(uint64_t min, struct memmap_region *region)
Initialise memory region descriptor.
A device tree token descriptor.
uint16_t offset
Offset to command line.
#define ABS_VALUE_INIT(name)
Get value of an absolute symbol for use in a static initializer.
int fdt_reg_size(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *size)
Get region size.
#define NULL
NULL pointer (VOID *)
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.
void memmap_update_used(struct memmap_region *region)
Update memory region descriptor based on all in-use memory regions.
#define FDT_MAX_ALIGN
Maximum alignment of any block.
physaddr_t fdtmem_relocate(struct fdt_header *hdr, physaddr_t max)
Find a relocation address for iPXE.
char _prefix[]
Start address of the iPXE image.
struct fdt sysfdt
The system flattened device tree (if present)