diff options
author | Jagannadha Sutradharudu Teki <jaganna@xilinx.com> | 2013-06-19 15:33:58 +0530 |
---|---|---|
committer | Jagannadha Sutradharudu Teki <jaganna@xilinx.com> | 2013-06-23 22:02:50 +0530 |
commit | 1dcd6d03811d4f30052a5e24377b378867211b05 (patch) | |
tree | 2d8cac4b1b7bc109c9a039d10b71634f9ff02a53 /drivers/mtd/spi/spi_flash_internal.h | |
parent | fc207ee4db20ef6e769b0d08dab8b102748acb35 (diff) |
sf: Add bank addr code in CONFIG_SPI_FLASH_BAR
Defined bank addr code on CONFIG_SPI_FLASH_BAR macro, to reduce the
size for existing boards which has < 16Mbytes SPI flashes.
It's upto user which has provision to use the bank addr code for
flashes which has > 16Mbytes.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd/spi/spi_flash_internal.h')
-rw-r--r-- | drivers/mtd/spi/spi_flash_internal.h | 12 |
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 00ed1ee79bd..e613ef3ab7d 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 |