mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
core: ofnode: Fix ofnode_get_addr_index function
Currently the else part of ofnode_get_addr_index function does not fetch addresses based on the index but rather just returns the base address. Fix that. Signed-off-by: Keerthy <j-keerthy@ti.com>
This commit is contained in:
parent
abdc7b8a2d
commit
1678754f5e
1 changed files with 10 additions and 7 deletions
|
@ -253,15 +253,15 @@ int ofnode_read_size(ofnode node, const char *propname)
|
|||
|
||||
fdt_addr_t ofnode_get_addr_index(ofnode node, int index)
|
||||
{
|
||||
int na, ns;
|
||||
fdt_size_t size;
|
||||
|
||||
if (ofnode_is_np(node)) {
|
||||
const __be32 *prop_val;
|
||||
uint flags;
|
||||
u64 size;
|
||||
int na;
|
||||
int ns;
|
||||
|
||||
prop_val = of_get_address(ofnode_to_np(node), index, &size,
|
||||
&flags);
|
||||
prop_val = of_get_address(ofnode_to_np(node), index,
|
||||
(u64 *)&size, &flags);
|
||||
if (!prop_val)
|
||||
return FDT_ADDR_T_NONE;
|
||||
|
||||
|
@ -274,8 +274,11 @@ fdt_addr_t ofnode_get_addr_index(ofnode node, int index)
|
|||
return of_read_number(prop_val, na);
|
||||
}
|
||||
} else {
|
||||
return fdt_get_base_address(gd->fdt_blob,
|
||||
ofnode_to_offset(node));
|
||||
na = ofnode_read_simple_addr_cells(ofnode_get_parent(node));
|
||||
ns = ofnode_read_simple_size_cells(ofnode_get_parent(node));
|
||||
return fdtdec_get_addr_size_fixed(gd->fdt_blob,
|
||||
ofnode_to_offset(node), "reg",
|
||||
index, na, ns, &size, true);
|
||||
}
|
||||
|
||||
return FDT_ADDR_T_NONE;
|
||||
|
|
Loading…
Reference in a new issue