mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
Added the generic block-splitting code to nvs.c
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user