Merge branch '2020-05-18-reduce-size-of-common.h'
[oweals/u-boot.git] / drivers / spi / sandbox_spi.c
index 16473ec7a0b9d5e36d3ca270c98e8b23060f48a7..b0a46c886815925027c5c3cf5a790083f1ebcd16 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <log.h>
 #include <malloc.h>
 #include <spi.h>
 #include <spi_flash.h>
@@ -122,11 +123,22 @@ static int sandbox_cs_info(struct udevice *bus, uint cs,
        return 0;
 }
 
+static int sandbox_spi_get_mmap(struct udevice *dev, ulong *map_basep,
+                               uint *map_sizep, uint *offsetp)
+{
+       *map_basep = 0x1000;
+       *map_sizep = 0x2000;
+       *offsetp = 0x100;
+
+       return 0;
+}
+
 static const struct dm_spi_ops sandbox_spi_ops = {
        .xfer           = sandbox_spi_xfer,
        .set_speed      = sandbox_spi_set_speed,
        .set_mode       = sandbox_spi_set_mode,
        .cs_info        = sandbox_cs_info,
+       .get_mmap       = sandbox_spi_get_mmap,
 };
 
 static const struct udevice_id sandbox_spi_ids[] = {