summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/nvs.h9
-rw-r--r--src/include/gpxe/threewire.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/include/gpxe/nvs.h b/src/include/gpxe/nvs.h
index 38bc9c555..b026dd462 100644
--- a/src/include/gpxe/nvs.h
+++ b/src/include/gpxe/nvs.h
@@ -11,8 +11,13 @@
/** A non-volatile storage device */
struct nvs_device {
- /** Word length, in bits */
- unsigned int word_len;
+ /** Word length
+ *
+ * This is expressed as the base-2 logarithm of the word
+ * length in bytes. A value of 0 therefore translates as
+ * 8-bit words, and a value of 1 translates as 16-bit words.
+ */
+ unsigned int word_len_log2;
/** Device size (in words) */
unsigned int size;
/** Data block size (in words)
diff --git a/src/include/gpxe/threewire.h b/src/include/gpxe/threewire.h
index cbf6180a0..d60e1a714 100644
--- a/src/include/gpxe/threewire.h
+++ b/src/include/gpxe/threewire.h
@@ -32,7 +32,7 @@ extern int threewire_read ( struct nvs_device *nvs, unsigned int address,
static inline __attribute__ (( always_inline )) void
init_at93cx6 ( struct spi_device *device, unsigned int organisation ) {
- device->nvs.word_len = organisation;
+ device->nvs.word_len_log2 = ( ( organisation == 8 ) ? 0 : 1 );
device->nvs.block_size = 1;
device->command_len = 3,
device->nvs.read = threewire_read;