spi: Add DMA support for spi_flash_read()
Few SPI devices provide accelerated read interfaces to read from SPI-NOR flash devices. These hardwares also support DMA to transfer data from flash to memory either via mem-to-mem DMA or dedicated slave DMA channels. Hence, add support for DMA in order to improve throughput and reduce CPU load. Use spi_map_buf() to get sg table for the buffer and pass it to SPI driver. Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -1143,6 +1143,8 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
|
||||
* @opcode_nbits: number of lines to send opcode
|
||||
* @addr_nbits: number of lines to send address
|
||||
* @data_nbits: number of lines for data
|
||||
* @rx_sg: Scatterlist for receive data read from flash
|
||||
* @cur_msg_mapped: message has been mapped for DMA
|
||||
*/
|
||||
struct spi_flash_read_message {
|
||||
void *buf;
|
||||
@@ -1155,6 +1157,8 @@ struct spi_flash_read_message {
|
||||
u8 opcode_nbits;
|
||||
u8 addr_nbits;
|
||||
u8 data_nbits;
|
||||
struct sg_table rx_sg;
|
||||
bool cur_msg_mapped;
|
||||
};
|
||||
|
||||
/* SPI core interface for flash read support */
|
||||
|
Reference in New Issue
Block a user