]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: zynq: Add bank register read and write commands
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Sat, 5 Jan 2013 13:28:39 +0000 (18:58 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 22 Jan 2013 13:15:45 +0000 (14:15 +0100)
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 <jaganna@xilinx.com>
drivers/spi/zynq_qspi.c

index c988c2f994b68597ff3cf04c14a32ccdee12a536..b2c5fbfcd36f48164eed3591b87c14f4240981a2 100755 (executable)
@@ -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