mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-08 12:45:29 -05:00
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>
This commit is contained in:
parent
a742aade6a
commit
548767f42e
10 changed files with 88 additions and 21 deletions
|
|
@ -199,6 +199,14 @@ dtc_tests () {
|
|||
run_dtc_test -I dts -O dtb -o dtc_comments-cmp.test.dtb comments-cmp.dts
|
||||
run_test dtbs_equal_ordered dtc_comments.test.dtb dtc_comments-cmp.test.dtb
|
||||
|
||||
# Check boot_cpuid_phys handling
|
||||
run_dtc_test -I dts -O dtb -b 17 -o boot_cpuid.test.dtb empty.dts
|
||||
run_test boot-cpuid boot_cpuid.test.dtb 17
|
||||
run_dtc_test -I dtb -O dtb -b 17 -o boot_cpuid_test_tree1.test.dtb test_tree1.dtb
|
||||
run_test boot-cpuid boot_cpuid_test_tree1.test.dtb 17
|
||||
run_dtc_test -I dtb -O dtb -o boot_cpuid_preserved_test_tree1.test.dtb boot_cpuid_test_tree1.test.dtb
|
||||
run_test dtbs_equal_ordered boot_cpuid_preserved_test_tree1.test.dtb boot_cpuid_test_tree1.test.dtb
|
||||
|
||||
# Check -Odts mode preserve all dtb information
|
||||
for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do
|
||||
run_dtc_test -I dtb -O dts -o odts_$tree.test.dts $tree
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue