diff options
author | Luka Perkov <luka@openwrt.org> | 2013-01-22 12:55:01 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2013-01-22 12:55:01 +0000 |
commit | 2245726371cf10fa383303cc73500d83d8e246f9 (patch) | |
tree | 9c3522c5a280b4c3948162da7b6d972ad6378894 /package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch | |
parent | bab482b93f6ad07e471a86a3b9a19d7e15b85059 (diff) | |
download | mtk-20170518-2245726371cf10fa383303cc73500d83d8e246f9.zip mtk-20170518-2245726371cf10fa383303cc73500d83d8e246f9.tar.gz mtk-20170518-2245726371cf10fa383303cc73500d83d8e246f9.tar.bz2 |
uboot-lantiq: upgrade to 2013.01
SVN-Revision: 35292
Diffstat (limited to 'package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch')
-rw-r--r-- | package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch b/package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch new file mode 100644 index 0000000..9471d47 --- /dev/null +++ b/package/boot/uboot-lantiq/patches/0011-sf-spansion-add-support-for-4-byte-address-mode.patch @@ -0,0 +1,55 @@ +From 0add8e5c60961d2b99174610df8d3d9d6d192b74 Mon Sep 17 00:00:00 2001 +From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> +Date: Wed, 7 Nov 2012 14:16:11 +0100 +Subject: sf: spansion: add support for 4-byte address mode + +Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> + +--- a/drivers/mtd/spi/spansion.c ++++ b/drivers/mtd/spi/spansion.c +@@ -31,6 +31,10 @@ + + #include "spi_flash_internal.h" + ++#define S25FLXX_BRRD 0x16 /* Read Bank Register */ ++#define S25FLXX_BRWR 0x17 /* Write Bank Register */ ++#define S25FLXX_BAR_EXTADD (1 << 7) /* Extended address enable */ ++ + struct spansion_spi_flash_params { + u16 idcode1; + u16 idcode2; +@@ -112,6 +116,23 @@ static const struct spansion_spi_flash_p + }, + }; + ++static __maybe_unused int spansion_set_4byte_mode(struct spi_flash *flash) ++{ ++ struct spi_slave *spi = flash->spi; ++ u8 bar, cmd; ++ int err; ++ ++ cmd = S25FLXX_BRRD; ++ err = spi_flash_cmd(spi, cmd, &bar, 1); ++ if (err) ++ return err; ++ ++ bar |= S25FLXX_BAR_EXTADD; ++ cmd = S25FLXX_BRWR; ++ ++ return spi_flash_cmd_write(spi, &cmd, 1, &bar, 1); ++} ++ + int spi_flash_probe_spansion(struct spi_flash *flash, u8 *idcode) + { + const struct spansion_spi_flash_params *params; +@@ -144,5 +165,10 @@ int spi_flash_probe_spansion(struct spi_ + flash->sector_size = 256 * params->pages_per_sector; + flash->size = flash->sector_size * params->nr_sectors; + ++#ifdef CONFIG_SPI_FLASH_4BYTE_MODE ++ if (flash->size > (1 << 24)) ++ flash->set_4byte_mode = spansion_set_4byte_mode; ++#endif ++ + return 1; + } |