summaryrefslogtreecommitdiff
path: root/package/boot/uboot-layerscape/patches/0037-driver-spi-remove-Warning-prints-for-Spansion-FS-S-f.patch
blob: 981182b125fbeff1b98e0804964677367c845b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 65a6669afc667dacacf24a3a3f340205e38b0c5d Mon Sep 17 00:00:00 2001
From: Yunhui Cui <yunhui.cui@nxp.com>
Date: Fri, 27 May 2016 10:25:09 +0800
Subject: [PATCH 37/93] driver: spi: remove Warning prints for Spansion FS-S
 fmaily

The Spansion flash FS-S family don't support the bank related
commands, Even if flash size exceed 16MB, we cannot enable the
macro CONFIG_SPI_FLASH_BAR. Also, we need remove the irrelevant
warnings:
"puts("SF: Warning - Only lower 16MiB accessible,"
"Full access #define CONFIG_SPI_FLASH_BAR"

Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
---
 drivers/mtd/spi/spi_flash.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index e9d1c64..b0f09ab 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1009,6 +1009,9 @@ int spi_flash_scan(struct spi_flash *flash)
 	u8 idcode[5];
 	u8 cmd;
 	int ret;
+#ifdef CONFIG_SPI_FLASH_SPANSION
+	u8 id[6];
+#endif
 
 	/* Read the ID codes */
 	ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
@@ -1062,7 +1065,6 @@ int spi_flash_scan(struct spi_flash *flash)
 	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
 	    (ext_jedec & 0xff00) == 0x4d00) {
 		int ret;
-		u8 id[6];
 
 		/* Read the ID codes again, 6 bytes */
 		ret = spi_flash_cmd(flash->spi, CMD_READ_ID, id, sizeof(id));
@@ -1253,10 +1255,13 @@ int spi_flash_scan(struct spi_flash *flash)
 #endif
 
 #ifndef CONFIG_SPI_FLASH_BAR
-	if (((flash->dual_flash == SF_SINGLE_FLASH) &&
-	     (flash->size > SPI_FLASH_16MB_BOUN)) ||
+	if ((id[5] != 0x81) &&
+	/*Spansion FS-S family not support BAR ,
+	Even if CONFIG_SPI_FLASH_BAR is unable,  Need not the Warning prints */
+	     ((((flash->dual_flash == SF_SINGLE_FLASH) &&
+	     (flash->size > SPI_FLASH_16MB_BOUN))) ||
 	     ((flash->dual_flash > SF_SINGLE_FLASH) &&
-	     (flash->size > SPI_FLASH_16MB_BOUN << 1))) {
+	     (flash->size > SPI_FLASH_16MB_BOUN << 1)))) {
 		puts("SF: Warning - Only lower 16MiB accessible,");
 		puts(" Full access #define CONFIG_SPI_FLASH_BAR\n");
 	}
-- 
1.7.9.5