layerscape: add 64b/32b target for ls1012ardb device
[openwrt/openwrt.git] / package / boot / uboot-layerscape / patches / 0037-driver-spi-remove-Warning-prints-for-Spansion-FS-S-f.patch
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
5 fmaily
6
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
10 warnings:
11 "puts("SF: Warning - Only lower 16MiB accessible,"
12 "Full access #define CONFIG_SPI_FLASH_BAR"
13
14 Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
15 ---
16 drivers/mtd/spi/spi_flash.c | 13 +++++++++----
17 1 file changed, 9 insertions(+), 4 deletions(-)
18
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)
24 u8 idcode[5];
25 u8 cmd;
26 int ret;
27 +#ifdef CONFIG_SPI_FLASH_SPANSION
28 + u8 id[6];
29 +#endif
30
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) {
36 int ret;
37 - u8 id[6];
38
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)
42 #endif
43
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");
57 }
58 --
59 1.7.9.5
60