mtd: spi-nor: Add the concept of SPI NOR manufacturer driver

Declare a spi_nor_manufacturer struct and add basic building blocks to
move manufacturer specific code outside of the core.

Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
This commit is contained in:
Boris Brezillon 2020-03-13 19:42:39 +00:00 committed by Tudor Ambarus
parent 4f50e102e2
commit 9ec4bbcb20
No known key found for this signature in database
GPG key ID: 4B554F47A58D14E9
3 changed files with 89 additions and 11 deletions

View file

@ -554,6 +554,12 @@ struct spi_nor_flash_parameter {
*/
struct flash_info;
/**
* struct spi_nor_manufacturer - Forward declaration of a structure used
* internally by the core and manufacturer drivers.
*/
struct spi_nor_manufacturer;
/**
* struct spi_nor - Structure for defining a the SPI NOR layer
* @mtd: point to a mtd_info structure
@ -564,6 +570,7 @@ struct flash_info;
* layer is not DMA-able
* @bouncebuf_size: size of the bounce buffer
* @info: spi-nor part JDEC MFR id and other info
* @manufacturer: spi-nor manufacturer
* @page_size: the page size of the SPI NOR
* @addr_width: number of address bytes
* @erase_opcode: the opcode for erasing a sector
@ -591,6 +598,7 @@ struct spi_nor {
u8 *bouncebuf;
size_t bouncebuf_size;
const struct flash_info *info;
const struct spi_nor_manufacturer *manufacturer;
u32 page_size;
u8 addr_width;
u8 erase_opcode;