dtoc: Improve handling of reg properties
authorSimon Glass <sjg@chromium.org>
Fri, 26 Mar 2021 03:17:27 +0000 (16:17 +1300)
committerSimon Glass <sjg@chromium.org>
Tue, 6 Apr 2021 04:33:19 +0000 (16:33 +1200)
commitda393412234a37af68188e7490eba136c832a275
tree637eaafb06d762d0a850504a3f5e0b8042022bcd
parent3e200caff05bccc86392ba531770ebb0879ef93e
dtoc: Improve handling of reg properties

This existing code assumes that a reg property is larger than one cell,
but this is not always the case. Fix this assumption.

Also if a node's parent is missing the #address-cells and #size-cells
properties we use 2 as a default for each. But this should not happen in
practice. More likely the properties were removed for SPL due to there
being no 'u-boot,dm-pre-reloc' property, or similar. Add a warning for
this as the failure can be very confusing.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/dtb_platdata.py
tools/dtoc/test/dtoc_test_noprops.dts [new file with mode: 0644]
tools/dtoc/test/dtoc_test_single_reg.dts [new file with mode: 0644]
tools/dtoc/test_dtoc.py