return devfdt_get_addr_index(dev, index);
}
+void *dev_read_addr_index_ptr(const 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_sysmem(addr, 0);
+}
+
fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index,
fdt_size_t *size)
{
{
fdt_addr_t addr = dev_read_addr(dev);
- return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr;
+ if (addr == FDT_ADDR_T_NONE)
+ return NULL;
+
+ return map_sysmem(addr, 0);
}
void *dev_remap_addr(const struct udevice *dev)