Based on these two rules:
* #address-cells and #size-cells describe the format of addresses
for children of this node, not this node itself. So if you're
looking to parse 'reg' for this node, you *always* need to look at
the parent, not just as a fallback.
* #address-cells and #size-cells are *not* inherited. If they're
missing in a node, then the format for its children's addresses is
2 cell addresses and 2 cell sizes, it is *not* correct to look at
the next parent up for these properties.
fdt_get_reg has to find parent node and read address and size cells from
parent node not from actual node.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
const u32 *cell, int n)
{
int i = 0, b, banks;
- int address_cells = fdt_address_cells(fdt, nodeoffset);
- int size_cells = fdt_size_cells(fdt, nodeoffset);
+ int parent_offset = fdt_parent_offset(fdt, nodeoffset);
+ int address_cells = fdt_address_cells(fdt, parent_offset);
+ int size_cells = fdt_size_cells(fdt, parent_offset);
char *p = buf;
phys_addr_t val;
phys_size_t vals;