blob: a8482b49d3f34d208d9d6eb0f237c1a4e85dcfd6 [file] [log] [blame]
David Gibsonab870ca2005-06-23 15:45:13 +10001#ifndef _FLAT_DT_H_
2#define _FLAT_DT_H_
3
4
Jerry Van Barencd1da872007-03-18 16:49:24 -04005#define OF_DEFAULT_VERSION 17
6
David Gibsonab870ca2005-06-23 15:45:13 +10007#define OF_DT_HEADER 0xd00dfeed /* 4: version, 4: total size */
8
9#define OF_DT_BEGIN_NODE 0x1 /* Start node: full name */
10#define OF_DT_END_NODE 0x2 /* End node */
11#define OF_DT_PROP 0x3 /* Property: name off,
David Gibsonb2543fc2005-08-29 14:58:27 +100012 size, content */
13#define OF_DT_NOP 0x4 /* nop */
David Gibsonab870ca2005-06-23 15:45:13 +100014#define OF_DT_END 0x9
15
16struct boot_param_header {
17 uint32_t magic; /* magic word OF_DT_HEADER */
18 uint32_t totalsize; /* total size of DT block */
19 uint32_t off_dt_struct; /* offset to structure */
20 uint32_t off_dt_strings; /* offset to strings */
21 uint32_t off_mem_rsvmap; /* offset to memory reserve map */
22 uint32_t version; /* format version */
23 uint32_t last_comp_version; /* last compatible version */
24
25 /* version 2 fields below */
26 uint32_t boot_cpuid_phys; /* Which physical CPU id we're
27 booting on */
28 /* version 3 fields below */
29 uint32_t size_dt_strings; /* size of the strings block */
David Gibson46c88df2007-03-14 11:02:40 +110030
31 /* version 17 fields below */
32 uint32_t size_dt_struct; /* size of the DT structure block */
David Gibsonab870ca2005-06-23 15:45:13 +100033};
34
35#define BPH_V1_SIZE (7*sizeof(uint32_t))
36#define BPH_V2_SIZE (BPH_V1_SIZE + sizeof(uint32_t))
37#define BPH_V3_SIZE (BPH_V2_SIZE + sizeof(uint32_t))
David Gibson46c88df2007-03-14 11:02:40 +110038#define BPH_V17_SIZE (BPH_V3_SIZE + sizeof(uint32_t))
David Gibsonab870ca2005-06-23 15:45:13 +100039
40struct reserve_entry {
41 uint64_t address;
42 uint64_t size;
43};
44
45struct flat_dt_property {
David Gibsonab870ca2005-06-23 15:45:13 +100046 uint32_t len;
David Gibson6ae55f92007-02-26 11:02:24 +110047 uint32_t nameoff;
David Gibsonab870ca2005-06-23 15:45:13 +100048 char data[0];
49};
50
51#endif /* _FLAT_DT_H_ */