summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/spi_flash_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/spi/spi_flash_internal.h')
-rw-r--r--drivers/mtd/spi/spi_flash_internal.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h
index 00ed1ee79b..e613ef3ab7 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -35,11 +35,13 @@
#define SPI_FLASH_STMICRO_IDCODE0 0x20
#define SPI_FLASH_WINBOND_IDCODE0 0xef
+#ifdef CONFIG_SPI_FLASH_BAR
/* Bank addr access commands */
-#define CMD_BANKADDR_BRWR 0x17
-#define CMD_BANKADDR_BRRD 0x16
-#define CMD_EXTNADDR_WREAR 0xC5
-#define CMD_EXTNADDR_RDEAR 0xC8
+# define CMD_BANKADDR_BRWR 0x17
+# define CMD_BANKADDR_BRRD 0x16
+# define CMD_EXTNADDR_WREAR 0xC5
+# define CMD_EXTNADDR_RDEAR 0xC8
+#endif
/* Common status */
#define STATUS_WIP 0x01
@@ -90,11 +92,13 @@ 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);
+#ifdef CONFIG_SPI_FLASH_BAR
/* 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);
+#endif
/*
* Same as spi_flash_cmd_read() except it also claims/releases the SPI