From 38e8f8fd88dae07ef8ada9d6baa41b06a4d9ac9f Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 31 May 2006 08:31:51 +1000 Subject: dtc: add setting of physical boot cpu dtc always sets the physical boot CPU to 0xfeedbeef. Add a -b option to set this. Also add warnings when using the wrong property with the wrong blob version. Signed-off-by: Michael Neuling --- dtc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'dtc.c') diff --git a/dtc.c b/dtc.c index f26b1ec..646b814 100644 --- a/dtc.c +++ b/dtc.c @@ -95,6 +95,8 @@ static void usage(void) fprintf(stderr, "\t\tBlob version to produce, defaults to 3 (relevant for dtb\n\t\tand asm output only)\n"); fprintf(stderr, "\t-R \n"); fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); + fprintf(stderr, "\t-b \n"); + fprintf(stderr, "\t\tSet the physical boot cpu\n"); fprintf(stderr, "\t-f\n"); fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); exit(2); @@ -113,8 +115,9 @@ int main(int argc, char *argv[]) FILE *outf = NULL; int outversion = 3; int reservenum = 1; + int boot_cpuid_phys = 0xfeedbeef; - while ((opt = getopt(argc, argv, "I:O:o:V:R:f")) != EOF) { + while ((opt = getopt(argc, argv, "I:O:o:V:R:fb:")) != EOF) { switch (opt) { case 'I': inform = optarg; @@ -134,6 +137,9 @@ int main(int argc, char *argv[]) case 'f': force = 1; break; + case 'b': + boot_cpuid_phys = strtol(optarg, NULL, 0); + break; default: usage(); } @@ -167,7 +173,7 @@ int main(int argc, char *argv[]) if (! bi || ! bi->dt) die("Couldn't read input tree\n"); - if (! check_device_tree(bi->dt)) { + if (! check_device_tree(bi->dt, outversion, boot_cpuid_phys)) { fprintf(stderr, "Input tree has errors\n"); if (! force) exit(1); @@ -185,9 +191,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); + dt_to_blob(outf, bi, outversion, boot_cpuid_phys); } else if (streq(outform, "asm")) { - dt_to_asm(outf, bi, outversion); + dt_to_asm(outf, bi, outversion, boot_cpuid_phys); } else if (streq(outform, "null")) { /* do nothing */ } else { -- cgit v1.2.1