sf: probe: Add support for erase sector selection flag

SECT_4K, SECT_32K and SECT_64K opeartions are performed to
to specific flash by adding a SECT* flag on respective
spi_flash_params.flag param.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
This commit is contained in:
Jagannadha Sutradharudu Teki
2013-10-02 19:36:58 +05:30
parent 54024c1566
commit f4f51a8ff8
3 changed files with 100 additions and 84 deletions

View File

@@ -17,6 +17,10 @@
#include <linux/types.h>
#include <linux/compiler.h>
/* SECT flags */
#define SECT_4K (1 << 1)
#define SECT_32K (1 << 2)
/* SST specific macros */
#ifdef CONFIG_SPI_FLASH_SST
# define SST_WP 0x01 /* Supports AAI word program */
@@ -33,8 +37,10 @@ struct spi_flash {
u32 size;
/* Write (page) size */
u32 page_size;
/* Erase (sector) size */
/* Sector size */
u32 sector_size;
/* Erase size */
u32 erase_size;
#ifdef CONFIG_SPI_FLASH_BAR
/* Bank read cmd */
u8 bank_read_cmd;
@@ -45,6 +51,8 @@ struct spi_flash {
#endif
/* Poll cmd - for flash erase/program */
u8 poll_cmd;
/* Erase cmd 4K, 32K, 64K */
u8 erase_cmd;
void *memory_map; /* Address of read-only SPI flash access */
int (*read)(struct spi_flash *flash, u32 offset,