diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-05-16 13:22:57 +1000 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2008-05-19 14:12:15 -0500 |
commit | 548767f42eb00a2bac6f2a1361b7fd49f7b76908 (patch) | |
tree | f93d2d2a6c1828ab7fe6637e27281abac430c736 /dtc.h | |
parent | a742aade6a28fbebf7a66448b40b983549897253 (diff) | |
download | dtc-548767f42eb00a2bac6f2a1361b7fd49f7b76908.tar.gz |
dtc: Rework handling of boot_cpuid_phys
Currently, dtc will put the nonsense value 0xfeedbeef into the
boot_cpuid_phys field of an output blob, unless explicitly given
another value with the -b command line option. As well as being a
totally unuseful default value, this also means that dtc won't
properly preserve the boot_cpuid_phys field in -I dtb -O dtb mode.
This patch reworks things to improve the boot_cpuid handling. The new
semantics are that the output's boot_cpuid_phys value is:
the value given on the command line if -b is used
otherwise
the value from the input, if in -I dtb mode
otherwise
0
Implementation-wise we do the following:
- boot_cpuid_phys is added to struct boot_info, so that
structure now contains all of the blob's semantic information.
- dt_to_blob() and dt_to_asm() output the cpuid given in
boot_info
- dt_from_blob() fills in boot_info based on the input blob
- The other dt_from_*() functions just record 0, but we can
change this easily if e.g. we invent a way of specifying the boot cpu
in the source format.
- main() overrides the cpuid in the boot_info between input
and output if -b is given
We add some testcases to check this new behaviour.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc.h')
-rw-r--r-- | dtc.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -232,10 +232,11 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list, struct boot_info { struct reserve_info *reservelist; struct node *dt; /* the device tree */ + u32 boot_cpuid_phys; }; struct boot_info *build_boot_info(struct reserve_info *reservelist, - struct node *tree); + struct node *tree, u32 boot_cpuid_phys); /* Checks */ @@ -243,10 +244,8 @@ void process_checks(int force, struct boot_info *bi); /* Flattened trees */ -void dt_to_blob(FILE *f, struct boot_info *bi, int version, - int boot_cpuid_phys); -void dt_to_asm(FILE *f, struct boot_info *bi, int version, - int boot_cpuid_phys); +void dt_to_blob(FILE *f, struct boot_info *bi, int version); +void dt_to_asm(FILE *f, struct boot_info *bi, int version); struct boot_info *dt_from_blob(const char *fname); |