Skip to content

Commit

Permalink
spi: Update multi-die info in spi_device structure
Browse files Browse the repository at this point in the history
Added multi-die member in spi_device structure.
Scan for multi-die property in the device tree, if
present then set the multi_die member of spi_device
structure variable to true.

If the multi_die member of spi_device structure variable
is set, then a read transaction that spans across multiple
banks is split into one read per bank. This resolves the
die crossover issue.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reviewed-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
  • Loading branch information
Amit Kumar Mahapatra authored and radheyxilinx committed Aug 1, 2019
1 parent 7d8e6be commit 9de6a1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,10 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
}
spi->max_speed_hz = value;

/* Multi die flash */
if (of_property_read_bool(nc, "multi-die"))
spi->multi_die = true;

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
* for driver coldplugging, and in uevents used for hotplugging
* @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when
* not using a GPIO line)
* @multi_die: Flash device with multiple dies.
*
* @statistics: statistics for the spi_device
*
Expand Down Expand Up @@ -171,6 +172,7 @@ struct spi_device {
void *controller_data;
char modalias[SPI_NAME_SIZE];
int cs_gpio; /* chip select gpio */
bool multi_die; /* flash with multiple dies*/

/* the statistics */
struct spi_statistics statistics;
Expand Down

0 comments on commit 9de6a1e

Please sign in to comment.