ar71xx: build firmware image for the WNDR3700 v4 board
[openwrt/staging/wigyori.git] / package / boot / uboot-lantiq / patches / 0008-sf-eon-add-support-for-4-byte-address-mode.patch
1 From 37254e3284f61ea495f73a78b7c8efae983781e2 Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Wed, 7 Nov 2012 14:10:07 +0100
4 Subject: sf: eon: add support for 4-byte address mode
5
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7
8 --- a/drivers/mtd/spi/eon.c
9 +++ b/drivers/mtd/spi/eon.c
10 @@ -10,6 +10,8 @@
11
12 #include "spi_flash_internal.h"
13
14 +#define EN25XX_EN4B 0xb7 /* Enter 4-byte mode */
15 +
16 struct eon_spi_flash_params {
17 u16 idcode;
18 u16 nr_sectors;
19 @@ -29,6 +31,13 @@ static const struct eon_spi_flash_params
20 },
21 };
22
23 +static __maybe_unused int eon_set_4byte_mode(struct spi_flash *flash)
24 +{
25 + struct spi_slave *spi = flash->spi;
26 +
27 + return spi_flash_cmd(spi, EN25XX_EN4B, NULL, 0);
28 +}
29 +
30 int spi_flash_probe_eon(struct spi_flash *flash, u8 *idcode)
31 {
32 const struct eon_spi_flash_params *params;
33 @@ -57,5 +66,10 @@ int spi_flash_probe_eon(struct spi_flash
34 flash->size = 256 * 16
35 * params->nr_sectors;
36
37 +#ifdef CONFIG_SPI_FLASH_4BYTE_MODE
38 + if (flash->size > (1 << 24))
39 + flash->set_4byte_mode = eon_set_4byte_mode;
40 +#endif
41 +
42 return 1;
43 }