53 return (
command | ( ( (
address >> 8 ) & munge_address ) << 3 ) );
68 for ( i = 0 ; i < 50 ; i++ ) {
100 DBG (
"SPI %p failed to read data from device\n",
device );
117 const void *
data,
size_t len ) {
128 DBG (
"SPI %p failed to write-enable device\n",
device );
134 DBG (
"SPI %p failed to write data to device\n",
device );
139 DBG (
"SPI %p failed to complete write operation\n",
device );
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
uint8_t data[48]
Additional event data.
uint64_t address
Base address.
#define DBG(...)
Print a debugging message.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ETIMEDOUT
Connection timed out.
#define SPI_READ
Read data from memory array.
#define SPI_RDSR
Read status register.
#define SPI_WREN
Set write enable latch.
#define SPI_WRITE
Write data to memory array.
#define SPI_STATUS_NRDY
Device busy flag.
static unsigned int spi_command(unsigned int command, unsigned int address, int munge_address)
Munge SPI device address into command.
int spi_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from SPI device.
static int spi_wait(struct spi_device *device)
Wait for SPI device to complete operation.
int spi_write(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to SPI device.
A non-volatile storage device.
struct nvs_device nvs
NVS device.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.