scripts/dts/extract: Re-implement get_addr_size_cells
We use to walk to the full tree in search of addr/size cells. We should only have to look at the parent of the node for these properties. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
6a8d5952d0
commit
31340d8cdd
1 changed files with 7 additions and 7 deletions
|
@ -196,13 +196,13 @@ def find_parent_prop(node_address, prop):
|
||||||
|
|
||||||
# Get the #{address,size}-cells for a given node
|
# Get the #{address,size}-cells for a given node
|
||||||
def get_addr_size_cells(node_address):
|
def get_addr_size_cells(node_address):
|
||||||
path = ''
|
parent_addr = get_parent_address(node_address)
|
||||||
|
if parent_addr == '':
|
||||||
|
parent_addr = '/'
|
||||||
|
|
||||||
nr_addr = reduced['/']['props'].get('#address-cells')
|
# The DT spec says that if #address-cells is missing default to 2
|
||||||
nr_size = reduced['/']['props'].get('#size-cells')
|
# if #size-cells is missing default to 1
|
||||||
|
nr_addr = reduced[parent_addr]['props'].get('#address-cells', 2)
|
||||||
|
nr_size = reduced[parent_addr]['props'].get('#size-cells', 1)
|
||||||
|
|
||||||
for comp in node_address.split('/')[1:-1]:
|
|
||||||
path += '/' + comp
|
|
||||||
nr_addr = reduced[path]['props'].get('#address-cells', nr_addr)
|
|
||||||
nr_size = reduced[path]['props'].get('#size-cells', nr_size)
|
|
||||||
return (nr_addr, nr_size)
|
return (nr_addr, nr_size)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue