2 * Auxiliary kernel loader for Qualcom IPQ-4XXX/806X based boards
4 * Copyright (C) 2019 Sergey Sergeev <adron@mstnt.com>
6 * Some structures and code has been taken from the U-Boot project.
7 * (C) Copyright 2008 Semihalf
8 * (C) Copyright 2000-2005
9 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License version 2 as published
13 * by the Free Software Foundation.
22 uint32_t magic
; /* magic word FDT_MAGIC */
23 uint32_t totalsize
; /* total size of DT block */
24 uint32_t off_dt_struct
; /* offset to structure */
25 uint32_t off_dt_strings
; /* offset to strings */
26 uint32_t off_mem_rsvmap
; /* offset to memory reserve map */
27 uint32_t version
; /* format version */
28 uint32_t last_comp_version
; /* last compatible version */
30 /* version 2 fields below */
31 uint32_t boot_cpuid_phys
; /* Which physical CPU id we're
33 /* version 3 fields below */
34 uint32_t size_dt_strings
; /* size of the strings block */
36 /* version 17 fields below */
37 uint32_t size_dt_struct
; /* size of the structure block */
40 struct fdt_reserve_entry
{
45 struct fdt_node_header
{
57 #endif /* !__ASSEMBLY */
59 #define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
60 #define FDT_TAGSIZE sizeof(uint32_t)
62 #define FDT_BEGIN_NODE 0x1 /* Start node: full name */
63 #define FDT_END_NODE 0x2 /* End node */
64 #define FDT_PROP 0x3 /* Property: name off,
66 #define FDT_NOP 0x4 /* nop */
69 #define FDT_V1_SIZE (7*sizeof(uint32_t))
70 #define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
71 #define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
72 #define FDT_V16_SIZE FDT_V3_SIZE
73 #define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
75 /* adding a ramdisk needs 0x44 bytes in version 2008.10 */
76 #define FDT_RAMDISK_OVERHEAD 0x80