diff options
author | Tom Rini <trini@konsulko.com> | 2018-06-01 16:46:39 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-06-01 16:46:39 -0400 |
commit | 2a046ff5e9ffc30025b698ea6751412e2a1f16ca (patch) | |
tree | 2ee97df1e0bf4d6dcd1c01d64b3890cbb69f8d93 /drivers/core/read.c | |
parent | 582d97b6d37ed1bfce575c32d3847a42fc633b8e (diff) | |
parent | 9ca33ebf1c3a950d06cb50dba8d0a94e150bc0fd (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-mips
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) { |