From: Ferass El Hafidi <funderscore@postmarketos.org>
To: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
Cc: u-boot@lists.u-boot-project.org, "Tom Rini" <trini@konsulko.com>,
"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
"Alexey Charkov" <alchark@flipper.net>,
"Casey Connolly" <casey.connolly@linaro.org>,
"Julien Masson" <jmasson@baylibre.com>,
"Carlo Caione" <ccaione@baylibre.com>,
"Jörg Sommer" <joerg@jo-so.de>,
"Johan Jonker" <jbx6244@gmail.com>,
"Denis Mukhin" <dmukhin@ford.com>
Subject: Re: [PATCH] block: add legacy block support for TPL
Date: Fri, 27 Nov 2026 15:34:25 +0000 [thread overview]
Message-ID: <tp63eh.1vrvzthhsnbk9@postmarketos.org> (raw)
In-Reply-To: <tp61ew.2jah7hm6wep6j@postmarketos.org>
On Fri, 27 Nov 2026 14:51, Ferass El Hafidi <funderscore@postmarketos.org> wrote:
>Hi Massimo, sorry for the delay ^^
>
>On Mon, 09 Nov 2026 19:51, Massimo Pegorer <massimo.pegorer+oss@gmail.com> wrote:
>>Hi,
>>
>>Il giorno lun 9 nov 2026 alle ore 09:01 Ferass El Hafidi ha scritto:
>>>
>>> Legacy block support is only selectable for SPL. However it is
>>> useful in TPL too, where the full block driver (with DM and whatnot)
>>> will not fit.
>>> Add a TPL_LEGACY_BLOCK kconfig option to enable legacy block support in
>>> TPL. Note that it is hidden in menuconfig (just like the SPL variant).
>>>
>>> Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
>>> ---
>>> As I've been working on some TPL support for Amlogic I noticed that I
>>> could not choose the legacy block driver (while I could choose it for SPL).
>>> Given we only have 44K available, DM is a tight fit there so I'd rather not
>>> enable it where possible to save space.
>>>
>>> Adding the ability to select the legacy block driver in TPL seemed like
>>> a good option for the same reasons it is already available for SPL
>>> builds. And indeed it works just fine there too.
>>> ---
>>> disk/Makefile | 4 ++--
>>> drivers/Makefile | 7 ++++++-
>>> drivers/block/Kconfig | 12 +++++++++++-
>>> drivers/block/Makefile | 2 +-
>>> 4 files changed, 20 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/disk/Makefile b/disk/Makefile
>>> index c16876e2073..18b839f6ecd 100644
>>> --- a/disk/Makefile
>>> +++ b/disk/Makefile
>>> @@ -10,8 +10,8 @@ ifdef CONFIG_$(PHASE_)BLK
>>> obj-$(CONFIG_$(PHASE_)PARTITIONS) += disk-uclass.o
>>> endif
>>>
>>> -# Must have BLK or SPL_LEGACY_BLOCK to support partitions
>>> -ifneq ($(CONFIG_$(PHASE_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
>>> +# Must have BLK or LEGACY_BLOCK to support partitions
>>> +ifneq ($(CONFIG_$(PHASE_)BLK),$(CONFIG_$(PHASE_)LEGACY_BLOCK),)
>>> obj-$(CONFIG_$(PHASE_)DOS_PARTITION) += part_dos.o
>>> obj-$(CONFIG_$(PHASE_)ISO_PARTITION) += part_iso.o
>>> obj-$(CONFIG_$(PHASE_)EFI_PARTITION) += part_efi.o
>>> diff --git a/drivers/Makefile b/drivers/Makefile
>>> index 5403206159c..989be07cd02 100644
>>> --- a/drivers/Makefile
>>> +++ b/drivers/Makefile
>>> @@ -74,7 +74,6 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
>>> obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
>>> obj-$(CONFIG_SPL_USB_HOST) += usb/host/
>>> obj-$(CONFIG_SPL_SATA) += ata/ scsi/
>>> -obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
>>> obj-$(CONFIG_SPL_THERMAL) += thermal/
>>> obj-$(CONFIG_SPL_UFS_SUPPORT) += scsi/ ufs/
>>>
>>> @@ -82,6 +81,12 @@ endif
>>> endif
>>> endif
>>>
>>> +ifdef CONFIG_XPL_BUILD
>>> +
>>> +obj-$(CONFIG_$(PHASE_)LEGACY_BLOCK) += block/
>>> +
>>> +endif
>>
>>What's the purpose of the ifdeffery? I would expect it to work with or without
>>ifdeffery exactly in the same way. If CONFIG_XPL_BUILD is not defined,
>>CONFIG_$(PHASE_)LEGACY_BLOCK becomes CONFIG_LEGACY_BLOCK which does not exists.
>>
>
>Yes, CONFIG_LEGACY_BLOCK does not exist. I believe there was a reason as
>to why the legacy block driver could not be chosen for U-Boot proper so
>I didn't question it. That's why there's this `ifdef`.
>
>Is it something you'd like me to change in the next revision?
>
I got pointed out offlist (on IRC, thanks!) that your point might've
been that the ifdef is unnecessary and can be removed for the same effect. And
indeed your feedback makes a lot more sense that way. Sorry for the
misunderstanding, I'll fix that in v2.
Thanks a lot!
Best regards,
Ferass
next prev parent reply other threads:[~2026-11-27 15:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 8:01 [PATCH] block: add legacy block support for TPL Ferass El Hafidi
2026-11-09 15:10 ` Tom Rini
2026-11-09 19:51 ` Massimo Pegorer
2026-11-09 19:56 ` Tom Rini
2026-11-27 14:51 ` Ferass El Hafidi
2026-11-27 15:34 ` Ferass El Hafidi [this message]
2026-11-28 9:54 ` Massimo Pegorer
2026-11-28 20:55 ` Ferass El Hafidi
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=tp63eh.1vrvzthhsnbk9@postmarketos.org \
--to=funderscore@postmarketos.org \
--cc=alchark@flipper.net \
--cc=casey.connolly@linaro.org \
--cc=ccaione@baylibre.com \
--cc=dmukhin@ford.com \
--cc=jbx6244@gmail.com \
--cc=jmasson@baylibre.com \
--cc=joerg@jo-so.de \
--cc=massimo.pegorer+oss@gmail.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=xypron.glpk@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.