[PATCH] env: Introduce support for SPI NAND flash

Tom Rini trini at konsulko.com
Wed Apr 2 17:13:07 CEST 2025


On Wed, Apr 02, 2025 at 05:10:31PM +0200, Christian Marangi wrote:
> 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?

Sounds good to me.

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

Here:
https://lore.kernel.org/u-boot/7a5ac5c2-5bb7-45d2-838b-63fa07766c4f@linaro.org/T/#m90111fe8a18efad7fc4f4e03745fe5e7b00db028

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250402/a5b159ee/attachment.sig>


More information about the U-Boot mailing list