From d2d844233f1e0c937b12d5d777b767d1be24d840 Mon Sep 17 00:00:00 2001 From: hailfinger Date: Wed, 13 Oct 2010 22:26:56 +0000 Subject: Switch all flash chips to partial write. The inner write functions which handle partial write are renamed to the original name of their wrappers. The write wrappers are removed. Signed-off-by: Carl-Daniel Hailfinger Tested-by: Maciej Pijanka Tested-by: Andrew Morgan Tested-by: Idwer Vollering Acked-by: Idwer Vollering Tested-by: Sean Nelson Acked-by: Sean Nelson git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1211 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- jedec.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'jedec.c') diff --git a/jedec.c b/jedec.c index 259f883..4f042f2 100644 --- a/jedec.c +++ b/jedec.c @@ -336,7 +336,8 @@ retry: return failed; } -int write_sector_jedec_common(struct flashchip *flash, uint8_t *src, int start, int len) +/* chunksize is 1 */ +int write_jedec_1(struct flashchip *flash, uint8_t *src, int start, int len) { int i, failed = 0; chipaddr dst = flash->virtual_memory + start; @@ -398,13 +399,14 @@ retry: return failed; } +/* chunksize is page_size */ /* * Write a part of the flash chip. * FIXME: Use the chunk code from Michael Karcher instead. * This function is a slightly modified copy of spi_write_chunked. * Each page is written separately in chunks with a maximum size of chunksize. */ -int write_jedec_pages(struct flashchip *flash, uint8_t *buf, int start, int len) +int write_jedec(struct flashchip *flash, uint8_t *buf, int start, int len) { int i, starthere, lenhere; /* FIXME: page_size is the wrong variable. We need max_writechunk_size @@ -437,18 +439,6 @@ int write_jedec_pages(struct flashchip *flash, uint8_t *buf, int start, int len) return 0; } -/* chunksize is page_size */ -int write_jedec(struct flashchip *flash, uint8_t *buf) -{ - return write_jedec_pages(flash, buf, 0, flash->total_size * 1024); -} - -/* chunksize is 1 */ -int write_jedec_1(struct flashchip *flash, uint8_t * buf) -{ - return write_sector_jedec_common(flash, buf, 0, flash->total_size * 1024); -} - /* erase chip with block_erase() prototype */ int erase_chip_block_jedec(struct flashchip *flash, unsigned int addr, unsigned int blocksize) -- cgit v1.2.1