Lines Matching refs:spi
23 #include "spi.h"
252 int falcon_spi_cmd(struct efx_nic *efx, const struct efx_spi_device *spi,
286 FRF_AB_EE_SPI_HCMD_SF_SEL, spi->device_id,
291 (addressed ? spi->addr_len : 0),
310 falcon_spi_write_limit(const struct efx_spi_device *spi, size_t start)
313 (spi->block_size - (start & (spi->block_size - 1))));
317 efx_spi_munge_command(const struct efx_spi_device *spi,
320 return command | (((address >> 8) & spi->munge_address) << 3);
325 falcon_spi_wait_write(struct efx_nic *efx, const struct efx_spi_device *spi)
332 rc = falcon_spi_cmd(efx, spi, SPI_RDSR, -1, NULL,
342 spi->device_id, status);
349 int falcon_spi_read(struct efx_nic *efx, const struct efx_spi_device *spi,
359 command = efx_spi_munge_command(spi, SPI_READ, start + pos);
360 rc = falcon_spi_cmd(efx, spi, command, start + pos, NULL,
380 falcon_spi_write(struct efx_nic *efx, const struct efx_spi_device *spi,
389 rc = falcon_spi_cmd(efx, spi, SPI_WREN, -1, NULL, NULL, 0);
394 falcon_spi_write_limit(spi, start + pos));
395 command = efx_spi_munge_command(spi, SPI_WRITE, start + pos);
396 rc = falcon_spi_cmd(efx, spi, command, start + pos,
401 rc = falcon_spi_wait_write(efx, spi);
405 command = efx_spi_munge_command(spi, SPI_READ, start + pos);
406 rc = falcon_spi_cmd(efx, spi, command, start + pos,
966 struct efx_spi_device *spi;
972 spi = efx->spi_flash ? efx->spi_flash : efx->spi_eeprom;
973 if (!spi)
982 rc = falcon_spi_read(efx, spi, 0, FALCON_NVCONFIG_END, NULL, region);