David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 1 | #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 Gibson | b2543fc | 2005-08-29 14:58:27 +1000 | [diff] [blame] | 10 | size, content */ |
| 11 | #define OF_DT_NOP 0x4 /* nop */ |
David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 12 | #define OF_DT_END 0x9 |
| 13 | |
| 14 | struct 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 Gibson | 46c88df | 2007-03-14 11:02:40 +1100 | [diff] [blame^] | 28 | |
| 29 | /* version 17 fields below */ |
| 30 | uint32_t size_dt_struct; /* size of the DT structure block */ |
David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 31 | }; |
| 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 Gibson | 46c88df | 2007-03-14 11:02:40 +1100 | [diff] [blame^] | 36 | #define BPH_V17_SIZE (BPH_V3_SIZE + sizeof(uint32_t)) |
David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 37 | |
| 38 | struct reserve_entry { |
| 39 | uint64_t address; |
| 40 | uint64_t size; |
| 41 | }; |
| 42 | |
| 43 | struct flat_dt_property { |
David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 44 | uint32_t len; |
David Gibson | 6ae55f9 | 2007-02-26 11:02:24 +1100 | [diff] [blame] | 45 | uint32_t nameoff; |
David Gibson | ab870ca | 2005-06-23 15:45:13 +1000 | [diff] [blame] | 46 | char data[0]; |
| 47 | }; |
| 48 | |
| 49 | #endif /* _FLAT_DT_H_ */ |