summaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2010-02-19 15:50:50 +1100
committerJon Loeliger <jdl@jdl.com>2010-02-19 08:36:23 -0600
commit15ad6d862ec7f66dc00783798705a8db1c5d9aca (patch)
tree3ad7d2b464ddcdc2a1601e992e52e91530916250 /dtc-parser.y
parent5c8d2e2b57f50ff9a3d66e31032693e4273af85c (diff)
downloaddtc-15ad6d862ec7f66dc00783798705a8db1c5d9aca.tar.gz
dtc: Automatically pick a sensible boot_cpuid_phys
Currently, when in -Idts -Odtb or -Ifs -Odtb modes, dtc always defaults to using 0 as the value for the boot_cpuid_phys header field. That's correct quite often, but there are some systems where there is no CPU with hardware ID of 0, or where we don't want to use the CPU with hardware ID 0 at all (e.g. for AMP-style partitioning). The only way to override this default currently, is with the -b command line option. This patch improves dtc to instead base the default boot_cpuid_phys value on the reg property of the first listed subnode of /cpus. This means that dtc will get boot_cpuid_phys correct by default in a greater proportion of cases (since the boot cpu is usually listed first, and this way at least the boot_cpuid_phys default will match some existing cpu node). If the node doesn't exist or has an invalid 'reg' property (missing or not 4 bytes in length), then boot_cpuid_phys is set to 0. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index a2c0925..bd9e097 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -85,7 +85,8 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
sourcefile:
DT_V1 ';' memreserves devicetree
{
- the_boot_info = build_boot_info($3, $4, 0);
+ the_boot_info = build_boot_info($3, $4,
+ guess_boot_cpuid($4));
}
;