Skip to content
Snippets Groups Projects
  • Simon Glass's avatar
    439c947f
    dtoc: Handle nodes with phandles that depend on the same · 439c947f
    Simon Glass authored
    
    At present dtoc assumes that nodes which are phandles do not themselves
    reference other phandle nodes. Unfortunately this is not necessarilly
    true. As a result we can currently output C code which does not compile
    because a node declaration can be referenced before it is declared.
    
    Adjust the code to explicitly output all phandle nodes needed by node
    before the node itself is output.
    
    This fixes building with the latest rk3399-firefly.dts from Linux, which
    has reordered the nodes.
    
    Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    Tested-by: default avatarKever Yang <kever.yang@rock-chips.com>
    439c947f
    History
    dtoc: Handle nodes with phandles that depend on the same
    Simon Glass authored
    
    At present dtoc assumes that nodes which are phandles do not themselves
    reference other phandle nodes. Unfortunately this is not necessarilly
    true. As a result we can currently output C code which does not compile
    because a node declaration can be referenced before it is declared.
    
    Adjust the code to explicitly output all phandle nodes needed by node
    before the node itself is output.
    
    This fixes building with the latest rk3399-firefly.dts from Linux, which
    has reordered the nodes.
    
    Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    Tested-by: default avatarKever Yang <kever.yang@rock-chips.com>