diff options
author | Simon Glass | 2017-07-25 08:29:56 -0600 |
---|---|---|
committer | Simon Glass | 2017-07-28 12:02:47 -0600 |
commit | 0f6507a7e44c189eb20d77732c5114823918eadd (patch) | |
tree | ee19827b4fb0bf14508ba53704640bf7d2cb4ead /drivers/core | |
parent | dcf988525f6e2045b9122ba7c3bf6a9bf44f146e (diff) |
dm: core: Fix up ofnode_get_addr_index() for 64-bit values
At present this function only supports 32-bit (single-cell) values. Update
it to support two-cell values also.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/ofnode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index e4b2a85f19c..c3fb0ae7b91 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -199,13 +199,14 @@ fdt_addr_t ofnode_get_addr_index(ofnode node, int index) const __be32 *prop_val; uint flags; u64 size; + int na; - prop_val = of_get_address( - (struct device_node *)ofnode_to_np(node), index, - &size, &flags); + prop_val = of_get_address(ofnode_to_np(node), index, &size, + &flags); if (!prop_val) return FDT_ADDR_T_NONE; - return be32_to_cpup(prop_val); + na = of_n_addr_cells(ofnode_to_np(node)); + return of_read_number(prop_val, na); } else { return fdt_get_base_address(gd->fdt_blob, ofnode_to_offset(node)); |