diff options
author | John Crispin <blogic@openwrt.org> | 2014-04-12 21:21:14 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-04-12 21:21:14 +0000 |
commit | 9c2f5aeffa9ad2ac4d7313cda94ac03ccf607c47 (patch) | |
tree | e35db02eb2bdf67a2a6076563158753649f63ad9 /package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch | |
parent | 80894a6f0e1f089bb78ac1457c8a3f0e0ccfc205 (diff) | |
download | master-187ad058-9c2f5aeffa9ad2ac4d7313cda94ac03ccf607c47.tar.gz master-187ad058-9c2f5aeffa9ad2ac4d7313cda94ac03ccf607c47.tar.bz2 master-187ad058-9c2f5aeffa9ad2ac4d7313cda94ac03ccf607c47.zip |
uboot-lantiq: update to v2013.10
Patches created from tree:
git@github.com:danielschwierzeck/u-boot-lantiq.git
v2013.10..u-boot-lantiq-v2013.10-openwrt4
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40482 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch')
-rw-r--r-- | package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch b/package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch deleted file mode 100644 index 1623b1527b..0000000000 --- a/package/boot/uboot-lantiq/patches/0006-sf-add-generic-support-for-4-byte-address-mode.patch +++ /dev/null @@ -1,161 +0,0 @@ -From fb9ed0ef6f0ba6b6535c64dcfcf45c161723e56f Mon Sep 17 00:00:00 2001 -From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> -Date: Tue, 6 Nov 2012 19:31:38 +0100 -Subject: sf: add generic support for 4-byte address mode - -Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> - ---- a/drivers/mtd/spi/spi_flash.c -+++ b/drivers/mtd/spi/spi_flash.c -@@ -18,19 +18,35 @@ - static void spi_flash_addr(struct spi_flash *flash, u32 addr, u8 *cmd, u8 *cmd_len) - { - /* cmd[0] is actual command */ -- cmd[1] = addr >> 16; -- cmd[2] = addr >> 8; -- cmd[3] = addr >> 0; -- *cmd_len = 4; -+ if (spi_flash_use_4byte_mode(flash)) { -+ cmd[1] = addr >> 24; -+ cmd[2] = addr >> 16; -+ cmd[3] = addr >> 8; -+ cmd[4] = addr >> 0; -+ *cmd_len = 5; -+ } else { -+ cmd[1] = addr >> 16; -+ cmd[2] = addr >> 8; -+ cmd[3] = addr >> 0; -+ *cmd_len = 4; -+ } - } - - static void spi_flash_page_addr(struct spi_flash *flash, u32 page_addr, u32 byte_addr, u8 *cmd, u8 *cmd_len) - { - /* cmd[0] is actual command */ -- cmd[1] = page_addr >> 8; -- cmd[2] = page_addr >> 0; -- cmd[3] = byte_addr; -- *cmd_len = 4; -+ if (spi_flash_use_4byte_mode(flash)) { -+ cmd[1] = page_addr >> 16; -+ cmd[2] = page_addr >> 8; -+ cmd[3] = page_addr >> 0; -+ cmd[4] = byte_addr; -+ *cmd_len = 5; -+ } else { -+ cmd[1] = page_addr >> 8; -+ cmd[2] = page_addr >> 0; -+ cmd[3] = byte_addr; -+ *cmd_len = 4; -+ } - } - - static int spi_flash_read_write(struct spi_slave *spi, -@@ -81,7 +97,7 @@ int spi_flash_cmd_write_multi(struct spi - unsigned long page_addr, byte_addr, page_size; - size_t chunk_len, actual; - int ret; -- u8 cmd[4], cmd_len; -+ u8 cmd[5], cmd_len; - - page_size = flash->page_size; - page_addr = offset / page_size; -@@ -99,8 +115,8 @@ int spi_flash_cmd_write_multi(struct spi - - spi_flash_page_addr(flash, page_addr, byte_addr, cmd, &cmd_len); - -- debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = %zu\n", -- buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len); -+ debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x%02x } chunk_len = %zu\n", -+ buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], chunk_len); - - ret = spi_flash_cmd_write_enable(flash); - if (ret < 0) { -@@ -146,7 +162,7 @@ int spi_flash_read_common(struct spi_fla - int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, - size_t len, void *data) - { -- u8 cmd[5], cmd_len; -+ u8 cmd[6], cmd_len; - - cmd[0] = CMD_READ_ARRAY_FAST; - spi_flash_addr(flash, offset, cmd, &cmd_len); -@@ -202,7 +218,7 @@ int spi_flash_cmd_erase(struct spi_flash - { - u32 start, end, erase_size; - int ret; -- u8 cmd[4], cmd_len; -+ u8 cmd[5], cmd_len; - - erase_size = flash->sector_size; - if (offset % erase_size || len % erase_size) { -@@ -227,8 +243,8 @@ int spi_flash_cmd_erase(struct spi_flash - spi_flash_addr(flash, offset, cmd, &cmd_len); - offset += erase_size; - -- debug("SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1], -- cmd[2], cmd[3], offset); -+ debug("SF: erase %2x %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1], -+ cmd[2], cmd[3], cmd[4], offset); - - ret = spi_flash_cmd_write_enable(flash); - if (ret) -@@ -409,6 +425,12 @@ int spi_flash_probe_spl(struct spi_flash - goto err_manufacturer_probe; - } - -+ ret = spi_flash_set_4byte_mode(flash); -+ if (ret) { -+ debug("SF: Failed to enable 4 byte mode: %d\n", ret); -+ goto err_manufacturer_probe; -+ } -+ - spi_release_bus(spi); - - return 0; ---- a/drivers/mtd/spi/spi_flash_internal.h -+++ b/drivers/mtd/spi/spi_flash_internal.h -@@ -97,6 +97,31 @@ int spi_flash_cmd_wait_ready(struct spi_ - /* Erase sectors. */ - int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len); - -+#ifdef CONFIG_SPI_FLASH_4BYTE_MODE -+static inline int spi_flash_use_4byte_mode(struct spi_flash *flash) -+{ -+ return NULL != flash->set_4byte_mode; -+} -+ -+static inline int spi_flash_set_4byte_mode(struct spi_flash *flash) -+{ -+ if (spi_flash_use_4byte_mode(flash)) -+ return flash->set_4byte_mode(flash); -+ -+ return 0; -+} -+#else -+static inline int spi_flash_use_4byte_mode(struct spi_flash *flash) -+{ -+ return 0; -+} -+ -+static inline int spi_flash_set_4byte_mode(struct spi_flash *flash) -+{ -+ return 0; -+} -+#endif -+ - /* Manufacturer-specific probe functions */ - int spi_flash_probe_spansion(struct spi_flash *flash, u8 *idcode); - int spi_flash_probe_atmel(struct spi_flash *flash, u8 *idcode); ---- a/include/spi_flash.h -+++ b/include/spi_flash.h -@@ -46,6 +46,9 @@ struct spi_flash { - size_t len, const void *buf); - int (*erase)(struct spi_flash *flash, u32 offset, - size_t len); -+#ifdef CONFIG_SPI_FLASH_4BYTE_MODE -+ int (*set_4byte_mode)(struct spi_flash *flash); -+#endif - }; - - struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, |