diff options
author | Nico Huber <nico.h@gmx.de> | 2019-06-18 23:39:56 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-06-21 11:54:19 +0000 |
commit | d8b2e808cd46986f945ba9cf3b90c70fe58de9c6 (patch) | |
tree | 4094be4996c4ae32a78e0e13c558ee78bcdd85dc /flash.h | |
parent | 0373ce31fe5b11dcf23b27fbc221ba019a1cf7f1 (diff) | |
download | flashrom-d8b2e808cd46986f945ba9cf3b90c70fe58de9c6.tar.gz flashrom-d8b2e808cd46986f945ba9cf3b90c70fe58de9c6.tar.bz2 flashrom-d8b2e808cd46986f945ba9cf3b90c70fe58de9c6.zip |
spi: Move 16MiB partitioning up into spi_chip_read()
We enforced a 16MiB limit in spi_read_chunked() for multi-die flash
chips that can't be fully read at once. The same limit can be useful
for dediprog programmers. So move it into a more generic place.
Change-Id: Iab1fd5b2ea550b4b3ef3e8402e0b6ca218485a51
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33613
Reviewed-by: Ryan O'Leary
Reviewed-by: ron minnich <rminnich@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'flash.h')
-rw-r--r-- | flash.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -37,6 +37,12 @@ #include "libflashrom.h" #include "layout.h" +#define KiB (1024) +#define MiB (1024 * KiB) + +/* Assumes `n` and `a` are at most 64-bit wide (to avoid typeof() operator). */ +#define ALIGN_DOWN(n, a) ((n) & ~((uint64_t)(a) - 1)) + #define ERROR_PTR ((void*)-1) /* Error codes */ |