coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fit.c
Go to the documentation of this file.
1 /* Taken from depthcharge: src/boot/fit.c */
2 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 
4 #include <assert.h>
5 #include <console/console.h>
6 #include <ctype.h>
7 #include <endian.h>
8 #include <bootmem.h>
9 #include <string.h>
10 #include <program_loading.h>
11 #include <memrange.h>
12 #include <fit.h>
13 #include <boardid.h>
14 #include <commonlib/stdlib.h>
15 #include <types.h>
16 
17 static struct list_node image_nodes;
18 static struct list_node config_nodes;
19 static struct list_node compat_strings;
20 
22  const char *compat_string;
23  struct list_node list_node;
24 };
25 
26 /* Convert string to lowercase and replace '_' and spaces with '-'. */
27 static char *clean_compat_string(char *str)
28 {
29  for (size_t i = 0; i < strlen(str); i++) {
30  str[i] = tolower(str[i]);
31  if (str[i] == '_' || str[i] == ' ')
32  str[i] = '-';
33  }
34 
35  return str;
36 }
37 
39 {
40  char compat_string[80] = {};
41 
42  if ((board_id() != UNDEFINED_STRAPPING_ID) &&
44  snprintf(compat_string, sizeof(compat_string),
45  "%s,%s-rev%u-sku%u", CONFIG_MAINBOARD_VENDOR,
46  CONFIG_MAINBOARD_PART_NUMBER, board_id(), sku_id());
47 
48  fit_add_compat_string(compat_string);
49  }
50 
52  snprintf(compat_string, sizeof(compat_string), "%s,%s-rev%u",
53  CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER,
54  board_id());
55 
56  fit_add_compat_string(compat_string);
57  }
58 
59  if (sku_id() != UNDEFINED_STRAPPING_ID) {
60  snprintf(compat_string, sizeof(compat_string), "%s,%s-sku%u",
61  CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER,
62  sku_id());
63 
64  fit_add_compat_string(compat_string);
65  }
66 
67  snprintf(compat_string, sizeof(compat_string), "%s,%s",
68  CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER);
69 
70  fit_add_compat_string(compat_string);
71 }
72 
73 static struct fit_image_node *find_image(const char *name)
74 {
75  struct fit_image_node *image;
77  if (!strcmp(image->name, name))
78  return image;
79  }
80  printk(BIOS_ERR, "Cannot find image node %s!\n", name);
81  return NULL;
82 }
83 
84 static struct fit_image_node *find_image_with_overlays(const char *name,
85  int bytes, struct list_node *prev)
86 {
88  if (!base)
89  return NULL;
90 
91  int len = strnlen(name, bytes) + 1;
92  bytes -= len;
93  name += len;
94  while (bytes > 0) {
95  struct fit_overlay_chain *next = xzalloc(sizeof(*next));
96  next->overlay = find_image(name);
97  if (!next->overlay)
98  return NULL;
99  list_insert_after(&next->list_node, prev);
100  prev = &next->list_node;
101  len = strnlen(name, bytes) + 1;
102  bytes -= len;
103  name += len;
104  }
105 
106  return base;
107 }
108 
109 static void image_node(struct device_tree_node *node)
110 {
111  struct fit_image_node *image = xzalloc(sizeof(*image));
112 
114  image->name = node->name;
115 
116  struct device_tree_property *prop;
118  if (!strcmp("data", prop->prop.name)) {
119  image->data = prop->prop.data;
120  image->size = prop->prop.size;
121  } else if (!strcmp("compression", prop->prop.name)) {
122  if (!strcmp("none", prop->prop.data))
124  else if (!strcmp("lzma", prop->prop.data))
126  else if (!strcmp("lz4", prop->prop.data))
128  else
129  image->compression = -1;
130  }
131  }
132 
134 }
135 
136 static void config_node(struct device_tree_node *node)
137 {
138  struct fit_config_node *config = xzalloc(sizeof(*config));
139  config->name = node->name;
140 
141  struct device_tree_property *prop;
143  if (!strcmp("kernel", prop->prop.name))
144  config->kernel = find_image(prop->prop.data);
145  else if (!strcmp("fdt", prop->prop.name))
147  prop->prop.size, &config->overlays);
148  else if (!strcmp("ramdisk", prop->prop.name))
149  config->ramdisk = find_image(prop->prop.data);
150  else if (!strcmp("compatible", prop->prop.name))
151  config->compat = prop->prop;
152  }
153 
154  list_insert_after(&config->list_node, &config_nodes);
155 }
156 
157 static void fit_unpack(struct device_tree *tree, const char **default_config)
158 {
159  struct device_tree_node *child;
160  struct device_tree_node *images = dt_find_node_by_path(tree, "/images",
161  NULL, NULL, 0);
162  if (images)
163  list_for_each(child, images->children, list_node)
164  image_node(child);
165 
166  struct device_tree_node *configs = dt_find_node_by_path(tree,
167  "/configurations", NULL, NULL, 0);
168  if (configs) {
169  *default_config = dt_find_string_prop(configs, "default");
170  list_for_each(child, configs->children, list_node)
171  config_node(child);
172  }
173 }
174 
175 static int fdt_find_compat(const void *blob, uint32_t start_offset,
176  struct fdt_property *prop)
177 {
178  int offset = start_offset;
179  int size;
180 
181  size = fdt_node_name(blob, offset, NULL);
182  if (!size)
183  return -1;
184  offset += size;
185 
186  while ((size = fdt_next_property(blob, offset, prop))) {
187  if (!strcmp("compatible", prop->name))
188  return 0;
189 
190  offset += size;
191  }
192 
193  prop->name = NULL;
194  return -1;
195 }
196 
197 static int fit_check_compat(struct fdt_property *compat_prop,
198  const char *compat_name)
199 {
200  int bytes = compat_prop->size;
201  const char *compat_str = compat_prop->data;
202 
203  for (int pos = 0; bytes && compat_str[0]; pos++) {
204  if (!strncmp(compat_str, compat_name, bytes))
205  return pos;
206  int len = strlen(compat_str) + 1;
207  compat_str += len;
208  bytes -= len;
209  }
210  return -1;
211 }
212 
213 void fit_update_chosen(struct device_tree *tree, const char *cmd_line)
214 {
215  const char *path[] = { "chosen", NULL };
216  struct device_tree_node *node;
217  node = dt_find_node(tree->root, path, NULL, NULL, 1);
218 
219  dt_add_string_prop(node, "bootargs", cmd_line);
220 }
221 
222 void fit_add_ramdisk(struct device_tree *tree, void *ramdisk_addr,
223  size_t ramdisk_size)
224 {
225  const char *path[] = { "chosen", NULL };
226  struct device_tree_node *node;
227  node = dt_find_node(tree->root, path, NULL, NULL, 1);
228 
229  u64 start = (uintptr_t)ramdisk_addr;
230  u64 end = start + ramdisk_size;
231 
232  dt_add_u64_prop(node, "linux,initrd-start", start);
233  dt_add_u64_prop(node, "linux,initrd-end", end);
234 }
235 
236 static void update_reserve_map(uint64_t start, uint64_t end,
237  struct device_tree *tree)
238 {
239  struct device_tree_reserve_map_entry *entry = xzalloc(sizeof(*entry));
240 
241  entry->start = start;
242  entry->size = end - start;
243 
244  list_insert_after(&entry->list_node, &tree->reserve_map);
245 }
246 
247 struct entry_params {
248  unsigned int addr_cells;
249  unsigned int size_cells;
250  void *data;
251 };
252 
253 static uint64_t max_range(unsigned int size_cells)
254 {
255  /*
256  * Split up ranges who's sizes are too large to fit in #size-cells.
257  * The largest value we can store isn't a power of two, so we'll round
258  * down to make the math easier.
259  */
260  return 0x1ULL << (size_cells * 32 - 1);
261 }
262 
263 static void update_mem_property(u64 start, u64 end, struct entry_params *params)
264 {
265  u8 *data = (u8 *)params->data;
266  u64 full_size = end - start;
267  while (full_size) {
268  const u64 max_size = max_range(params->size_cells);
269  const u64 size = MIN(max_size, full_size);
270 
271  dt_write_int(data, start, params->addr_cells * sizeof(u32));
272  data += params->addr_cells * sizeof(uint32_t);
273  start += size;
274 
275  dt_write_int(data, size, params->size_cells * sizeof(u32));
276  data += params->size_cells * sizeof(uint32_t);
277  full_size -= size;
278  }
279  params->data = data;
280 }
281 
282 struct mem_map {
283  struct memranges mem;
284  struct memranges reserved;
285 };
286 
287 static bool walk_memory_table(const struct range_entry *r, void *arg)
288 {
289  struct mem_map *arg_map = arg;
290 
291  /*
292  * Kernel likes its available memory areas at least 1MB
293  * aligned, let's trim the regions such that unaligned padding
294  * is added to reserved memory.
295  */
296  if (range_entry_tag(r) == BM_MEM_RAM) {
297  uint64_t new_start = ALIGN_UP(range_entry_base(r), 1 * MiB);
298  uint64_t new_end = ALIGN_DOWN(range_entry_end(r), 1 * MiB);
299 
300  if (new_start != range_entry_base(r))
301  memranges_insert(&arg_map->reserved,
302  range_entry_base(r),
303  new_start - range_entry_base(r),
305 
306  if (new_start != new_end)
307  memranges_insert(&arg_map->mem, new_start,
308  new_end - new_start, BM_MEM_RAM);
309 
310  if (new_end != range_entry_end(r))
311  memranges_insert(&arg_map->reserved, new_end,
312  range_entry_end(r) - new_end,
314  } else
316  range_entry_size(r),
318 
319  return true;
320 }
321 
322 void fit_add_compat_string(const char *str)
323 {
324  struct compat_string_entry *compat_node;
325 
326  compat_node = xzalloc(sizeof(*compat_node));
327  compat_node->compat_string = strdup(str);
328 
329  clean_compat_string((char *)compat_node->compat_string);
330 
331  list_insert_after(&compat_node->list_node, &compat_strings);
332 }
333 
334 void fit_update_memory(struct device_tree *tree)
335 {
336  const struct range_entry *r;
337  struct device_tree_node *node;
338  u32 addr_cells = 1, size_cells = 1;
339  struct mem_map map;
340 
341  printk(BIOS_INFO, "FIT: Updating devicetree memory entries\n");
342 
343  dt_read_cell_props(tree->root, &addr_cells, &size_cells);
344 
345  /*
346  * First remove all existing device_type="memory" nodes, then add ours.
347  */
348  list_for_each(node, tree->root->children, list_node) {
349  const char *devtype = dt_find_string_prop(node, "device_type");
350  if (devtype && !strcmp(devtype, "memory"))
351  list_remove(&node->list_node);
352  }
353 
354  node = xzalloc(sizeof(*node));
355 
356  node->name = "memory";
357  list_insert_after(&node->list_node, &tree->root->children);
358  dt_add_string_prop(node, "device_type", (char *)"memory");
359 
360  memranges_init_empty(&map.mem, NULL, 0);
362 
364 
365  /* CBMEM regions are both carved out and explicitly reserved. */
366  memranges_each_entry(r, &map.reserved) {
368  tree);
369  }
370 
371  /*
372  * Count the amount of 'reg' entries we need (account for size limits).
373  */
374  size_t count = 0;
375  memranges_each_entry(r, &map.mem) {
376  uint64_t size = range_entry_size(r);
377  uint64_t max_size = max_range(size_cells);
378  count += DIV_ROUND_UP(size, max_size);
379  }
380 
381  /* Allocate the right amount of space and fill up the entries. */
382  size_t length = count * (addr_cells + size_cells) * sizeof(u32);
383 
384  void *data = xzalloc(length);
385 
386  struct entry_params add_params = { addr_cells, size_cells, data };
387  memranges_each_entry(r, &map.mem) {
389  &add_params);
390  }
391  assert(add_params.data - data == length);
392 
393  /* Assemble the final property and add it to the device tree. */
394  dt_add_bin_prop(node, "reg", data, length);
395 
396  memranges_teardown(&map.mem);
398 }
399 
400 /*
401  * Finds a compat string and updates the compat position and rank.
402  * @param config The current config node to operate on
403  * @return 0 if compat updated, -1 if this FDT cannot be used.
404  */
406 {
407  /* If there was no "compatible" property in config node, this is a
408  legacy FIT image. Must extract compat prop from FDT itself. */
409  if (!config->compat.name) {
410  void *fdt_blob = config->fdt->data;
411  const struct fdt_header *fdt_header = fdt_blob;
412  uint32_t fdt_offset = be32_to_cpu(fdt_header->structure_offset);
413 
414  if (config->fdt->compression != CBFS_COMPRESS_NONE) {
415  printk(BIOS_ERR, "config %s has a compressed FDT without "
416  "external compatible property, skipping.\n",
417  config->name);
418  return -1;
419  }
420 
421  /* FDT overlays are not supported in legacy FIT images. */
422  if (config->overlays.next) {
423  printk(BIOS_ERR, "config %s has overlay but no compat!\n",
424  config->name);
425  return -1;
426  }
427 
428  if (fdt_find_compat(fdt_blob, fdt_offset, &config->compat)) {
429  printk(BIOS_ERR, "Can't find compat string in FDT %s "
430  "for config %s, skipping.\n",
431  config->fdt->name, config->name);
432  return -1;
433  }
434  }
435 
436  config->compat_pos = -1;
437  config->compat_rank = -1;
438  size_t i = 0;
439  struct compat_string_entry *compat_node;
440  list_for_each(compat_node, compat_strings, list_node) {
441  int pos = fit_check_compat(&config->compat,
442  compat_node->compat_string);
443  if (pos >= 0) {
444  config->compat_pos = pos;
445  config->compat_rank = i;
446  config->compat_string =
447  compat_node->compat_string;
448  }
449  i++;
450  }
451 
452  return 0;
453 }
454 
455 struct fit_config_node *fit_load(void *fit)
456 {
457  struct fit_image_node *image;
458  struct fit_config_node *config;
459  struct compat_string_entry *compat_node;
460  struct fit_overlay_chain *overlay_chain;
461 
462  printk(BIOS_DEBUG, "FIT: Loading FIT from %p\n", fit);
463 
464  struct device_tree *tree = fdt_unflatten(fit);
465  if (!tree) {
466  printk(BIOS_ERR, "Failed to unflatten FIT image!\n");
467  return NULL;
468  }
469 
470  const char *default_config_name = NULL;
471  struct fit_config_node *default_config = NULL;
472  struct fit_config_node *compat_config = NULL;
473 
474  fit_unpack(tree, &default_config_name);
475 
476  /* List the images we found. */
478  printk(BIOS_DEBUG, "FIT: Image %s has %d bytes.\n", image->name,
479  image->size);
480 
482 
483  printk(BIOS_DEBUG, "FIT: Compat preference "
484  "(lowest to highest priority) :");
485 
486  list_for_each(compat_node, compat_strings, list_node) {
487  printk(BIOS_DEBUG, " %s", compat_node->compat_string);
488  }
489  printk(BIOS_DEBUG, "\n");
490  /* Process and list the configs. */
492  if (!config->kernel) {
493  printk(BIOS_ERR, "config %s has no kernel, skipping.\n",
494  config->name);
495  continue;
496  }
497  if (!config->fdt) {
498  printk(BIOS_ERR, "config %s has no FDT, skipping.\n",
499  config->name);
500  continue;
501  }
502 
503  if (config->ramdisk &&
504  config->ramdisk->compression < 0) {
505  printk(BIOS_WARNING, "Ramdisk is compressed with "
506  "an unsupported algorithm, discarding config %s."
507  "\n", config->name);
508  continue;
509  }
510 
512  continue;
513 
514  printk(BIOS_DEBUG, "FIT: config %s", config->name);
515  if (default_config_name &&
516  !strcmp(config->name, default_config_name)) {
517  printk(BIOS_DEBUG, " (default)");
518  default_config = config;
519  }
520  printk(BIOS_DEBUG, ", kernel %s", config->kernel->name);
521  printk(BIOS_DEBUG, ", fdt %s", config->fdt->name);
522  list_for_each(overlay_chain, config->overlays, list_node)
523  printk(BIOS_DEBUG, " %s", overlay_chain->overlay->name);
524  if (config->ramdisk)
525  printk(BIOS_DEBUG, ", ramdisk %s",
526  config->ramdisk->name);
527  if (config->compat.name) {
528  printk(BIOS_DEBUG, ", compat");
529  int bytes = config->compat.size;
530  const char *compat_str = config->compat.data;
531  for (int pos = 0; bytes && compat_str[0]; pos++) {
532  printk(BIOS_DEBUG, " %s", compat_str);
533  if (pos == config->compat_pos)
534  printk(BIOS_DEBUG, " (match)");
535  int len = strlen(compat_str) + 1;
536  compat_str += len;
537  bytes -= len;
538  }
539 
540  if (config->compat_rank >= 0 && (!compat_config ||
541  config->compat_rank > compat_config->compat_rank))
542  compat_config = config;
543  }
544  printk(BIOS_DEBUG, "\n");
545  }
546 
547  struct fit_config_node *to_boot = NULL;
548  if (compat_config) {
549  to_boot = compat_config;
550  printk(BIOS_INFO, "FIT: Choosing best match %s for compat "
551  "%s.\n", to_boot->name, to_boot->compat_string);
552  } else if (default_config) {
553  to_boot = default_config;
554  printk(BIOS_INFO, "FIT: No match, choosing default %s.\n",
555  to_boot->name);
556  } else {
557  printk(BIOS_ERR, "FIT: No compatible or default configs. "
558  "Giving up.\n");
559  return NULL;
560  }
561 
562  return to_boot;
563 }
const char * name
Definition: mmu.c:92
#define assert(statement)
Definition: assert.h:74
static struct sdram_info params
Definition: sdram_configs.c:83
#define UNDEFINED_STRAPPING_ID
Definition: boardid.h:8
uint32_t sku_id(void)
bool bootmem_walk_os_mem(range_action_t action, void *arg)
Walk memory tables from OS point of view and call the provided function, for every region.
Definition: bootmem.c:169
@ BM_MEM_RAM
Definition: bootmem.h:23
@ BM_MEM_RESERVED
Definition: bootmem.h:24
#define MIN(a, b)
Definition: helpers.h:37
#define ALIGN_DOWN(x, a)
Definition: helpers.h:18
#define MiB
Definition: helpers.h:76
#define ALIGN_UP(x, a)
Definition: helpers.h:17
#define DIV_ROUND_UP(x, y)
Definition: helpers.h:60
@ CBFS_COMPRESS_LZMA
@ CBFS_COMPRESS_NONE
@ CBFS_COMPRESS_LZ4
#define xzalloc(size)
Definition: stdlib.h:41
#define printk(level,...)
Definition: stdlib.h:16
static int tolower(int c)
Definition: ctype.h:49
void dt_read_cell_props(const struct device_tree_node *node, u32 *addrcp, u32 *sizecp)
Definition: device_tree.c:506
struct device_tree_node * dt_find_node(struct device_tree_node *parent, const char **path, u32 *addrcp, u32 *sizecp, int create)
Definition: device_tree.c:532
void dt_add_bin_prop(struct device_tree_node *node, const char *name, void *data, size_t size)
Definition: device_tree.c:874
int fdt_next_property(const void *blob, uint32_t offset, struct fdt_property *prop)
Definition: device_tree.c:19
int fdt_node_name(const void *blob, uint32_t offset, const char **name)
Definition: device_tree.c:44
void dt_add_string_prop(struct device_tree_node *node, const char *name, const char *str)
Definition: device_tree.c:944
struct device_tree_node * dt_find_node_by_path(struct device_tree *tree, const char *path, u32 *addrcp, u32 *sizecp, int create)
Definition: device_tree.c:586
struct device_tree * fdt_unflatten(const void *blob)
Definition: device_tree.c:237
const char * dt_find_string_prop(const struct device_tree_node *node, const char *name)
Definition: device_tree.c:901
void dt_add_u64_prop(struct device_tree_node *node, const char *name, u64 val)
Definition: device_tree.c:971
void dt_write_int(u8 *dest, u64 src, size_t length)
Definition: device_tree.c:840
uint32_t board_id(void)
board_id() - Get the board version
Definition: ec_boardid.c:6
static size_t offset
Definition: flashconsole.c:16
uint64_t length
Definition: fw_cfg_if.h:1
struct bootblock_arg arg
Definition: decompressor.c:22
static struct fit_image_node * find_image(const char *name)
Definition: fit.c:73
static void config_node(struct device_tree_node *node)
Definition: fit.c:136
static struct fit_image_node * find_image_with_overlays(const char *name, int bytes, struct list_node *prev)
Definition: fit.c:84
static struct list_node config_nodes
Definition: fit.c:18
static int fit_update_compat(struct fit_config_node *config)
Definition: fit.c:405
static char * clean_compat_string(char *str)
Definition: fit.c:27
void fit_add_compat_string(const char *str)
Definition: fit.c:322
static bool walk_memory_table(const struct range_entry *r, void *arg)
Definition: fit.c:287
static int fit_check_compat(struct fdt_property *compat_prop, const char *compat_name)
Definition: fit.c:197
static int fdt_find_compat(const void *blob, uint32_t start_offset, struct fdt_property *prop)
Definition: fit.c:175
static void fit_add_default_compat_strings(void)
Definition: fit.c:38
static void update_mem_property(u64 start, u64 end, struct entry_params *params)
Definition: fit.c:263
void fit_update_chosen(struct device_tree *tree, const char *cmd_line)
Definition: fit.c:213
struct fit_config_node * fit_load(void *fit)
Definition: fit.c:455
static struct list_node compat_strings
Definition: fit.c:19
void fit_add_ramdisk(struct device_tree *tree, void *ramdisk_addr, size_t ramdisk_size)
Definition: fit.c:222
static void update_reserve_map(uint64_t start, uint64_t end, struct device_tree *tree)
Definition: fit.c:236
static struct list_node image_nodes
Definition: fit.c:17
static void fit_unpack(struct device_tree *tree, const char **default_config)
Definition: fit.c:157
void fit_update_memory(struct device_tree *tree)
Definition: fit.c:334
static void image_node(struct device_tree_node *node)
Definition: fit.c:109
static uint64_t max_range(unsigned int size_cells)
Definition: fit.c:253
#define list_for_each(ptr, head, member)
Definition: list.h:21
void list_insert_after(struct list_node *node, struct list_node *after)
Definition: list.c:14
void list_remove(struct list_node *node)
Definition: list.c:6
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
Definition: loglevel.h:86
enum board_config config
Definition: memory.c:448
static resource_t range_entry_base(const struct range_entry *r)
Definition: memrange.h:44
static resource_t range_entry_end(const struct range_entry *r)
Definition: memrange.h:50
#define memranges_each_entry(r, ranges)
Definition: memrange.h:82
static unsigned long range_entry_tag(const struct range_entry *r)
Definition: memrange.h:61
void memranges_teardown(struct memranges *ranges)
Definition: memrange.c:321
void memranges_insert(struct memranges *ranges, resource_t base, resource_t size, unsigned long tag)
Definition: memrange.c:236
#define memranges_init_empty(__ranges, __free, __num_free)
Definition: memrange.h:102
static resource_t range_entry_size(const struct range_entry *r)
Definition: memrange.h:56
uintptr_t base
Definition: uart.c:17
#define NULL
Definition: stddef.h:19
uint64_t u64
Definition: stdint.h:54
unsigned int uint32_t
Definition: stdint.h:14
uint32_t u32
Definition: stdint.h:51
unsigned long uintptr_t
Definition: stdint.h:21
unsigned long long uint64_t
Definition: stdint.h:17
uint8_t u8
Definition: stdint.h:45
int strcmp(const char *s1, const char *s2)
Definition: string.c:103
int strncmp(const char *s1, const char *s2, int maxlen)
Definition: string.c:114
size_t strnlen(const char *src, size_t max)
Definition: string.c:34
char * strdup(const char *s)
Definition: string.c:7
size_t strlen(const char *src)
Definition: string.c:42
Definition: fit.c:21
const char * compat_string
Definition: fit.c:22
struct list_node list_node
Definition: fit.c:23
struct list_node list_node
Definition: device_tree.h:67
struct list_node children
Definition: device_tree.h:65
const char * name
Definition: device_tree.h:59
struct list_node properties
Definition: device_tree.h:63
struct fdt_property prop
Definition: device_tree.h:52
Definition: device_tree.h:71
uint64_t size
Definition: device_tree.h:73
struct list_node list_node
Definition: device_tree.h:75
uint64_t start
Definition: device_tree.h:72
struct list_node reserve_map
Definition: device_tree.h:84
struct device_tree_node * root
Definition: device_tree.h:86
unsigned int size_cells
Definition: fit.c:249
unsigned int addr_cells
Definition: fit.c:248
void * data
Definition: fit.c:250
uint32_t structure_offset
Definition: device_tree.h:18
void * data
Definition: device_tree.h:42
uint32_t size
Definition: device_tree.h:43
const char * name
Definition: device_tree.h:41
const char * name
Definition: fit.h:23
int compat_rank
Definition: fit.h:29
const char * compat_string
Definition: fit.h:31
int compression
Definition: fit.h:17
struct list_node list_node
Definition: fit.h:19
uint32_t size
Definition: fit.h:16
void * data
Definition: fit.h:15
const char * name
Definition: fit.h:14
struct fit_image_node * overlay
Definition: fit.h:37
struct list_node list_node
Definition: fit.h:38
Definition: list.h:7
Definition: fit.c:282
struct memranges mem
Definition: fit.c:283
struct memranges reserved
Definition: fit.c:284
Definition: memrange.h:24
#define count
int snprintf(char *buf, size_t size, const char *fmt,...)
Note: This file is only for POSIX compatibility, and is meant to be chain-included via string....
Definition: vsprintf.c:35