[PATCH] env: Introduce support for SPI NAND flash

Tom Rini trini at konsulko.com
Wed Apr 2 17:05:42 CEST 2025


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.

-- 
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/2816ebf0/attachment.sig>


More information about the U-Boot mailing list