44#define ATMEL_SECTOR_ERASE 0x52
47#define ATMEL_CHIP_ERASE 0x62
50#define ATMEL_RDID 0x15
62#define SPI_STATUS_WPEN 0x80
65#define SPI_STATUS_BP2 0x10
68#define SPI_STATUS_BP1 0x08
71#define SPI_STATUS_BP0 0x04
74#define SPI_STATUS_WEN 0x02
77#define SPI_STATUS_NRDY 0x01
114#define SPI_AUTODETECT_ADDRESS_LEN 0
155 const void *data_out,
void *data_in,
size_t len );
164#define SPI_MODE_CPHA 0x01
170#define SPI_MODE_CPOL 0x02
179#define SPI_MODE_SSPOL 0x10
186#define SPI_MODE_MICROWIRE 1
193#define SPI_MODE_MICROWIRE_PLUS 0
200#define SPI_MODE_THREEWIRE ( SPI_MODE_MICROWIRE_PLUS | SPI_MODE_SSPOL )
205 const void *
data,
size_t len );
214 device->nvs.word_len_log2 = 0;
224 device->nvs.size = ( 128 * 1024 );
225 device->nvs.block_size = 256;
233 device->munge_address = 1;
235 device->nvs.block_size = 8;
243 device->nvs.size = ( 4 * 1024 * 1024 );
244 device->nvs.block_size = 256;
252 device->nvs.size = ( 8 * 1024 );
253 device->nvs.block_size = 32;
uint8_t data[48]
Additional event data.
uint64_t address
Base address.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
int spi_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from SPI device.
int spi_write(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to SPI device.
int spi_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from SPI device.
int spi_write(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to SPI device.
#define container_of(ptr, type, field)
Get containing structure.
A non-volatile storage device.
int(* rw)(struct spi_bus *bus, struct spi_device *device, unsigned int command, int address, const void *data_out, void *data_in, size_t len)
Read/write data via SPI bus.
unsigned int mode
SPI interface mode.
unsigned int slave
Slave number.
unsigned int munge_address
Address is munged.
struct nvs_device nvs
NVS device.
unsigned int command_len
Command length, in bits.
struct spi_bus * bus
SPI bus to which device is attached.
unsigned int address_len
Address length, in bits.