Urja Rannikko has uploaded this change for review. ( https://review.coreboot.org/20223
Change subject: Enable continuous SPI reads
......................................................................
Enable continuous SPI reads
Change-Id: Iadf909c9216578b1c5dacd4c4991bb436e32edc9
Signed-off-by: Urja Rannikko <urjaman(a)gmail.com>
---
M serprog.c
M spi25.c
2 files changed, 4 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/20223/1
diff --git a/serprog.c b/serprog.c
index 98aac83..25c9944 100644
--- a/serprog.c
+++ b/serprog.c
@@ -303,15 +303,13 @@
unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr,
unsigned char *readarr);
-static int serprog_spi_read(struct flashctx *flash, uint8_t *buf,
- unsigned int start, unsigned int len);
static struct spi_master spi_master_serprog = {
.type = SPI_CONTROLLER_SERPROG,
.max_data_read = MAX_DATA_READ_UNLIMITED,
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
.command = serprog_spi_send_command,
.multicommand = default_spi_send_multicommand,
- .read = serprog_spi_read,
+ .read = default_spi_read,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,
};
@@ -931,25 +929,6 @@
readarr);
free(parmbuf);
return ret;
-}
-
-/* FIXME: This function is optimized so that it does not split each transaction
- * into chip page_size long blocks unnecessarily like spi_read_chunked. This has
- * the advantage that it is much faster for most chips, but breaks those with
- * non-continuous reads. When spi_read_chunked is fixed this method can be removed. */
-static int serprog_spi_read(struct flashctx *flash, uint8_t *buf,
- unsigned int start, unsigned int len)
-{
- unsigned int i, cur_len;
- const unsigned int max_read = spi_master_serprog.max_data_read;
- for (i = 0; i < len; i += cur_len) {
- int ret;
- cur_len = min(max_read, (len - i));
- ret = spi_nbyte_read(flash, start + i, buf + i, cur_len);
- if (ret)
- return ret;
- }
- return 0;
}
void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len)
diff --git a/spi25.c b/spi25.c
index af4b6db..30e4dc3 100644
--- a/spi25.c
+++ b/spi25.c
@@ -940,14 +940,15 @@
/*
* Read a part of the flash chip.
* FIXME: Use the chunk code from Michael Karcher instead.
- * Each page is read separately in chunks with a maximum size of chunksize.
+ * Each "page" is read separately in chunks with a maximum size of chunksize.
*/
int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start,
unsigned int len, unsigned int chunksize)
{
int rc = 0;
unsigned int i, j, starthere, lenhere, toread;
- unsigned int page_size = flash->chip->page_size;
+ /* Limit page_size for multi-die 4-byte-addressing chips. */
+ unsigned int page_size = min(flash->chip->total_size*1024,16*1024*1024);
/* Warning: This loop has a very unusual condition and body.
* The loop needs to go through each page with at least one affected
--
To view, visit https://review.coreboot.org/20223
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadf909c9216578b1c5dacd4c4991bb436e32edc9
Gerrit-Change-Number: 20223
Gerrit-PatchSet: 1
Gerrit-Owner: Urja Rannikko <urjaman(a)gmail.com>
Urja Rannikko has posted comments on this change. ( https://review.coreboot.org/17954 )
Change subject: Enable continuous SPI reads
......................................................................
Patch Set 3:
I want something like this in, but i think it could be improved, and I'm unsure as to whether we'd need a new function for this.
1. I dont know of a 3-byte addressing chip that would have issues with this, but eg, N25Q512A is limited to the 256Mb segment the read started in due to it being a multi-die chip (and my memory says i read of a multi-die chip with 128Mb segments, but couldnt find it now).
2. serprog already overrided the read function to something like this. But i guess that can be removed in later patch.
To address the point 1, i'd rather just make spi_read_chunked have the "page_size" set to min(flash->chip->total_size*1024,16*1024*1024).
This wouldnt hurt existing other users of spi_read_chunked, since they're already using it with their appropriate chunksize (linux_spi might benefit since it uses it with getpagesize()), and it would be a lot less code.
--
To view, visit https://review.coreboot.org/17954
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: comment
Gerrit-Change-Id: Idf7aa130b1ceb3d0864bdeab5835f3341f558d41
Gerrit-Change-Number: 17954
Gerrit-PatchSet: 3
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude(a)gmail.com>
Gerrit-Reviewer: Urja Rannikko <urjaman(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Thu, 15 Jun 2017 10:21:03 +0000
Gerrit-HasComments: No
Philippe Mathieu-Daudé has posted comments on this change. ( https://review.coreboot.org/19391 )
Change subject: udelay: Use clock_gettime() if available and precise
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://review.coreboot.org/19391
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: comment
Gerrit-Change-Id: I85ad359823875237ada9cd027af3017d62e9a235
Gerrit-Change-Number: 19391
Gerrit-PatchSet: 4
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude(a)gmail.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Wed, 14 Jun 2017 15:44:53 +0000
Gerrit-HasComments: No
Hello Philippe Mathieu-Daudé, Paul Menzel, David Hendricks, Stefan Reinauer, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/18738
to look at the new patch set (#16).
Change subject: Fix linking with libpayload
......................................................................
Fix linking with libpayload
o Move flashbuses_to_text() to flashrom.c, it's not a cli function.
o Guard `!defined(HAVE_STRNLEN)`. This guard was introduced in
23e10b87 (Add a bunch of new/tested stuff and various small
changes 24) to support older BSDs. It's probably completely
broken because HAVE_STRNLEN is presumably a GNU autotools
thing. But we can't fix it without retesting these older BSDs.
Change-Id: I561135209b819361d125eeaeef9ff886d6bae987
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
M cli_common.c
M flash.h
M flashrom.c
M helpers.c
4 files changed, 36 insertions(+), 37 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/38/18738/16
--
To view, visit https://review.coreboot.org/18738
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I561135209b819361d125eeaeef9ff886d6bae987
Gerrit-Change-Number: 18738
Gerrit-PatchSet: 16
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude(a)gmail.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>