diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-08-07 12:24:17 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-20 16:34:58 +1000 |
commit | ed95d7450dcbfeb45ffc9d39b1747aee82b49a51 (patch) | |
tree | faca7d89e2907e1407161f967477ed2ae21d46bb /arch/powerpc/boot/dtc-src/dtc.c | |
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.c')
-rw-r--r-- | arch/powerpc/boot/dtc-src/dtc.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/arch/powerpc/boot/dtc-src/dtc.c b/arch/powerpc/boot/dtc-src/dtc.c index 01131d7c2d5e..d8fd43b4ac1a 100644 --- a/arch/powerpc/boot/dtc-src/dtc.c +++ b/arch/powerpc/boot/dtc-src/dtc.c @@ -55,7 +55,7 @@ char *join_path(const char *path, const char *name) return str; } -void fill_fullpaths(struct node *tree, const char *prefix) +static void fill_fullpaths(struct node *tree, const char *prefix) { struct node *child; const char *unit; @@ -106,7 +106,7 @@ static void __attribute__ ((noreturn)) usage(void) fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); fprintf(stderr, "\t-v\n"); fprintf(stderr, "\t\tPrint DTC version and exit\n"); - exit(2); + exit(3); } int main(int argc, char *argv[]) @@ -118,10 +118,9 @@ int main(int argc, char *argv[]) int force = 0, check = 0; const char *arg; int opt; - FILE *inf = NULL; FILE *outf = NULL; int outversion = DEFAULT_FDT_VERSION; - int boot_cpuid_phys = 0xfeedbeef; + long long cmdline_boot_cpuid = -1; quiet = 0; reservenum = 0; @@ -161,11 +160,11 @@ int main(int argc, char *argv[]) quiet++; break; case 'b': - boot_cpuid_phys = strtol(optarg, NULL, 0); + cmdline_boot_cpuid = strtoll(optarg, NULL, 0); break; case 'v': - printf("Version: %s\n", DTC_VERSION); - exit(0); + printf("Version: %s\n", DTC_VERSION); + exit(0); case 'h': default: usage(); @@ -180,31 +179,27 @@ int main(int argc, char *argv[]) arg = argv[optind]; /* minsize and padsize are mutually exclusive */ - if ((minsize) && (padsize)) { + if (minsize && padsize) die("Can't set both -p and -S\n"); - } fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", inform, outform, arg); - if (streq(inform, "dts")) { + if (streq(inform, "dts")) bi = dt_from_source(arg); - } else if (streq(inform, "fs")) { + else if (streq(inform, "fs")) bi = dt_from_fs(arg); - } else if(streq(inform, "dtb")) { - inf = dtc_open_file(arg); - bi = dt_from_blob(inf); - } else { + else if(streq(inform, "dtb")) + bi = dt_from_blob(arg); + else die("Unknown input format \"%s\"\n", inform); - } - if (inf && (inf != stdin)) - fclose(inf); + if (cmdline_boot_cpuid != -1) + bi->boot_cpuid_phys = cmdline_boot_cpuid; - if (! bi || ! bi->dt) - die("Couldn't read input tree\n"); + fill_fullpaths(bi->dt, ""); + process_checks(force, bi); - process_checks(force, bi, check, outversion, boot_cpuid_phys); if (streq(outname, "-")) { outf = stdout; @@ -218,9 +213,9 @@ int main(int argc, char *argv[]) if (streq(outform, "dts")) { dt_to_source(outf, bi); } else if (streq(outform, "dtb")) { - dt_to_blob(outf, bi, outversion, boot_cpuid_phys); + dt_to_blob(outf, bi, outversion); } else if (streq(outform, "asm")) { - dt_to_asm(outf, bi, outversion, boot_cpuid_phys); + dt_to_asm(outf, bi, outversion); } else if (streq(outform, "null")) { /* do nothing */ } else { |