summaryrefslogtreecommitdiff
path: root/dtc.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2006-05-31 08:31:51 +1000
committerJon Loeliger <jdl@freescale.com>2006-06-07 09:42:15 -0500
commit38e8f8fd88dae07ef8ada9d6baa41b06a4d9ac9f (patch)
treec97e2c644cb65e0019b7784281b2e98ae9195d68 /dtc.c
parent05ae3d8eebdad2b8da6e02eeca3baa3cc54fe5f3 (diff)
downloaddtc-38e8f8fd88dae07ef8ada9d6baa41b06a4d9ac9f.tar.gz
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 <mikey@neuling.org>
Diffstat (limited to 'dtc.c')
-rw-r--r--dtc.c14
1 files changed, 10 insertions, 4 deletions
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 <number>\n");
fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
+ fprintf(stderr, "\t-b <number>\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 {