This patch provides support to read a flash bank address register.
reading bank address register will give whether the flash is operated
on bank addressing or normal addressing(3-byte address mode).
Currently added bank address register reading support for
spansion flashes.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
return 0;
}
+int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, void *data)
+{
+ u8 cmd;
+
+ cmd = CMD_BANKADDR_BRRD;
+ return spi_flash_read_common(flash, &cmd, 1, data, 1);
+}
+
/*
* The following table holds all device probe functions
*
/* Bank addr acess commands */
#define CMD_BANKADDR_BRWR 0x17
+#define CMD_BANKADDR_BRRD 0x16
/* Common status */
#define STATUS_WIP 0x01
/* Program the bank address register */
int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 ear);
+/* Read the bank address register */
+int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, void *data);
+
/*
* Same as spi_flash_cmd_read() except it also claims/releases the SPI
* bus. Used as common part of the ->read() operation.