From 03fb08d4aef8c342b583e148d1b5c4d289c5572f Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 7 Apr 2025 20:59:51 +0200 Subject: 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 --- env/env.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'env/env.c') diff --git a/env/env.c b/env/env.c index bcc189e14db..dbaeedc3c3b 100644 --- a/env/env.c +++ b/env/env.c @@ -58,6 +58,9 @@ static enum env_location env_locations[] = { #ifdef CONFIG_ENV_IS_IN_SPI_FLASH ENVL_SPI_FLASH, #endif +#ifdef CONFIG_ENV_IS_IN_MTD + ENVL_MTD, +#endif #ifdef CONFIG_ENV_IS_IN_UBI ENVL_UBI, #endif -- cgit v1.2.3