diff options
Diffstat (limited to 'drivers/core/fdtaddr.c')
-rw-r--r-- | drivers/core/fdtaddr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c index 528cf47296..f8cdbd6688 100644 --- a/drivers/core/fdtaddr.c +++ b/drivers/core/fdtaddr.c @@ -136,6 +136,21 @@ void *devfdt_get_addr_ptr(struct udevice *dev) return (void *)(uintptr_t)devfdt_get_addr_index(dev, 0); } +void *devfdt_remap_addr_index(struct udevice *dev, int index) +{ + fdt_addr_t addr = devfdt_get_addr(dev); + + if (addr == FDT_ADDR_T_NONE) + return NULL; + + return map_physmem(addr, 0, MAP_NOCACHE); +} + +void *devfdt_remap_addr(struct udevice *dev) +{ + return devfdt_remap_addr_index(dev, 0); +} + void *devfdt_map_physmem(struct udevice *dev, unsigned long size) { fdt_addr_t addr = devfdt_get_addr(dev); |