diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-05-26 14:08:17 +0200 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-06-24 11:52:45 +0530 |
commit | 31a7b719d07ccb11950f423b5f1195375109b5fa (patch) | |
tree | 4ac1c52b0e70f2a28e41359887c1ebc280be8054 /drivers | |
parent | b388af9af459b049645aaecc8874721119b479b0 (diff) | |
download | u-boot-31a7b719d07ccb11950f423b5f1195375109b5fa.tar.gz u-boot-31a7b719d07ccb11950f423b5f1195375109b5fa.tar.bz2 u-boot-31a7b719d07ccb11950f423b5f1195375109b5fa.zip |
dm: core: add non-translating version of ofnode_get_addr_size_index()
Add functions ofnode_get_addr_size_index_notrans(), which is a
non-translating version of ofnode_get_addr_size_index().
Some addresses are not meant to be translated, for example those of MTD
fixed-partitions.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/core/ofnode.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 6c771e364f..dd34cf8ca3 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -299,7 +299,8 @@ ofnode ofnode_get_by_phandle(uint phandle) return node; } -fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size) +static fdt_addr_t __ofnode_get_addr_size_index(ofnode node, int index, + fdt_size_t *size, bool translate) { int na, ns; @@ -319,7 +320,7 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size) ns = of_n_size_cells(ofnode_to_np(node)); - if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0) { + if (translate && IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0) { return of_translate_address(ofnode_to_np(node), prop_val); } else { na = of_n_addr_cells(ofnode_to_np(node)); @@ -330,12 +331,24 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size) 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); + index, na, ns, size, + translate); } return FDT_ADDR_T_NONE; } +fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size) +{ + return __ofnode_get_addr_size_index(node, index, size, true); +} + +fdt_addr_t ofnode_get_addr_size_index_notrans(ofnode node, int index, + fdt_size_t *size) +{ + return __ofnode_get_addr_size_index(node, index, size, false); +} + fdt_addr_t ofnode_get_addr_index(ofnode node, int index) { fdt_size_t size; |