diff options
| author | Michael Brown | 2006-12-04 20:06:07 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-04 20:06:07 +0100 |
| commit | 2d8d21fe7416871920c96b53b7d3ae5d02964575 (patch) | |
| tree | 99ffe79573045f96ab75593bafc6478bcf05cd22 /src/include | |
| parent | Added generic SPI protocol handler with read and write support. (diff) | |
| download | ipxe-2d8d21fe7416871920c96b53b7d3ae5d02964575.tar.gz ipxe-2d8d21fe7416871920c96b53b7d3ae5d02964575.tar.xz ipxe-2d8d21fe7416871920c96b53b7d3ae5d02964575.zip | |
Added the generic block-splitting code to nvs.c
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/nvs.h | 9 | ||||
| -rw-r--r-- | src/include/gpxe/threewire.h | 2 |
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; |
