coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fit.h
Go to the documentation of this file.
1 /* Taken from depthcharge: src/boot/fit.h */
2 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 
4 #ifndef __LIB_FIT_H__
5 #define __LIB_FIT_H__
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 #include <device_tree.h>
10 #include <list.h>
11 #include <program_loading.h>
12 
14  const char *name;
15  void *data;
18 
19  struct list_node list_node;
20 };
21 
23  const char *name;
26  struct list_node overlays;
28  struct fdt_property compat;
31  const char *compat_string;
32 
33  struct list_node list_node;
34 };
35 
38  struct list_node list_node;
39 };
40 
41 /*
42  * Updates the cmdline in the devicetree.
43  */
44 void fit_update_chosen(struct device_tree *tree, const char *cmd_line);
45 
46 /*
47  * Add a compat string to the list of supported board ids.
48  * Has to be called before fit_load().
49  * The most common use-case would be to implement it on board level.
50  * Strings that were added first have a higher priority on finding a match.
51  */
52 void fit_add_compat_string(const char *str);
53 
54 /*
55  * Updates the memory section in the devicetree.
56  */
57 void fit_update_memory(struct device_tree *tree);
58 
59 /*
60  * Do architecture specific payload placements and fixups.
61  * Set entrypoint and first argument (if any).
62  * @param payload The payload, to set the entry point
63  * @param config The extracted FIT config
64  * @param kernel out-argument where to place the kernel
65  * @param fdt out-argument where to place the devicetree
66  * @param initrd out-argument where to place the initrd (optional)
67  * @return True if all config nodes could be placed, the corresponding
68  * regions have been updated and the entry point has been set.
69  * False on error.
70  */
71 bool fit_payload_arch(struct prog *payload, struct fit_config_node *config,
72  struct region *kernel,
73  struct region *fdt,
74  struct region *initrd);
75 
76 /*
77  * Unpack a FIT image into memory, choosing the right configuration through the
78  * compatible string set by fit_add_compat() and return the selected config
79  * node.
80  */
81 struct fit_config_node *fit_load(void *fit);
82 
83 void fit_add_ramdisk(struct device_tree *tree, void *ramdisk_addr,
84  size_t ramdisk_size);
85 
86 #endif /* __LIB_FIT_H__ */
bool fit_payload_arch(struct prog *payload, struct fit_config_node *config, struct region *kernel, struct region *fdt, struct region *initrd)
Definition: fit_payload.c:30
void fit_add_compat_string(const char *str)
Definition: fit.c:322
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
void fit_add_ramdisk(struct device_tree *tree, void *ramdisk_addr, size_t ramdisk_size)
Definition: fit.c:222
void fit_update_memory(struct device_tree *tree)
Definition: fit.c:334
enum board_config config
Definition: memory.c:448
unsigned int uint32_t
Definition: stdint.h:14
struct fit_image_node * ramdisk
Definition: fit.h:27
struct fit_image_node * fdt
Definition: fit.h:25
struct fdt_property compat
Definition: fit.h:28
const char * name
Definition: fit.h:23
int compat_rank
Definition: fit.h:29
int compat_pos
Definition: fit.h:30
struct fit_image_node * kernel
Definition: fit.h:24
const char * compat_string
Definition: fit.h:31
struct list_node overlays
Definition: fit.h:26
int compression
Definition: fit.h:17
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
Definition: list.h:7
Definition: region.h:76