public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: michael@amarulasolutions.com, u-boot@lists.denx.de,
	trini@konsulko.com, dinesh.maniyam@altera.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 00:10:37 -0500	[thread overview]
Message-ID: <1a128389-fe86-5ba5-1e01-4f2d932908f2@gmail.com> (raw)
In-Reply-To: <CAOMZO5C9BwWosjdgJFPX8XMsrqo_rQLeTn9PLFi9JRoLw+-yag@mail.gmail.com>

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

  reply	other threads:[~2026-02-26  5:10 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 [this message]
2026-02-26  5:34         ` Maniyam, Dinesh
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=1a128389-fe86-5ba5-1e01-4f2d932908f2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=a-dutta@ti.com \
    --cc=a-nandan@ti.com \
    --cc=dinesh.maniyam@altera.com \
    --cc=festevam@gmail.com \
    --cc=festevam@nabladev.com \
    --cc=jonas@kwiboo.se \
    --cc=michael@amarulasolutions.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