diff options
author | Bo Shen <voice.shen@atmel.com> | 2012-08-19 20:32:21 +0000 |
---|---|---|
committer | Andreas Bießmann <andreas.devel@googlemail.com> | 2012-09-17 19:00:31 +0200 |
commit | 83fd09a0491034ee28c6948732b570f3e9e15b68 (patch) | |
tree | 15a2755fac7d69083345d2dd84fb9c3fa583ac65 | |
parent | 053a4d1f5d6be74288460b8fceaa09ba3e35768c (diff) |
spiflash: at25: using common spi flash operation
Using common spi flash operation function to replace private operation
funtion
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
-rw-r--r-- | drivers/mtd/spi/atmel.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c index 89ebe9dcdb9..006f6d5d04f 100644 --- a/drivers/mtd/spi/atmel.c +++ b/drivers/mtd/spi/atmel.c @@ -518,13 +518,19 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) asf->flash.erase = dataflash_erase_p2; } + asf->flash.page_size = page_size; + asf->flash.sector_size = page_size; break; case DF_FAMILY_AT26F: case DF_FAMILY_AT26DF: asf->flash.read = spi_flash_cmd_read_fast; - asf->flash.write = dataflash_write_p2; - asf->flash.erase = dataflash_erase_p2; + asf->flash.write = spi_flash_cmd_write_multi; + asf->flash.erase = spi_flash_cmd_erase; + asf->flash.page_size = page_size; + asf->flash.sector_size = 4096; + /* clear SPRL# bit for locked flash */ + spi_flash_cmd_write_status(&asf->flash, 0); break; default: @@ -532,7 +538,6 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) goto err; } - asf->flash.sector_size = page_size; asf->flash.size = page_size * params->pages_per_block * params->blocks_per_sector * params->nr_sectors; |