]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Include/fdt.h
Check the input VaraibleName for db/dbx when appending variables with formatted as...
[mirror_edk2.git] / EmbeddedPkg / Include / fdt.h
1 /** @file
2 *
3 * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
4 *
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
9 *
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14
15 #ifndef _FDT_H
16 #define _FDT_H
17
18 #ifndef __ASSEMBLY__
19
20 struct fdt_header {
21 uint32_t magic; /* magic word FDT_MAGIC */
22 uint32_t totalsize; /* total size of DT block */
23 uint32_t off_dt_struct; /* offset to structure */
24 uint32_t off_dt_strings; /* offset to strings */
25 uint32_t off_mem_rsvmap; /* offset to memory reserve map */
26 uint32_t version; /* format version */
27 uint32_t last_comp_version; /* last compatible version */
28
29 /* version 2 fields below */
30 uint32_t boot_cpuid_phys; /* Which physical CPU id we're
31 booting on */
32 /* version 3 fields below */
33 uint32_t size_dt_strings; /* size of the strings block */
34
35 /* version 17 fields below */
36 uint32_t size_dt_struct; /* size of the structure block */
37 };
38
39 struct fdt_reserve_entry {
40 uint64_t address;
41 uint64_t size;
42 };
43
44 struct fdt_node_header {
45 uint32_t tag;
46 char name[0];
47 };
48
49 struct fdt_property {
50 uint32_t tag;
51 uint32_t len;
52 uint32_t nameoff;
53 char data[0];
54 };
55
56 #endif /* !__ASSEMBLY */
57
58 #define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
59 #define FDT_TAGSIZE sizeof(uint32_t)
60
61 #define FDT_BEGIN_NODE 0x1 /* Start node: full name */
62 #define FDT_END_NODE 0x2 /* End node */
63 #define FDT_PROP 0x3 /* Property: name off,
64 size, content */
65 #define FDT_NOP 0x4 /* nop */
66 #define FDT_END 0x9
67
68 #define FDT_V1_SIZE (7*sizeof(uint32_t))
69 #define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
70 #define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
71 #define FDT_V16_SIZE FDT_V3_SIZE
72 #define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
73
74 #endif /* _FDT_H */