public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Maniyam, Dinesh" <dinesh.maniyam@altera.com>
To: Sean Anderson <seanga2@gmail.com>, Fabio Estevam <festevam@gmail.com>
Cc: michael@amarulasolutions.com, u-boot@lists.denx.de,
	trini@konsulko.com, a-dutta@ti.com, a-nandan@ti.com,
	jonas@kwiboo.se, Fabio Estevam <festevam@nabladev.com>
Subject: Re: [PATCH v2] spl: Add generic SPL MTD loader support
Date: Thu, 26 Feb 2026 13:34:55 +0800	[thread overview]
Message-ID: <9399843b-4d2f-499b-87cb-ff22eae2b78d@altera.com> (raw)
In-Reply-To: <1a128389-fe86-5ba5-1e01-4f2d932908f2@gmail.com>

Hi Fabio,
Thanks for the patch.

On 26/2/2026 1:10 pm, Sean Anderson wrote:
> [CAUTION: This email is from outside your organization. Unless you 
> trust the sender, do not click on links or open attachments as it may 
> be a fraudulent email attempting to steal your information and/or 
> compromise your computer.]
>
> On 2/25/26 19:08, Fabio Estevam wrote:
>> Hi Sean,
>>
>> On Wed, Feb 25, 2026 at 4:45 PM Sean Anderson <seanga2@gmail.com> wrote:
>>
>>> Actually, I don't think this is correct. NAND devices have have 
>>> multiple MTDs for each
>>> CS, and SPI-NOR devices are UCLASS_SPI_FLASH and not UCLASS_MTD. So 
>>> I think it's better
>>> to do something like
>>>
>>>          mtd_probe_devices();
>>>          switch (bootdev->boot_device) {
>>>          case BOOT_DEVICE_NAND:
>>>                  mtd = get_mtd_device_nm(CONFIG_SPL_MTD_NAND_NAME);
>>>                  break;
>>>          case BOOT_DEVICE_SPI:
>>>                  mtd = 
>>> get_mtd_device_nm(CONFIG_SPL_MTD_SPI_FLASH_NAME);
>>>                  break;
>>>          default:
>>>                  mtd = ERR_PTR(-ENODEV);
>>>                  break;
>>>          }
>>>          if (IS_ERR(mtd)) {
>>>                  ret = PTR_ERR(mtd);
>>>                  goto out;
>>>          }
>> ...
>>
>>>> Actually, if CONFIG_SPL_NAND_SUPPORT is enabled then the native 
>>>> nand loader is compiled.
>>>> Maybe we should add a separate Kconfig for it 
>>>> (CONFIG_SPL_NAND_LOAD) defaulting to
>>>> SPL_NAND_SUPPORT. Then users can disable the "native" load method 
>>>> if they want to use MTD.
>>>
>>> I have a patch for this that I will try to send this week.
>>
>> If you would like to prepare a patch for the generic SPL MTD loader,
>> I'll be glad to test it.
>
> I can try, but I can't promise I'll be done with it in any particular 
> timeframe.
>
> But TBH I don't think a spi_nand.c-style loader is the right way to do 
> things when UBI exists.
> Maybe Dinesh can comment, but I don't really see the point except if 
> e.g. you are really short
> on space in SPL, but not so much that you can't fit in MTD.
>
> --Sean
>
> Based on our current design, we rely on the existing NAND framework 
> with only a minimal set
> of additional helper functions provided by the controller, which keeps 
> the SPL implementation simple and NAND-specific.
>
> The SPI-NAND SPL loader expects a broader set of common SPL 
> helpers which lead to compilation failures.
> Adapting to that model would require significant refactoring and 
> extensive testing,
> so for now we plan to continue using and extending the existing 
> |nand_spl_loaders.c|,
> which aligns better with the current SPL design and our constraints.
>
> --Dinesh
>

  reply	other threads:[~2026-02-26 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20  3:12 [PATCH v2] spl: Add generic SPL MTD loader support Fabio Estevam
2026-02-20  3:52 ` Sean Anderson
2026-02-20 14:35   ` Tom Rini
2026-02-25 19:45   ` Sean Anderson
2026-02-26  0:08     ` Fabio Estevam
2026-02-26  5:10       ` Sean Anderson
2026-02-26  5:34         ` Maniyam, Dinesh [this message]
2026-02-26 12:04           ` Fabio Estevam
2026-02-20  7:20 ` Santhosh Kumar K
2026-02-25 15:46 ` Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9399843b-4d2f-499b-87cb-ff22eae2b78d@altera.com \
    --to=dinesh.maniyam@altera.com \
    --cc=a-dutta@ti.com \
    --cc=a-nandan@ti.com \
    --cc=festevam@gmail.com \
    --cc=festevam@nabladev.com \
    --cc=jonas@kwiboo.se \
    --cc=michael@amarulasolutions.com \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox