aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/dtc-src/treesource.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2008-08-06 22:24:17 -0400
committerPaul Mackerras <paulus@samba.org>2008-08-20 02:34:58 -0400
commited95d7450dcbfeb45ffc9d39b1747aee82b49a51 (patch)
treefaca7d89e2907e1407161f967477ed2ae21d46bb /arch/powerpc/boot/dtc-src/treesource.c
parent0ec27c049d80535f77901654a310b090106b046c (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/treesource.c')
-rw-r--r--arch/powerpc/boot/dtc-src/treesource.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/boot/dtc-src/treesource.c b/arch/powerpc/boot/dtc-src/treesource.c
index a6a776797636..ebeb6eb27907 100644
--- a/arch/powerpc/boot/dtc-src/treesource.c
+++ b/arch/powerpc/boot/dtc-src/treesource.c
@@ -23,20 +23,23 @@
23 23
24extern FILE *yyin; 24extern FILE *yyin;
25extern int yyparse(void); 25extern int yyparse(void);
26extern void yyerror(char const *);
27 26
28struct boot_info *the_boot_info; 27struct boot_info *the_boot_info;
28int treesource_error;
29 29
30struct boot_info *dt_from_source(const char *fname) 30struct boot_info *dt_from_source(const char *fname)
31{ 31{
32 the_boot_info = NULL; 32 the_boot_info = NULL;
33 treesource_error = 0;
33 34
34 push_input_file(fname); 35 srcpos_file = dtc_open_file(fname, NULL);
36 yyin = srcpos_file->file;
35 37
36 if (yyparse() != 0) 38 if (yyparse() != 0)
37 return NULL; 39 die("Unable to parse input tree\n");
38 40
39 fill_fullpaths(the_boot_info->dt, ""); 41 if (treesource_error)
42 die("Syntax error parsing input tree\n");
40 43
41 return the_boot_info; 44 return the_boot_info;
42} 45}
@@ -144,7 +147,7 @@ static void write_propval_cells(FILE *f, struct data val)
144 m = m->next; 147 m = m->next;
145 } 148 }
146 149
147 fprintf(f, "0x%x", be32_to_cpu(*cp++)); 150 fprintf(f, "0x%x", fdt32_to_cpu(*cp++));
148 if ((void *)cp >= propend) 151 if ((void *)cp >= propend)
149 break; 152 break;
150 fprintf(f, " "); 153 fprintf(f, " ");
@@ -173,7 +176,7 @@ static void write_propval_bytes(FILE *f, struct data val)
173 } 176 }
174 177
175 fprintf(f, "%02hhx", *bp++); 178 fprintf(f, "%02hhx", *bp++);
176 if ((void *)bp >= propend) 179 if ((const void *)bp >= propend)
177 break; 180 break;
178 fprintf(f, " "); 181 fprintf(f, " ");
179 } 182 }