[U-Boot] [PATCH V2 2/2] ofnode: Add missing address translation into ofnode_get_addr_size()
Marek Vasut
marek.vasut at gmail.com
Mon Oct 1 10:37:20 UTC 2018
Of CONFIG_OF_TRANSLATE is enabled, this function still returns
untranslated bogus results. Add the missing translation.
Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at konsulko.com>
---
V2: - Use np directly
- Drop extra of_n_addr_cells
---
drivers/core/ofnode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 2e68f8e873..f934116ab5 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -543,7 +543,11 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
na = of_n_addr_cells(np);
ns = of_n_size_cells(np);
*sizep = of_read_number(prop + na, ns);
- return of_read_number(prop, na);
+
+ if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0)
+ return of_translate_address(np, prop);
+ else
+ return of_read_number(prop, na);
} else {
return fdtdec_get_addr_size(gd->fdt_blob,
ofnode_to_offset(node), property,
--
2.18.0
More information about the U-Boot
mailing list