X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fspi%2Fsandbox_spi.c;h=b0a46c886815925027c5c3cf5a790083f1ebcd16;hb=c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e;hp=906401ec8ab46acb242b7cfad857622427a717ba;hpb=0223462b373b975d970fa86e5e1a7eadd1d41820;p=oweals%2Fu-boot.git diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c index 906401ec8a..b0a46c8868 100644 --- a/drivers/spi/sandbox_spi.c +++ b/drivers/spi/sandbox_spi.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -117,7 +118,17 @@ static int sandbox_cs_info(struct udevice *bus, uint cs, { /* Always allow activity on CS 0 */ if (cs >= 1) - return -ENODEV; + return -EINVAL; + + 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; } @@ -127,6 +138,7 @@ static const struct dm_spi_ops sandbox_spi_ops = { .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[] = {