Re: [PATCH v1 00/14] mtd: spi-nor: move vendor specific code into vendor modules

From: Tudor.Ambarus
Date: Thu Feb 17 2022 - 02:31:36 EST


+ Yaliang,

might be interested in reviewing/testing this, as there were some similar
patches submitted a while ago:

https://patchwork.ozlabs.org/project/linux-mtd/list/?series=237043

Cheers,
ta

On 2/2/22 16:58, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> It turns out that most of the special status register handling is
> specific for a particular vendor. I.e. Xilinx has some different
> opcodes for the status register read, Micron has an additional FSR
> register and Spansion has these flags integrated into the SR.
>
> Create a callback to ready() where a flash chip can register its
> own function. This will let us move all the vendor specific stuff
> out of the core into the vendor modules.
>
> Please note that this is only compile-time tested.
>
> For sake of consistency and better readability of the code flow,
> I also converted the setup() callback to be optional.
>
> Michael Walle (14):
> mtd: spi-nor: export more function to be used in vendor modules
> mtd: spi-nor: slightly refactor the spi_nor_setup()
> mtd: spi-nor: allow a flash to define its own ready() function
> mtd: spi-nor: move all xilinx specifics into xilinx.c
> mtd: spi-nor: xilinx: rename vendor specific functions and defines
> mtd: spi-nor: xilinx: correct the debug message
> mtd: spi-nor: move all micron-st specifics into micron-st.c
> mtd: spi-nor: micron-st: convert USE_FSR to a manufacturer flag
> mtd: spi-nor: micron-st: fix micron_st prefix
> mtd: spi-nor: micron-st: rename vendor specific functions and defines
> mtd: spi-nor: spansion: slightly rework control flow in late_init()
> mtd: spi-nor: move all spansion specifics into spansion.c
> mtd: spi-nor: spansion: convert USE_CLSR to a manufacturer flag
> mtd: spi-nor: renumber flags
>
> drivers/mtd/spi-nor/core.c | 265 ++------------------------------
> drivers/mtd/spi-nor/core.h | 70 ++++-----
> drivers/mtd/spi-nor/micron-st.c | 225 ++++++++++++++++++++++-----
> drivers/mtd/spi-nor/spansion.c | 133 ++++++++++++----
> drivers/mtd/spi-nor/xilinx.c | 79 +++++++++-
> include/linux/mtd/spi-nor.h | 18 ---
> 6 files changed, 417 insertions(+), 373 deletions(-)
>
> --
> 2.30.2
>