1 /* SPDX-License-Identifier: (GPL-2.0-or-later !! 1 #ifndef _FDT_H 2 #ifndef FDT_H !! 2 #define _FDT_H 3 #define FDT_H << 4 /* << 5 * libfdt - Flat Device Tree manipulation << 6 * Copyright (C) 2006 David Gibson, IBM Corpor << 7 * Copyright 2012 Kim Phillips, Freescale Semi << 8 */ << 9 3 10 #ifndef __ASSEMBLY__ 4 #ifndef __ASSEMBLY__ 11 5 12 struct fdt_header { 6 struct fdt_header { 13 fdt32_t magic; /* ma !! 7 uint32_t magic; /* magic word FDT_MAGIC */ 14 fdt32_t totalsize; /* to !! 8 uint32_t totalsize; /* total size of DT block */ 15 fdt32_t off_dt_struct; /* of !! 9 uint32_t off_dt_struct; /* offset to structure */ 16 fdt32_t off_dt_strings; /* of !! 10 uint32_t off_dt_strings; /* offset to strings */ 17 fdt32_t off_mem_rsvmap; /* of !! 11 uint32_t off_mem_rsvmap; /* offset to memory reserve map */ 18 fdt32_t version; /* fo !! 12 uint32_t version; /* format version */ 19 fdt32_t last_comp_version; /* la !! 13 uint32_t last_comp_version; /* last compatible version */ 20 14 21 /* version 2 fields below */ 15 /* version 2 fields below */ 22 fdt32_t boot_cpuid_phys; /* Wh !! 16 uint32_t boot_cpuid_phys; /* Which physical CPU id we're 23 bo 17 booting on */ 24 /* version 3 fields below */ 18 /* version 3 fields below */ 25 fdt32_t size_dt_strings; /* si !! 19 uint32_t size_dt_strings; /* size of the strings block */ 26 20 27 /* version 17 fields below */ 21 /* version 17 fields below */ 28 fdt32_t size_dt_struct; /* si !! 22 uint32_t size_dt_struct; /* size of the structure block */ 29 }; 23 }; 30 24 31 struct fdt_reserve_entry { 25 struct fdt_reserve_entry { 32 fdt64_t address; !! 26 uint64_t address; 33 fdt64_t size; !! 27 uint64_t size; 34 }; 28 }; 35 29 36 struct fdt_node_header { 30 struct fdt_node_header { 37 fdt32_t tag; !! 31 uint32_t tag; 38 char name[]; !! 32 char name[0]; 39 }; 33 }; 40 34 41 struct fdt_property { 35 struct fdt_property { 42 fdt32_t tag; !! 36 uint32_t tag; 43 fdt32_t len; !! 37 uint32_t len; 44 fdt32_t nameoff; !! 38 uint32_t nameoff; 45 char data[]; !! 39 char data[0]; 46 }; 40 }; 47 41 48 #endif /* !__ASSEMBLY */ 42 #endif /* !__ASSEMBLY */ 49 43 50 #define FDT_MAGIC 0xd00dfeed /* 4: 44 #define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */ 51 #define FDT_TAGSIZE sizeof(fdt32_t) !! 45 #define FDT_TAGSIZE sizeof(uint32_t) 52 46 53 #define FDT_BEGIN_NODE 0x1 /* Sta 47 #define FDT_BEGIN_NODE 0x1 /* Start node: full name */ 54 #define FDT_END_NODE 0x2 /* End 48 #define FDT_END_NODE 0x2 /* End node */ 55 #define FDT_PROP 0x3 /* Pro 49 #define FDT_PROP 0x3 /* Property: name off, 56 siz 50 size, content */ 57 #define FDT_NOP 0x4 /* nop 51 #define FDT_NOP 0x4 /* nop */ 58 #define FDT_END 0x9 52 #define FDT_END 0x9 59 53 60 #define FDT_V1_SIZE (7*sizeof(fdt32_t)) !! 54 #define FDT_V1_SIZE (7*sizeof(uint32_t)) 61 #define FDT_V2_SIZE (FDT_V1_SIZE + sizeof( !! 55 #define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t)) 62 #define FDT_V3_SIZE (FDT_V2_SIZE + sizeof( !! 56 #define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t)) 63 #define FDT_V16_SIZE FDT_V3_SIZE 57 #define FDT_V16_SIZE FDT_V3_SIZE 64 #define FDT_V17_SIZE (FDT_V16_SIZE + sizeof !! 58 #define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t)) 65 59 66 #endif /* FDT_H */ !! 60 #endif /* _FDT_H */ 67 61
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.