summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorBoris Baykov <dev@borisbaykov.com>2016-08-26 16:25:06 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2017-05-02 14:20:15 -0500
commit9dedbdb2bc4a96ae864b64cbb15fa9945695f3dc (patch)
tree1ac40f7bc28856f73a44be208ba83d2d5678c4cd /flash.h
parentf5dd7ce11b65ffd6ead214b4b4cbe90f3eb110dd (diff)
downloadast2050-flashrom-9dedbdb2bc4a96ae864b64cbb15fa9945695f3dc.zip
ast2050-flashrom-9dedbdb2bc4a96ae864b64cbb15fa9945695f3dc.tar.gz
4ba patches
https://patchwork.coreboot.org/patch/4459 https://patchwork.coreboot.org/patch/4461 https://patchwork.coreboot.org/patch/4463 https://patchwork.coreboot.org/patch/4460 https://patchwork.coreboot.org/patch/4464 https://patchwork.coreboot.org/patch/4462 Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> Change-Id: I2b69a7a537726349742edc3a00054c39b732ac36
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index da049d1..0b72439 100644
--- a/flash.h
+++ b/flash.h
@@ -123,6 +123,14 @@ 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)
+#define FEATURE_4BA_EXTENDED_ADDR_REG (1 << 12)
+#define FEATURE_4BA_DIRECT_READ (1 << 13)
+#define FEATURE_4BA_DIRECT_WRITE (1 << 14)
+#define FEATURE_4BA_ALL_ERASERS_DIRECT (1 << 15)
+#define FEATURE_4BA_ALL_DIRECT (FEATURE_4BA_DIRECT_READ | FEATURE_4BA_DIRECT_WRITE | FEATURE_4BA_ALL_ERASERS_DIRECT)
enum test_state {
OK = 0,
@@ -167,6 +175,14 @@ struct flashchip {
unsigned int page_size;
int feature_bits;
+ /* set of function pointers to use in 4-bytes addressing mode */
+ struct four_bytes_addr_funcs_set {
+ int (*enter_4ba) (struct flashctx *flash);
+ int (*read_nbyte) (struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len);
+ int (*program_byte) (struct flashctx *flash, unsigned int addr, const uint8_t databyte);
+ int (*program_nbyte) (struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len);
+ } four_bytes_addr_funcs;
+
/* Indicate how well flashrom supports different operations of this flash chip. */
struct tested {
enum test_state probe;
@@ -344,6 +360,11 @@ __attribute__((format(printf, 2, 3)));
#define msg_pspew(...) print(MSG_SPEW, __VA_ARGS__) /* programmer debug spew */
#define msg_cspew(...) print(MSG_SPEW, __VA_ARGS__) /* chip debug spew */
+/* Read progress will be shown for reads more than 256KB */
+#define MIN_LENGTH_TO_SHOW_READ_PROGRESS 256 * 1024
+/* Read progress will be shown for erases and writes more than 64KB */
+#define MIN_LENGTH_TO_SHOW_ERASE_AND_WRITE_PROGRESS 64 * 1024
+
/* layout.c */
int register_include_arg(char *name);
int process_include_args(void);
OpenPOWER on IntegriCloud