summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf_ops.c
diff options
context:
space:
mode:
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>2014-01-07 00:11:35 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2014-01-12 21:40:22 +0530
commit056fbc73d54df64adcb93c513cba708acb2683bd (patch)
tree4243a3f6eb6f1a2fabc57cdad08031fc4e351cd6 /drivers/mtd/spi/sf_ops.c
parentf77f469117ab3184ac45683a50dc446265be28cc (diff)
downloadu-boot-imx-056fbc73d54df64adcb93c513cba708acb2683bd.zip
u-boot-imx-056fbc73d54df64adcb93c513cba708acb2683bd.tar.gz
u-boot-imx-056fbc73d54df64adcb93c513cba708acb2683bd.tar.bz2
sf: Add dual memories support - DUAL_PARALLEL
This patch added support for accessing dual memories in parallel connection with single chipselect line from controller. For more info - see doc/SPI/README.dual-flash Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'drivers/mtd/spi/sf_ops.c')
-rw-r--r--drivers/mtd/spi/sf_ops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index e877858..843f379 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -119,7 +119,7 @@ static int spi_flash_bank(struct spi_flash *flash, u32 offset)
u8 bank_sel;
int ret;
- bank_sel = offset / SPI_FLASH_16MB_BOUN;
+ bank_sel = offset / (SPI_FLASH_16MB_BOUN << flash->shift);
ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
if (ret) {
@@ -142,6 +142,9 @@ static void spi_flash_dual_flash(struct spi_flash *flash, u32 *addr)
flash->spi->flags &= ~SPI_XFER_U_PAGE;
}
break;
+ case SF_DUAL_PARALLEL_FLASH:
+ *addr >>= flash->shift;
+ break;
default:
debug("SF: Unsupported dual_flash=%d\n", flash->dual_flash);
break;
@@ -388,7 +391,8 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
if (bank_sel < 0)
return ret;
#endif
- remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1)) - offset;
+ remain_len = ((SPI_FLASH_16MB_BOUN << flash->shift) *
+ (bank_sel + 1)) - offset;
if (len < remain_len)
read_len = len;
else