From: Jagannadha Sutradharudu Teki Date: Sat, 5 Jan 2013 13:28:39 +0000 (+0530) Subject: spi: zynq: Add bank register read and write commands X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63b0ee22d6e396e401f9b21701bd89b4696c9770;p=thirdparty%2Fu-boot.git spi: zynq: Add bank register read and write commands This patch adds qspi bank register read and write commands support for spansion flash. These commands are useful while accessing greater than 16MB flash with the help of bank address register if the actual size of flash is > 16MB. Signed-off-by: Jagannadha Sutradharudu Teki --- diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c index c988c2f994b..b2c5fbfcd36 100755 --- a/drivers/spi/zynq_qspi.c +++ b/drivers/spi/zynq_qspi.c @@ -214,6 +214,8 @@ typedef enum irqreturn irqreturn_t; #define XQSPIPSS_FLASH_OPCODE_RDID 0x9F /* Read JEDEC ID */ #define XQSPIPSS_FLASH_OPCODE_BE 0xC7 /* Erase whole flash block */ #define XQSPIPSS_FLASH_OPCODE_SE 0xD8 /* Sector erase (usually 64KB)*/ +#define XQSPIPSS_FLASH_OPCODE_BRWR 0x17 /* Bank addr register write */ +#define XQSPIPSS_FLASH_OPCODE_BRRD 0x16 /* Bank addr register read */ /* * Macros for the QSPI controller read/write @@ -327,6 +329,8 @@ static struct xqspips_inst_format __devinitdata flash_inst[] = { { XQSPIPSS_FLASH_OPCODE_FAST_READ, 1, XQSPIPSS_TXD_00_01_OFFSET }, { XQSPIPSS_FLASH_OPCODE_DUAL_READ, 1, XQSPIPSS_TXD_00_01_OFFSET }, { XQSPIPSS_FLASH_OPCODE_QUAD_READ, 1, XQSPIPSS_TXD_00_01_OFFSET }, + { XQSPIPSS_FLASH_OPCODE_BRWR, 1, XQSPIPSS_TXD_00_01_OFFSET }, + { XQSPIPSS_FLASH_OPCODE_BRRD, 1, XQSPIPSS_TXD_00_01_OFFSET }, /* Add all the instructions supported by the flash device */ }; @@ -901,7 +905,8 @@ static int xqspips_start_transfer(struct spi_device *qspi, * response contains the value */ if ((instruction == XQSPIPSS_FLASH_OPCODE_RDSR1) || (instruction == XQSPIPSS_FLASH_OPCODE_RDSR2) || - (instruction == XQSPIPSS_FLASH_OPCODE_RDID)) { + (instruction == XQSPIPSS_FLASH_OPCODE_RDID) || + (instruction == XQSPIPSS_FLASH_OPCODE_BRRD)) { if (xqspi->bytes_to_transfer < 4) xqspi->bytes_to_transfer = 0; else