scripts/dts/extract: Fix handling of value extraction based on cells
If size or address cells happened to be 2 we'd get the wrong value since we where shift the least significant 32-bit's up. Adjust the math based on the value of the cell amount to fix things. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
14ced2f021
commit
c57f3a09bc
|
@ -74,9 +74,9 @@ class DTReg(DTDirective):
|
|||
name = []
|
||||
|
||||
for x in range(nr_address_cells):
|
||||
addr += props.pop(0) << (32 * x)
|
||||
addr += props.pop(0) << (32 * (nr_address_cells - x - 1))
|
||||
for x in range(nr_size_cells):
|
||||
size += props.pop(0) << (32 * x)
|
||||
size += props.pop(0) << (32 * (nr_size_cells - x - 1))
|
||||
|
||||
l_addr_fqn = '_'.join(l_base + l_addr + l_idx)
|
||||
l_size_fqn = '_'.join(l_base + l_size + l_idx)
|
||||
|
|
Loading…
Reference in a new issue