aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/dtc-src/dtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/dtc-src/dtc.h')
-rw-r--r--arch/powerpc/boot/dtc-src/dtc.h43
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
78typedef uint8_t u8; 76typedef uint32_t cell_t;
79typedef uint16_t u16;
80typedef uint32_t u32;
81typedef uint64_t u64;
82typedef 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 {
118struct data { 99struct 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,
145struct data data_merge(struct data d1, struct data d2); 125struct data data_merge(struct data d1, struct data d2);
146struct data data_append_cell(struct data d, cell_t word); 126struct data data_append_cell(struct data d, cell_t word);
147struct data data_append_re(struct data d, const struct fdt_reserve_entry *re); 127struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
148struct data data_append_addr(struct data d, u64 addr); 128struct data data_append_addr(struct data d, uint64_t addr);
149struct data data_append_byte(struct data d, uint8_t byte); 129struct data data_append_byte(struct data d, uint8_t byte);
150struct data data_append_zeroes(struct data d, int len); 130struct data data_append_zeroes(struct data d, int len);
151struct data data_append_align(struct data d, int align); 131struct 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
226struct reserve_info *build_reserve_entry(u64 start, u64 len, char *label); 206struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len, char *label);
227struct reserve_info *chain_reserve_entry(struct reserve_info *first, 207struct reserve_info *chain_reserve_entry(struct reserve_info *first,
228 struct reserve_info *list); 208 struct reserve_info *list);
229struct reserve_info *add_reserve_entry(struct reserve_info *list, 209struct reserve_info *add_reserve_entry(struct reserve_info *list,
@@ -233,24 +213,22 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list,
233struct boot_info { 213struct 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
238struct boot_info *build_boot_info(struct reserve_info *reservelist, 219struct 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
243void process_checks(int force, struct boot_info *bi, 224void 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
248void dt_to_blob(FILE *f, struct boot_info *bi, int version, 228void dt_to_blob(FILE *f, struct boot_info *bi, int version);
249 int boot_cpuid_phys); 229void dt_to_asm(FILE *f, struct boot_info *bi, int version);
250void dt_to_asm(FILE *f, struct boot_info *bi, int version,
251 int boot_cpuid_phys);
252 230
253struct boot_info *dt_from_blob(FILE *f); 231struct 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
266char *join_path(const char *path, const char *name); 244char *join_path(const char *path, const char *name);
267void fill_fullpaths(struct node *tree, const char *prefix);
268 245
269#endif /* _DTC_H */ 246#endif /* _DTC_H */