diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-08-06 22:24:17 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-20 02:34:58 -0400 |
commit | ed95d7450dcbfeb45ffc9d39b1747aee82b49a51 (patch) | |
tree | faca7d89e2907e1407161f967477ed2ae21d46bb /arch/powerpc/boot/dtc-src/dtc.h | |
parent | 0ec27c049d80535f77901654a310b090106b046c (diff) |
powerpc: Update in-kernel dtc and libfdt to version 1.2.0
Some time ago, a copies of the upstream dtc and libfdt sources were
included in the kernel tree to avoid having these as external
dependencies for building the kernel. Since then development on the
upstream dtc and libfdt has continued. This updates the in-kernel
versions to match the recently released upstream dtc version 1.2.0.
This includes a number of bugfixes, many cleanups and a few new
features.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/dtc-src/dtc.h')
-rw-r--r-- | arch/powerpc/boot/dtc-src/dtc.h | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/arch/powerpc/boot/dtc-src/dtc.h b/arch/powerpc/boot/dtc-src/dtc.h index 65281777a167..08d54c870086 100644 --- a/arch/powerpc/boot/dtc-src/dtc.h +++ b/arch/powerpc/boot/dtc-src/dtc.h | |||
@@ -30,10 +30,8 @@ | |||
30 | #include <ctype.h> | 30 | #include <ctype.h> |
31 | #include <errno.h> | 31 | #include <errno.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include <netinet/in.h> | ||
34 | #include <endian.h> | ||
35 | #include <byteswap.h> | ||
36 | 33 | ||
34 | #include <libfdt_env.h> | ||
37 | #include <fdt.h> | 35 | #include <fdt.h> |
38 | 36 | ||
39 | #define DEFAULT_FDT_VERSION 17 | 37 | #define DEFAULT_FDT_VERSION 17 |
@@ -75,25 +73,8 @@ static inline void *xrealloc(void *p, size_t len) | |||
75 | return new; | 73 | return new; |
76 | } | 74 | } |
77 | 75 | ||
78 | typedef uint8_t u8; | 76 | typedef uint32_t cell_t; |
79 | typedef uint16_t u16; | ||
80 | typedef uint32_t u32; | ||
81 | typedef uint64_t u64; | ||
82 | typedef u32 cell_t; | ||
83 | 77 | ||
84 | #define cpu_to_be16(x) htons(x) | ||
85 | #define be16_to_cpu(x) ntohs(x) | ||
86 | |||
87 | #define cpu_to_be32(x) htonl(x) | ||
88 | #define be32_to_cpu(x) ntohl(x) | ||
89 | |||
90 | #if __BYTE_ORDER == __BIG_ENDIAN | ||
91 | #define cpu_to_be64(x) (x) | ||
92 | #define be64_to_cpu(x) (x) | ||
93 | #else | ||
94 | #define cpu_to_be64(x) bswap_64(x) | ||
95 | #define be64_to_cpu(x) bswap_64(x) | ||
96 | #endif | ||
97 | 78 | ||
98 | #define streq(a, b) (strcmp((a), (b)) == 0) | 79 | #define streq(a, b) (strcmp((a), (b)) == 0) |
99 | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | 80 | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) |
@@ -118,7 +99,6 @@ struct marker { | |||
118 | struct data { | 99 | struct data { |
119 | int len; | 100 | int len; |
120 | char *val; | 101 | char *val; |
121 | int asize; | ||
122 | struct marker *markers; | 102 | struct marker *markers; |
123 | }; | 103 | }; |
124 | 104 | ||
@@ -145,7 +125,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m, | |||
145 | struct data data_merge(struct data d1, struct data d2); | 125 | struct data data_merge(struct data d1, struct data d2); |
146 | struct data data_append_cell(struct data d, cell_t word); | 126 | struct data data_append_cell(struct data d, cell_t word); |
147 | struct data data_append_re(struct data d, const struct fdt_reserve_entry *re); | 127 | struct data data_append_re(struct data d, const struct fdt_reserve_entry *re); |
148 | struct data data_append_addr(struct data d, u64 addr); | 128 | struct data data_append_addr(struct data d, uint64_t addr); |
149 | struct data data_append_byte(struct data d, uint8_t byte); | 129 | struct data data_append_byte(struct data d, uint8_t byte); |
150 | struct data data_append_zeroes(struct data d, int len); | 130 | struct data data_append_zeroes(struct data d, int len); |
151 | struct data data_append_align(struct data d, int align); | 131 | struct data data_append_align(struct data d, int align); |
@@ -223,7 +203,7 @@ struct reserve_info { | |||
223 | char *label; | 203 | char *label; |
224 | }; | 204 | }; |
225 | 205 | ||
226 | struct reserve_info *build_reserve_entry(u64 start, u64 len, char *label); | 206 | struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len, char *label); |
227 | struct reserve_info *chain_reserve_entry(struct reserve_info *first, | 207 | struct reserve_info *chain_reserve_entry(struct reserve_info *first, |
228 | struct reserve_info *list); | 208 | struct reserve_info *list); |
229 | struct reserve_info *add_reserve_entry(struct reserve_info *list, | 209 | struct reserve_info *add_reserve_entry(struct reserve_info *list, |
@@ -233,24 +213,22 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list, | |||
233 | struct boot_info { | 213 | struct boot_info { |
234 | struct reserve_info *reservelist; | 214 | struct reserve_info *reservelist; |
235 | struct node *dt; /* the device tree */ | 215 | struct node *dt; /* the device tree */ |
216 | uint32_t boot_cpuid_phys; | ||
236 | }; | 217 | }; |
237 | 218 | ||
238 | struct boot_info *build_boot_info(struct reserve_info *reservelist, | 219 | struct boot_info *build_boot_info(struct reserve_info *reservelist, |
239 | struct node *tree); | 220 | struct node *tree, uint32_t boot_cpuid_phys); |
240 | 221 | ||
241 | /* Checks */ | 222 | /* Checks */ |
242 | 223 | ||
243 | void process_checks(int force, struct boot_info *bi, | 224 | void process_checks(int force, struct boot_info *bi); |
244 | int checkflag, int outversion, int boot_cpuid_phys); | ||
245 | 225 | ||
246 | /* Flattened trees */ | 226 | /* Flattened trees */ |
247 | 227 | ||
248 | void dt_to_blob(FILE *f, struct boot_info *bi, int version, | 228 | void dt_to_blob(FILE *f, struct boot_info *bi, int version); |
249 | int boot_cpuid_phys); | 229 | void dt_to_asm(FILE *f, struct boot_info *bi, int version); |
250 | void dt_to_asm(FILE *f, struct boot_info *bi, int version, | ||
251 | int boot_cpuid_phys); | ||
252 | 230 | ||
253 | struct boot_info *dt_from_blob(FILE *f); | 231 | struct boot_info *dt_from_blob(const char *fname); |
254 | 232 | ||
255 | /* Tree source */ | 233 | /* Tree source */ |
256 | 234 | ||
@@ -264,6 +242,5 @@ struct boot_info *dt_from_fs(const char *dirname); | |||
264 | /* misc */ | 242 | /* misc */ |
265 | 243 | ||
266 | char *join_path(const char *path, const char *name); | 244 | char *join_path(const char *path, const char *name); |
267 | void fill_fullpaths(struct node *tree, const char *prefix); | ||
268 | 245 | ||
269 | #endif /* _DTC_H */ | 246 | #endif /* _DTC_H */ |