blob: d5abd80862d3c04ce6ccf346747ff4f8753094c1 [file] [log] [blame]
David Gibsonab870ca2005-06-23 15:45:13 +10001#ifndef _FLAT_DT_H_
2#define _FLAT_DT_H_
3
4
5#define OF_DT_HEADER 0xd00dfeed /* 4: version, 4: total size */
6
7#define OF_DT_BEGIN_NODE 0x1 /* Start node: full name */
8#define OF_DT_END_NODE 0x2 /* End node */
9#define OF_DT_PROP 0x3 /* Property: name off,
David Gibsonb2543fc2005-08-29 14:58:27 +100010 size, content */
11#define OF_DT_NOP 0x4 /* nop */
David Gibsonab870ca2005-06-23 15:45:13 +100012#define OF_DT_END 0x9
13
14struct boot_param_header {
15 uint32_t magic; /* magic word OF_DT_HEADER */
16 uint32_t totalsize; /* total size of DT block */
17 uint32_t off_dt_struct; /* offset to structure */
18 uint32_t off_dt_strings; /* offset to strings */
19 uint32_t off_mem_rsvmap; /* offset to memory reserve map */
20 uint32_t version; /* format version */
21 uint32_t last_comp_version; /* last compatible version */
22
23 /* version 2 fields below */
24 uint32_t boot_cpuid_phys; /* Which physical CPU id we're
25 booting on */
26 /* version 3 fields below */
27 uint32_t size_dt_strings; /* size of the strings block */
David Gibson46c88df2007-03-14 11:02:40 +110028
29 /* version 17 fields below */
30 uint32_t size_dt_struct; /* size of the DT structure block */
David Gibsonab870ca2005-06-23 15:45:13 +100031};
32
33#define BPH_V1_SIZE (7*sizeof(uint32_t))
34#define BPH_V2_SIZE (BPH_V1_SIZE + sizeof(uint32_t))
35#define BPH_V3_SIZE (BPH_V2_SIZE + sizeof(uint32_t))
David Gibson46c88df2007-03-14 11:02:40 +110036#define BPH_V17_SIZE (BPH_V3_SIZE + sizeof(uint32_t))
David Gibsonab870ca2005-06-23 15:45:13 +100037
38struct reserve_entry {
39 uint64_t address;
40 uint64_t size;
41};
42
43struct flat_dt_property {
David Gibsonab870ca2005-06-23 15:45:13 +100044 uint32_t len;
David Gibson6ae55f92007-02-26 11:02:24 +110045 uint32_t nameoff;
David Gibsonab870ca2005-06-23 15:45:13 +100046 char data[0];
47};
48
49#endif /* _FLAT_DT_H_ */