[PATCH 2/3] mtd: spi-nor: Add a driver for the VIA/WonderMedia serial flash controller
Pratyush Yadav
pratyush at kernel.org
Mon May 12 02:20:30 PDT 2025
Hi Alexey,
On Sat, May 10 2025, Alexey Charkov wrote:
> The controller is tailored to SPI NOR flash memory and abstracts away all
> SPI communications behind a small set of MMIO registers and a physical
> memory mapping of the actual chip contents.
>
> It doesn't expose chip probing functions beyond reading the ID though, so
> use lower level chip opcodes via the "programmable command mode" of the
> controller and the kernel's SPI NOR framework to avoid hard-coding chip
> parameters for each ID the way the vendor kernel does it.
>
> Currently tested on a WonderMedia WM8950 SoC with a Macronix MX25L4005A
> flash chip (APC Rock board), but should work on all VIA/WonderMedia SoCs
>
> Signed-off-by: Alexey Charkov <alchark at gmail.com>
> ---
> MAINTAINERS | 1 +
> drivers/mtd/spi-nor/controllers/Kconfig | 14 +
> drivers/mtd/spi-nor/controllers/Makefile | 1 +
> drivers/mtd/spi-nor/controllers/wmt-sflash.c | 525 +++++++++++++++++++++++++++
Drivers in drivers/mtd/spi-nor/controllers/ are deprecated, and we want
to eventually get rid of the API. The expected way is for drivers to use
SPI MEM (drivers/spi/spi-mem.c). SPI MEM drivers are usually more
general and not tailored specifically to SPI NOR flashes, so it might be
a bit tricky to write drivers for specialized hardware with it. But I
think the drivers/spi/spi-intel.c driver is written for similar kind of
hardware so it should be possible.
>
[...]
--
Regards,
Pratyush Yadav
More information about the linux-arm-kernel
mailing list