Mayank Grover | f3b7818 | 2017-12-19 13:31:30 +0530 | [diff] [blame] | 1 | #ifndef UFDT_OVERLAY_H |
| 2 | #define UFDT_OVERLAY_H |
| 3 | |
| 4 | #include <libfdt.h> |
| 5 | /* Given a buffer in RAM containing the contents of a .dtb file, |
| 6 | * it initializes an FDT in-place and returns a pointer to the |
| 7 | * given buffer, or NULL in case of error. |
| 8 | * In case of error, it may printf() diagnostic messages. |
| 9 | */ |
| 10 | struct fdt_header *ufdt_install_blob(void *blob, size_t blob_size); |
| 11 | |
| 12 | /* Given a main_fdt_header buffer and an overlay_fdtp buffer containing the |
| 13 | * contents of a .dtbo file, it creates a new FDT containing the applied |
| 14 | * overlay_fdtp in a dto_malloc'd buffer and returns it, or NULL in case of |
| 15 | * error. |
| 16 | * It is allowed to modify the buffers (both main_fdt_header and overlay_fdtp |
| 17 | * buffer) passed in. |
| 18 | * It does not dto_free main_fdt_header and overlay_fdtp buffer passed in. |
| 19 | */ |
| 20 | struct fdt_header *ufdt_apply_overlay(struct fdt_header *main_fdt_header, |
| 21 | size_t main_fdt_size, |
| 22 | void *overlay_fdtp, |
| 23 | size_t overlay_size); |
| 24 | |
| 25 | #endif /* UFDT_OVERLAY_H */ |