env: Introduce support for MTD
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 7 Apr 2025 18:59:51 +0000 (20:59 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 5 May 2025 20:16:59 +0000 (14:16 -0600)
commit03fb08d4aef8c342b583e148d1b5c4d289c5572f
treebdc197033132b4e2cc1254129bab55b5a9084f04
parentf717d798becf2dffd5816484962c350808e98a18
env: Introduce support for MTD

Introduce support for env in generic MTD. 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.

To support also these flash scenario, add support for storing and
reading ENV from generic MTD device by adding an env driver that
base entirely on the MTD api.

Introduce a new kconfig CONFIG_ENV_IS_IN_MTD and
CONFIG_ENV_MTD_DEV to define the name of the MTD device as exposed
by mtd list.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
env/Kconfig
env/Makefile
env/env.c
env/mtd.c [new file with mode: 0644]
include/env_internal.h