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