]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/spi/spi_flash_internal.h
sf: Discover the bank addr commands
[u-boot] / drivers / mtd / spi / spi_flash_internal.h
index 141cfa8b26d75e6e816c7315530854a93035b803..db6c4448c46818a001b2c7fa52e3e575c33311c2 100644 (file)
 #define CMD_ERASE_64K                  0xd8
 #define CMD_ERASE_CHIP                 0xc7
 
+/* Manufacture ID's */
+#define SPI_FLASH_SPANSION_IDCODE0     0x01
+#define SPI_FLASH_STMICRO_IDCODE0      0x20
+#define SPI_FLASH_WINBOND_IDCODE0      0xef
+
+/* Bank addr access commands */
+#define CMD_BANKADDR_BRWR              0x17
+#define CMD_BANKADDR_BRRD              0x16
+#define CMD_EXTNADDR_WREAR             0xC5
+#define CMD_EXTNADDR_RDEAR             0xC8
+
 /* Common status */
 #define STATUS_WIP                     0x01
 
@@ -77,6 +88,12 @@ static inline int spi_flash_cmd_write_disable(struct spi_flash *flash)
 /* Program the status register. */
 int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr);
 
+/* Program the bank address register */
+int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel);
+
+/* Configure the BAR - discover the bank cmds */
+int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0);
+
 /*
  * Same as spi_flash_cmd_read() except it also claims/releases the SPI
  * bus. Used as common part of the ->read() operation.