summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorBoris Baykov <dev@borisbaykov.com>2016-06-11 18:28:59 +0200
committerDavid Hendricks <david.hendricks@gmail.com>2017-10-14 00:46:41 +0000
commit50a5660c9c11c77c794783cd9a3343bc3ff07b6e (patch)
tree7095a74f39788084a14c3657bc3b868f923f5340 /flash.h
parentf4d7772cee806d68a06db5394ab85a6e76904e88 (diff)
downloadflashrom-50a5660c9c11c77c794783cd9a3343bc3ff07b6e.tar.gz
flashrom-50a5660c9c11c77c794783cd9a3343bc3ff07b6e.tar.bz2
flashrom-50a5660c9c11c77c794783cd9a3343bc3ff07b6e.zip
4BA: Basic support for 4-bytes addressing mode extensions
If flash chip is switched to 4-bytes addressing mode then all read/erase/program instructions will be switched from 3-bytes mode to 4-bytes mode. Then well known instructions like 03h (Read), 02h (Program) and 20h,52h,D8h (Erase) will become one byte longer and accept 4-bytes address instead of 3-bytes. This patch provides support for well known instructions in 4-bytes addressing mode. Also here is the code to enter 4-bytes addressing mode by execute the instruction B7h (Enter 4-bytes mode). Patched files ------------- chipdrivers.h + added functions declarations for spi4ba.c flash.h + feature definitions added Makefile + added spi4ba.c Added files ----------- spi4ba.h + definitions for 4-bytes addressing JEDEC commands + functions declarations from spi4ba.c (same as in chipdrivers.h, just to see) spi4ba.c + functions for enter 4-bytes addressing mode + functions for read/write/erase in 4-bytes addressing mode Change-Id: Ie72e2a89cd75fb4d09f48e81c4c1d927c317b7a7 Signed-off-by: Boris Baykov <dev@borisbaykov.com>, Russia, Jan 2014 [clg: ported from https://www.flashrom.org/pipermail/flashrom/2015-January/013199.html ] Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-on: https://review.coreboot.org/20513 Reviewed-by: David Hendricks <david.hendricks@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index 67c7d20c4..611450fe5 100644
--- a/flash.h
+++ b/flash.h
@@ -119,6 +119,9 @@ enum write_granularity {
#define FEATURE_WRSR_EITHER (FEATURE_WRSR_EWSR | FEATURE_WRSR_WREN)
#define FEATURE_OTP (1 << 8)
#define FEATURE_QPI (1 << 9)
+/* Feature bits used for 4-bytes addressing mode */
+#define FEATURE_4BA_SUPPORT (1 << 10)
+#define FEATURE_4BA_ONLY (1 << 11)
enum test_state {
OK = 0,