[PATCH] env: Introduce support for SPI NAND flash

Christian Marangi ansuelsmth at gmail.com
Wed Apr 2 17:10:31 CEST 2025


On Wed, Apr 02, 2025 at 09:05:42AM -0600, Tom Rini wrote:
> On Wed, Apr 02, 2025 at 12:57:57AM +0200, Christian Marangi wrote:
> 
> > Introduce support for SPI NAND flash. Currently we only support SPI
> > flash based on the lagacy sf cmd that assume SPI flash are always NOR.
> > This is not the case as to SPI controller also NAND can be attached. Add
> > support for it by adding an env driver that base entirely on the MTD
> > api.
> > 
> > Introduce a new kconfig ENV_IS_IN_SPI_NAND_FLASH and
> > CONFIG_SYS_SNAND_ENV_DEV to define the name of the SPI nand as exposed
> > by mtd list.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
> > ---
> >  env/Kconfig            |  41 ++++-
> >  env/Makefile           |   1 +
> >  env/env.c              |   3 +
> >  env/snand.c            | 338 +++++++++++++++++++++++++++++++++++++++++
> >  include/env_internal.h |   1 +
> >  5 files changed, 380 insertions(+), 4 deletions(-)
> >  create mode 100644 env/snand.c
> 
> Since this uses the generic mtd API, it can also support SPI NOR, and
> "regular" NAND too yes? If so, I'd like to see this named more
> generically (and my feedback about naming things from the UFS one
> applies here too), and then perhaps a follow-up converting some other
> platforms to use this? Thanks.
> 

I assume yes. So maybe we can change this to env/mtd.c? Any hint for a
better name?

Can you link the feedback from UFS, I can't find it.

-- 
	Ansuel


More information about the U-Boot mailing list