From 6e06acb73248e32457064d8fe820cbc217c45f3f Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 5 Aug 2016 09:47:51 -0600 Subject: fdt: allow fdtdec_get_addr_size_*() to translate addresses Some code may want to read reg values from DT, but from nodes that aren't associated with DM devices, so using dev_get_addr_index() isn't appropriate. In this case, fdtdec_get_addr_size_*() are the functions to use. However, "translation" (via the chain of ranges properties in parent nodes) may still be desirable. Add a function parameter to request that, and implement it. Update all call sites to default to the original behaviour. Signed-off-by: Stephen Warren Reviewed-by: Simon Glass Squashed in build fix from Stephen: Signed-off-by: Simon Glass --- drivers/core/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/core/device.c') diff --git a/drivers/core/device.c b/drivers/core/device.c index 5bb1d7793dd..b737f1c7890 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -671,7 +671,7 @@ fdt_addr_t dev_get_addr_index(struct udevice *dev, int index) addr = fdtdec_get_addr_size_auto_parent(gd->fdt_blob, dev->parent->of_offset, dev->of_offset, "reg", - index, NULL); + index, NULL, false); if (CONFIG_IS_ENABLED(SIMPLE_BUS) && addr != FDT_ADDR_T_NONE) { if (device_get_uclass_id(dev->parent) == UCLASS_SIMPLE_BUS) -- cgit v1.2.3