From 15ad6d862ec7f66dc00783798705a8db1c5d9aca Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 19 Feb 2010 15:50:50 +1100 Subject: 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 --- dtc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dtc.h') diff --git a/dtc.h b/dtc.h index a85e5b7..13136e4 100644 --- a/dtc.h +++ b/dtc.h @@ -178,6 +178,8 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle); struct node *get_node_by_ref(struct node *tree, const char *ref); cell_t get_node_phandle(struct node *root, struct node *node); +uint32_t guess_boot_cpuid(struct node *tree); + /* Boot info (tree plus memreserve information */ struct reserve_info { -- cgit v1.2.1