mbox series

[v1,0/6] mtd: spi-nor: spring cleaning

Message ID 20240412134405.381832-1-mwalle@kernel.org
Headers show
Series mtd: spi-nor: spring cleaning | expand

Message

Michael Walle April 12, 2024, 1:43 p.m. UTC
It's time for some spring cleaning. Remove the oddball xilinx
flashes with non-power-of-2 page sizes.
Remove the .setup() callback, only the default callback is ever
used and it is unlikely there is need for a custom setup.

Finally, the last patch is a proposal how to deprecate flashes,
which are just detected by their id. We cannot really find out if
there are boards out there which are using a particular flash. Thus,
as a first step, we can print a warning during kernel startup. As a
second step we might introduce a kernel config option to actually
disable the flashes which has the deprecated flag.

Michael Walle (6):
  mtd: spi-nor: Remove support for Xilinx S3AN flashes
  mtd: spi-nor: get rid of non-power-of-2 page size handling
  mtd: spi-nor: get rid of SPI_NOR_NO_FR
  mtd: spi-nor: remove .setup() callback
  mtd: spi-nor: simplify spi_nor_get_flash_info()
  mtd: spi-nor: introduce support for displaying deprecation message

 drivers/mtd/spi-nor/Makefile   |   1 -
 drivers/mtd/spi-nor/core.c     | 202 +++++++++++++++------------------
 drivers/mtd/spi-nor/core.h     |   9 +-
 drivers/mtd/spi-nor/everspin.c |  19 +++-
 drivers/mtd/spi-nor/xilinx.c   | 169 ---------------------------
 5 files changed, 110 insertions(+), 290 deletions(-)
 delete mode 100644 drivers/mtd/spi-nor/xilinx.c

Comments

Tudor Ambarus April 16, 2024, 4:57 a.m. UTC | #1
On 4/12/24 14:43, Michael Walle wrote:
> It's time for some spring cleaning. Remove the oddball xilinx
> flashes with non-power-of-2 page sizes.
> Remove the .setup() callback, only the default callback is ever
> used and it is unlikely there is need for a custom setup.
> 
> Finally, the last patch is a proposal how to deprecate flashes,
> which are just detected by their id. We cannot really find out if
> there are boards out there which are using a particular flash. Thus,
> as a first step, we can print a warning during kernel startup. As a
> second step we might introduce a kernel config option to actually
> disable the flashes which has the deprecated flag.


How many FRAMs/MRAMs are in SPI NOR? Can you list them please? I don't
remember anyone bringing topics about everspin and the cypress thingy
was a mistake. I'd like to get an idea whether it's fine to remove the
FRAM/MRAM from SPI NOR without doing these preparation steps and waiting
for another year.
Michael Walle April 17, 2024, 3:02 p.m. UTC | #2
Hi,

On Tue Apr 16, 2024 at 6:57 AM CEST, Tudor Ambarus wrote:
> On 4/12/24 14:43, Michael Walle wrote:
> > It's time for some spring cleaning. Remove the oddball xilinx
> > flashes with non-power-of-2 page sizes.
> > Remove the .setup() callback, only the default callback is ever
> > used and it is unlikely there is need for a custom setup.
> > 
> > Finally, the last patch is a proposal how to deprecate flashes,
> > which are just detected by their id. We cannot really find out if
> > there are boards out there which are using a particular flash. Thus,
> > as a first step, we can print a warning during kernel startup. As a
> > second step we might introduce a kernel config option to actually
> > disable the flashes which has the deprecated flag.
>
>
> How many FRAMs/MRAMs are in SPI NOR? Can you list them please? I don't
> remember anyone bringing topics about everspin and the cypress thingy
> was a mistake. I'd like to get an idea whether it's fine to remove the
> FRAM/MRAM from SPI NOR without doing these preparation steps and waiting
> for another year.

As far as I can tell it is just
  drivers/mtd/spi-nor/evervision.c:
   - mr25h128
   - mr25h256
   - mr25h10
   - mr25h40
and
  drivers/mtd/spi-nor/spansion.c
   - cy15x104q

Please keep in mind that the evervision also have dt bindings and
spi aliases. So we'd also have to deprecate these ones. Not sure
they can easily be moved over to another driver, esp. because the
kernel interface is different (mtd partitions vs nvmem/eeprom sysfs
file).

There are three in-tree kernel boards using the mr25h frams:
arch/arm/boot/dts/nxp/imx/imx6dl-eckelmann-ci4x10.dts
No clue about that one.

arch/arm/boot/dts/nxp/mxs/imx28-sps1.dts
I've contacted Marek who introduced support for this board and he
said it can likely be removed altogether.

arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts
This seem to be openwrt driven (?)

I was thinking about sending patches to migrate them over to the
at25 driver. But again, that also means they'll loose mtd
partitions. Not sure, that fram is used on these boards anyway.

In any case I'd like to start with deprecating the FRAMs in
spi-nor and the DT bindings.

Also, the cy15x104g is rather new...

-michael