diff options
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r-- | drivers/core/read.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c index 0322cbf330..96766c7876 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -4,6 +4,8 @@ * Written by Simon Glass <sjg@chromium.org> */ +#include <asm/types.h> +#include <asm/io.h> #include <common.h> #include <dm.h> #include <mapmem.h> @@ -57,6 +59,16 @@ fdt_addr_t dev_read_addr_index(struct udevice *dev, int index) return devfdt_get_addr_index(dev, index); } +void *dev_remap_addr_index(struct udevice *dev, int index) +{ + fdt_addr_t addr = dev_read_addr_index(dev, index); + + if (addr == FDT_ADDR_T_NONE) + return NULL; + + return map_physmem(addr, 0, MAP_NOCACHE); +} + fdt_addr_t dev_read_addr(struct udevice *dev) { return dev_read_addr_index(dev, 0); @@ -69,6 +81,11 @@ void *dev_read_addr_ptr(struct udevice *dev) return (addr == FDT_ADDR_T_NONE) ? NULL : map_sysmem(addr, 0); } +void *dev_remap_addr(struct udevice *dev) +{ + return dev_remap_addr_index(dev, 0); +} + fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property, fdt_size_t *sizep) { |