drivers: spi: dw: read ssi component version

Read the Synopsys SSI component version to extend supported capability
based on the version.

Signed-off-by: Younghyun Park <younghyunpark@google.com>
This commit is contained in:
Younghyun Park 2024-08-23 00:05:21 -07:00 committed by Benjamin Cabé
parent 0ee0a8de37
commit db168539cf
2 changed files with 7 additions and 0 deletions

View File

@ -566,6 +566,12 @@ int spi_dw_init(const struct device *dev)
write_imr(dev, DW_SPI_IMR_MASK);
clear_bit_ssienr(dev);
/* SSI component version */
spi->version = read_ssi_comp_version(dev);
LOG_DBG("Version: %c.%c%c%c", (spi->version >> 24) & 0xff,
(spi->version >> 16) & 0xff, (spi->version >> 8) & 0xff,
spi->version & 0xff);
LOG_DBG("Designware SPI driver initialized on device: %p", dev);
err = spi_context_cs_configure_all(&spi->ctx);

View File

@ -48,6 +48,7 @@ struct spi_dw_config {
struct spi_dw_data {
DEVICE_MMIO_RAM;
struct spi_context ctx;
uint32_t version; /* ssi comp version */
uint8_t dfs; /* dfs in bytes: 1,2 or 4 */
uint8_t fifo_diff; /* cannot be bigger than FIFO depth */
};