public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] spiflash: at25: using common spi flash operation
@ 2012-08-20  6:32 Bo Shen
  2012-08-20  6:32 ` [U-Boot] [PATCH 2/4] spi: atmel: add WDRBT bit to avoid receive overrun Bo Shen
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Bo Shen @ 2012-08-20  6:32 UTC (permalink / raw)
  To: u-boot

Using common spi flash operation function to replace private operation
funtion

This patch is based on http://patchwork.ozlabs.org/patch/177896/
which has been merged by Mike frysinger

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
 drivers/mtd/spi/atmel.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
index 89ebe9d..006f6d5 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;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-09-17 17:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-20  6:32 [U-Boot] [PATCH 1/4] spiflash: at25: using common spi flash operation Bo Shen
2012-08-20  6:32 ` [U-Boot] [PATCH 2/4] spi: atmel: add WDRBT bit to avoid receive overrun Bo Shen
2012-08-21 11:11   ` Andreas Bießmann
2012-08-21 18:56     ` Mike Frysinger
2012-08-24  9:46       ` Bo Shen
2012-08-27 10:46       ` Andreas Bießmann
2012-08-20  6:32 ` [U-Boot] [PATCH 3/4] atmel: at91sam9x5: fix name error for spi Bo Shen
2012-08-21 11:04   ` Andreas Bießmann
2012-08-20  6:32 ` [U-Boot] [PATCH 4/4] atmel: at91sam9x5: add spi flash boot support Bo Shen
2012-08-21 11:26 ` [U-Boot] [PATCH 1/4] spiflash: at25: using common spi flash operation Andreas Bießmann
2012-08-21 18:55   ` Mike Frysinger
2012-08-24  9:51     ` Bo Shen
2012-08-22  1:33   ` Bo Shen
2012-08-27 11:29     ` Andreas Bießmann
2012-09-17 17:03 ` Andreas Bießmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox