1 From 65a6669afc667dacacf24a3a3f340205e38b0c5d Mon Sep 17 00:00:00 2001
2 From: Yunhui Cui <yunhui.cui@nxp.com>
3 Date: Fri, 27 May 2016 10:25:09 +0800
4 Subject: [PATCH 37/93] driver: spi: remove Warning prints for Spansion FS-S
7 The Spansion flash FS-S family don't support the bank related
8 commands, Even if flash size exceed 16MB, we cannot enable the
9 macro CONFIG_SPI_FLASH_BAR. Also, we need remove the irrelevant
11 "puts("SF: Warning - Only lower 16MiB accessible,"
12 "Full access #define CONFIG_SPI_FLASH_BAR"
14 Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
16 drivers/mtd/spi/spi_flash.c | 13 +++++++++----
17 1 file changed, 9 insertions(+), 4 deletions(-)
19 diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
20 index e9d1c64..b0f09ab 100644
21 --- a/drivers/mtd/spi/spi_flash.c
22 +++ b/drivers/mtd/spi/spi_flash.c
23 @@ -1009,6 +1009,9 @@ int spi_flash_scan(struct spi_flash *flash)
27 +#ifdef CONFIG_SPI_FLASH_SPANSION
31 /* Read the ID codes */
32 ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
33 @@ -1062,7 +1065,6 @@ int spi_flash_scan(struct spi_flash *flash)
34 if ((jedec == 0x0219 || (jedec == 0x0220)) &&
35 (ext_jedec & 0xff00) == 0x4d00) {
39 /* Read the ID codes again, 6 bytes */
40 ret = spi_flash_cmd(flash->spi, CMD_READ_ID, id, sizeof(id));
41 @@ -1253,10 +1255,13 @@ int spi_flash_scan(struct spi_flash *flash)
44 #ifndef CONFIG_SPI_FLASH_BAR
45 - if (((flash->dual_flash == SF_SINGLE_FLASH) &&
46 - (flash->size > SPI_FLASH_16MB_BOUN)) ||
47 + if ((id[5] != 0x81) &&
48 + /*Spansion FS-S family not support BAR ,
49 + Even if CONFIG_SPI_FLASH_BAR is unable, Need not the Warning prints */
50 + ((((flash->dual_flash == SF_SINGLE_FLASH) &&
51 + (flash->size > SPI_FLASH_16MB_BOUN))) ||
52 ((flash->dual_flash > SF_SINGLE_FLASH) &&
53 - (flash->size > SPI_FLASH_16MB_BOUN << 1))) {
54 + (flash->size > SPI_FLASH_16MB_BOUN << 1)))) {
55 puts("SF: Warning - Only lower 16MiB accessible,");
56 puts(" Full access #define CONFIG_SPI_FLASH_BAR\n");