diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-04-01 19:34:53 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-04-01 19:34:53 +0000 |
commit | b5f53e34d4fc6103f99be29947ea64a3c3ed0119 (patch) | |
tree | 5d6795f391efd74229f1b88de4639157fbec5563 /flash.h | |
parent | e056a53f200e421ad4623081509417ab41b49aff (diff) | |
download | flashrom-b5f53e34d4fc6103f99be29947ea64a3c3ed0119.tar.gz |
Refine granularity handling in preparation of AT45DB series support.
This adds a number of new granularitie and refines the handling of
n-byte granularities by extracting the respective code into a helper
function which reduces the pain of the above significantly.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1666 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'flash.h')
-rw-r--r-- | flash.h | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -59,18 +59,22 @@ enum chipbustype { }; /* - * The following write granularities are known: - * - 1 bit: Each bit can be cleared individually. - * - 1 byte: A byte can be written once. Further writes to an already written byte cause its contents to be - * either undefined or to stay unchanged. - * - 128 bytes: If less than 128 bytes are written, the rest will be erased. Each write to a 128-byte region - * will trigger an automatic erase before anything is written. Very uncommon behaviour. - * - 256 bytes: If less than 256 bytes are written, the contents of the unwritten bytes are undefined. + * The following enum defines possible write granularities of flash chips. These tend to reflect the properties + * of the actual hardware not necesserily the write function(s) defined by the respective struct flashchip. + * The latter might (and should) be more precisely specified, e.g. they might bail out early if their execution + * would result in undefined chip contents. */ enum write_granularity { - write_gran_256bytes = 0, /* We assume 256 byte granularity by default. */ - write_gran_1bit, - write_gran_1byte, + /* We assume 256 byte granularity by default. */ + write_gran_256bytes = 0,/* If less than 256 bytes are written, the unwritten bytes are undefined. */ + write_gran_1bit, /* Each bit can be cleared individually. */ + write_gran_1byte, /* A byte can be written once. Further writes to an already written byte cause + * its contents to be either undefined or to stay unchanged. */ + write_gran_264bytes, /* If less than 264 bytes are written, the unwritten bytes are undefined. */ + write_gran_512bytes, /* If less than 512 bytes are written, the unwritten bytes are undefined. */ + write_gran_528bytes, /* If less than 528 bytes are written, the unwritten bytes are undefined. */ + write_gran_1024bytes, /* If less than 1024 bytes are written, the unwritten bytes are undefined. */ + write_gran_1056bytes, /* If less than 1056 bytes are written, the unwritten bytes are undefined. */ }; /* |