[PATCH 1/5] mtd: nand: introduce SPL_NAND_FRAMEWORK_CAPABLE Kconfig option
Maniyam, Dinesh
dinesh.maniyam at altera.com
Fri Jan 30 06:26:16 CET 2026
Hi Tom,
On 29/1/2026 11:24 pm, Tom Rini wrote:
> On Thu, Jan 29, 2026 at 01:04:42PM +0800,dinesh.maniyam at altera.com wrote:
>
>> From: Dinesh Maniyam<dinesh.maniyam at altera.com>
>>
>> The SPL NAND MTD framework requires working driver model support
>> and sufficient memory resources, which are not available on all
>> platforms.
>>
>> Introduce a SPL_NAND_FRAMEWORK_CAPABLE Kconfig option to allow
>> platforms to explicitly advertise support for compiling the full
>> NAND/MTD framework into SPL.
>>
>> This avoids accidental enablement of the SPL NAND framework on
>> platforms that cannot support it and provides a clear capability
>> boundary for platform maintainers.
>>
>> Signed-off-by: Dinesh Maniyam<dinesh.maniyam at altera.com>
>> ---
>> drivers/mtd/nand/raw/Kconfig | 25 +++++++++++++++++++++++++
>> 1 file changed, 25 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
>> index e0ff28cb21b..e41e5ef2e94 100644
>> --- a/drivers/mtd/nand/raw/Kconfig
>> +++ b/drivers/mtd/nand/raw/Kconfig
>> @@ -809,6 +809,31 @@ config SYS_NAND_HW_ECC_OOBFIRST
>> bool "In SPL, read the OOB first and then the data from NAND"
>> depends on SPL_NAND_SIMPLE
>>
>> +config SPL_NAND_FRAMEWORK_CAPABLE
>> + bool
>> + depends on SPL_DM
>> + depends on SPL_HAS_BSS_LINKER_SECTION
>> +
>> +config SPL_NAND_USE_NAND_FRAMEWORK
>> + bool "Use NAND/MTD framework in SPL"
>> + depends on SPL_NAND_SUPPORT && MTD
>> + depends on SPL_NAND_FRAMEWORK_CAPABLE
>> + depends on SPL_ENV_SUPPORT
>> + depends on ENV_IS_IN_NAND
>> + select SPL_SYS_NAND_SELF_INIT
>> + select SPL_NAND_BASE
>> + select SPL_NAND_DRIVERS
>> + select SPL_NAND_IDENT
>> + select SPL_NAND_INIT
>> + select SPL_NAND_ECC
>> + help
>> + Enable loading U-Boot from NAND in SPL using the full
>> + NAND/MTD framework instead of the minimal SPL NAND loaders.
>> + This provides bad-block aware reads and flexible offset
>> + handling via the common NAND/MTD infrastructure.
>> + Platforms enabling this option must also provide working
>> + driver model support and sufficient SPL memory resources.
>> +
>> endif # if SPL
>>
>> endif # if MTD_RAW_NAND
> It sounds like dependencies are missing on existing symbols, and should
> be added there, from the description. It also sounds like these
> platforms have hard limits on SPL size, but aren't setting the
> appropriate options to enforce that at link time. Or am I totally
> misunderstanding?
>
> Spot on!
> The SPL memory requirement was only documented in the help text.
> Add an explicit dependency on|SPL_MAX_SIZE| to ensure platforms enabling the
> full NAND/MTD framework in SPL declare sufficient SRAM.
More information about the U-Boot
mailing list