This patch adds support of non-jedec MRAM devices mr25hx from Everspin.
This flash devices do not have jedec device ID and hence support for
name matching is also added as part of this series.
This patch streamlined the update of SPI flash probing function API
changes and included the following updates:
1) Updated "spi_flash_probe" (old method) and
"spi_flash_probe_bus_cs" (new method) APIs
2) Added ifdefs for CONFIG_ENV_SPI_NAME and CONFIG_SF_DEFAULT_NAME so
that addition of flash name in case of non-jedec device becomes
streamlined.
3) Used CONFIG_ENV_SPI_NAME and CONFIG_SF_DEFAULT_NAME at all possible
places except board/ files which has custom or hard coded arguments in
"spi_flash_probe" functions. In such cases, passed NULL as flash name.
Signed-off-by: Ronak Desai
Signed-off-by: Matthew Weber
---
board/Arcturus/ucp1020/cmd_arc.c | 4 ++--
board/Synology/ds414/cmd_syno.c | 2 +-
board/aries/ma5d4evk/ma5d4evk.c | 3 ++-
board/buffalo/lsxl/lsxl.c| 2 +-
board/congatec/cgtqmx6eval/cgtqmx6eval.c | 5 +++--
board/davinci/da8xxevm/da850evm.c| 2 +-
board/renesas/sh7752evb/sh7752evb.c | 4 ++--
board/renesas/sh7753evb/sh7753evb.c | 4 ++--
board/renesas/sh7757lcr/sh7757lcr.c | 6 +++---
board/siemens/taurus/taurus.c| 3 ++-
cmd/mvebu/bubt.c | 3 ++-
cmd/sf.c | 12
common/env_sf.c | 10 ++
common/spl/spl_spi.c | 3 ++-
common/splash_source.c | 3 ++-
drivers/dfu/dfu_sf.c | 3 ++-
drivers/mtd/spi/Kconfig | 5 +
drivers/mtd/spi/fsl_espi_spl.c | 4 ++--
drivers/mtd/spi/sf-uclass.c | 9 +
drivers/mtd/spi/sf_internal.h| 4 +++-
drivers/mtd/spi/sf_probe.c | 18 +-
drivers/mtd/spi/spi_flash.c | 27 ---
drivers/mtd/spi/spi_flash_ids.c | 11 +++
drivers/net/fm/fm.c | 4 ++--
drivers/spi/spi-uclass.c | 15 +--
include/spi.h| 6 +-
include/spi_flash.h | 11 +++
27 files changed, 123 insertions(+), 60 deletions(-)
diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c
index fa6b485..c4ca1b3 100644
--- a/board/Arcturus/ucp1020/cmd_arc.c
+++ b/board/Arcturus/ucp1020/cmd_arc.c
@@ -74,7 +74,7 @@ static int set_arc_product(int argc, char *const argv[])
strcpy(smac[0], argv[4]);
flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
- CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
+ CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE,
CONFIG_ENV_SPI_NAME);
/*
* Save factory defaults
@@ -113,7 +113,7 @@ int get_arc_info(void)
char *myerr = "ERROR: Failed to read all 4 factory info spi locations";
flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
- CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
+ CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE,
CONFIG_ENV_SPI_NAME);
if (spi_flash_read(flash, FIRM_ADDR1, sizeof(smac), smac)) {
location++;
diff --git a/board/Synology/ds414/cmd_syno.c b/board/Synology/ds414/cmd_syno.c
index 20544e2..a2c2e9d 100644
--- a/board/Synology/ds414/cmd_syno.c
+++ b/board/Synology/ds414/cmd_syno.c
@@ -38,7 +38,7 @@ static int do_syno_populate(int argc, char * const argv[])
/* XXX: arg parsing to select flash here? */
- flash = spi_flash_probe(bus, cs, speed, mode);
+ flash = spi_flash_probe(bus, cs, speed, mode, NULL);
if (!flash) {
printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
return 1;
diff --git a/board/aries/ma5d4evk/ma5d4evk.c b/board/aries/ma5d4evk/ma5d4evk.c
index b9294fc..21d4508 100644
--- a/board/aries/ma5d4evk/ma5d4evk.c
+++ b/board/aries/ma5d4evk/ma5d4evk.c
@@ -283,7 +283,8 @@ static void board_identify(void)
{
struct spi_flash *sf;
sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
-CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
+CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE,
+CONFIG_SF_DEFAULT_NAME);
boot_mode_sf = (sf != NULL);
}
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 0f37345..a970974 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -214,7 +214,7 @@ static void erase_environment(void)
struct spi_flash *flash;
printf("Erasing environment..\n");
- flash = spi_flash_probe(0, 0, 100, SPI_MODE_3);