diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/spi-generic.h | 9 | ||||
-rw-r--r-- | src/include/spi_flash.h | 11 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h index 56353bb692..783df0b917 100644 --- a/src/include/spi-generic.h +++ b/src/include/spi-generic.h @@ -94,6 +94,8 @@ struct spi_cfg { */ #define SPI_CTRLR_DEFAULT_MAX_XFER_SIZE (UINT32_MAX) +struct spi_flash; + /*----------------------------------------------------------------------- * Representation of a SPI controller. * @@ -108,6 +110,11 @@ struct spi_cfg { * deduct_cmd_len: Whether cmd_len should be deducted from max_xfer_size * when calculating max_data_size * + * Following member is provided by specialized SPI controllers that are + * actually SPI flash controllers. + * + * flash_probe: Specialized probe function provided by SPI flash + * controllers. */ struct spi_ctrlr { int (*claim_bus)(const struct spi_slave *slave); @@ -119,6 +126,8 @@ struct spi_ctrlr { struct spi_op vectors[], size_t count); uint32_t max_xfer_size; bool deduct_cmd_len; + int (*flash_probe)(const struct spi_slave *slave, + struct spi_flash *flash); }; /*----------------------------------------------------------------------- diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index bc0318c7a3..ab8155d8e7 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -65,20 +65,19 @@ void lb_spi_flash(struct lb_header *header); * non-zero = error */ int spi_flash_probe(unsigned int bus, unsigned int cs, struct spi_flash *flash); + /* - * Specialized probing performed by platform. This is a weak function which can - * be overriden by platform driver. + * Generic probing for SPI flash chip based on the different flashes provided. * * Params: - * spi = Pointer to spi_slave structure. - * force = Indicates if the platform driver can skip specialized probing. + * spi = Pointer to spi_slave structure * flash = Pointer to spi_flash structure that needs to be filled. * * Return value: - * 0 = success + * 0 = success * non-zero = error */ -int spi_flash_programmer_probe(const struct spi_slave *spi, int force, +int spi_flash_generic_probe(const struct spi_slave *slave, struct spi_flash *flash); /* All the following functions return 0 on success and non-zero on error. */ |