From ffdb20bea16e00a326cc3d106f275e58bf302a0c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 3 Dec 2013 16:43:27 -0700 Subject: sandbox: spi: Add new SPI flash driver This adds a SPI flash driver which simulates SPI flash clients. Currently supports the bare min that U-Boot requires: you can probe, read, erase, and write. Should be easy to extend to make it behave more exactly like a real SPI flash, but this is good enough to merge now. sjg@chromium.org added a README and tidied up code a little. Added a required map_sysmem() for sandbox. Signed-off-by: Mike Frysinger Signed-off-by: Simon Glass --- drivers/mtd/spi/sf_probe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/mtd/spi/sf_probe.c') diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index ca127155b..c1eb75489 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "sf_internal.h" @@ -279,7 +280,7 @@ int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash) debug("%s: Memory map must cover entire device\n", __func__); return -1; } - flash->memory_map = (void *)addr; + flash->memory_map = map_sysmem(addr, size); return 0; } -- cgit v1.2.3-70-g09d2