From: Carlo Caione <ccaione@baylibre.com>
To: David Lechner <dlechner@baylibre.com>
Cc: GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
u-boot@lists.u-boot-project.org, "Tom Rini" <trini@konsulko.com>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Ryder Lee" <ryder.lee@mediatek.com>,
"Weijie Gao" <weijie.gao@mediatek.com>,
"Chunfeng Yun" <chunfeng.yun@mediatek.com>,
"Igor Belwon" <igor.belwon@mentallysanemainliners.org>,
"Julien Stephan" <jstephan@baylibre.com>,
"Julien Masson" <jmasson@baylibre.com>,
"Johan Jonker" <jbx6244@gmail.com>,
"Macpaul Lin" <macpaul.lin@mediatek.com>,
"Chris-QJ Chen" <chris-qj.chen@mediatek.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Bastien Curutchet" <bastien.curutchet@bootlin.com>,
"Alexey Charkov" <alchark@gmail.com>,
"Vitor Sato Eschholz" <vsatoes@baylibre.com>,
"Pablo Sun (孫毓翔)" <pablo.sun@mediatek.com>,
"Arnaud Ferraris" <arnaud.ferraris@collabora.com>,
"Suhrid Subramaniam" <Suhrid.Subramaniam@mediatek.com>,
"Marek Vasut" <marek.vasut+usb@mailbox.org>,
"Casey Connolly" <casey.connolly@linaro.org>,
"Michael Srba" <Michael.Srba@seznam.cz>
Subject: Re: [PATCH v2 2/3] arm: mediatek: enable U-Boot fastboot DAs on Genio 510 and 700
Date: Tue, 29 Sep 2026 09:43:02 +0200 [thread overview]
Message-ID: <artrGkbaSYG4xCsU@macbook> (raw)
In-Reply-To: <898e280a-7af1-4f0f-9d10-a7350e4579bd@baylibre.com>
On Mon, Sep 28, 2026 at 17:43:26 +0100, David Lechner wrote:
> On 9/23/26 4:17 PM, Carlo Caione wrote:
> > Prefer fastboot in U-Boot proper when the complete download agent fits
> > the BootROM SRAM limit. Its shell and boot commands support provisioning
> > and recovery beyond the SPL agent's flashing operations, without relying
> > on the installed firmware.
> >
> > This variant requires BL31 and an external DDR loader.
> >
>
> ...
>
> > diff --git a/arch/arm/mach-mediatek/spl.c b/arch/arm/mach-mediatek/spl.c
> > index 6f1ec052b95..120a94c6598 100644
> > --- a/arch/arm/mach-mediatek/spl.c
> > +++ b/arch/arm/mach-mediatek/spl.c
> > @@ -33,15 +33,17 @@ void board_init_f(ulong dummy)
> >
> > u32 spl_boot_device(void)
> > {
> > -#if defined(CONFIG_SPL_SPI)
> > - return BOOT_DEVICE_SPI;
> > -#elif defined(CONFIG_SPL_MMC)
> > - return BOOT_DEVICE_MMC1;
> > -#elif defined(CONFIG_SPL_NAND_SUPPORT)
> > - return BOOT_DEVICE_NAND;
> > -#elif defined(CONFIG_SPL_NOR_SUPPORT)
> > - return BOOT_DEVICE_NOR;
> > -#else
> > + if (IS_ENABLED(CONFIG_MTK_BROM_DOWNLOAD_AGENT_UBOOT_FASTBOOT))
> > + return BOOT_DEVICE_RAM;
> > +
> > + if (CONFIG_IS_ENABLED(SPI))
> > + return BOOT_DEVICE_SPI;
> > + if (CONFIG_IS_ENABLED(MMC))
> > + return BOOT_DEVICE_MMC1;
> > + if (CONFIG_IS_ENABLED(NAND_SUPPORT))
> > + return BOOT_DEVICE_NAND;
> > + if (CONFIG_IS_ENABLED(NOR_SUPPORT))
> > + return BOOT_DEVICE_NOR;
> > +
> > return BOOT_DEVICE_NONE;
> > -#endif
> > }
>
> Could be nice to do the CONFIG_IS_ENABLED() conversion as a separate patch
> so it is easier to see what is added here.
Ok, I'll split it.
> > diff --git a/configs/mt8370-genio-da-uboot-fastboot.config b/configs/mt8370-genio-da-uboot-fastboot.config
> > new file mode 100644
> > index 00000000000..5a85b26df0d
> > --- /dev/null
> > +++ b/configs/mt8370-genio-da-uboot-fastboot.config
> > @@ -0,0 +1,28 @@
> > +#include <configs/mt8370-genio-da.config>
> > +
> > +CONFIG_MTK_BROM_DOWNLOAD_AGENT_UBOOT_FASTBOOT=y
> > +CONFIG_SYS_MALLOC_LEN=0x9000000
>
> What is driving the need for such large allocations?
Yeah, this was actually fixed in the previous SPL patchset but not in
this one. 8MB are enough, I'll fix this.
> > +CONFIG_CMD_FASTBOOT=y
> > +CONFIG_USB_FUNCTION_FASTBOOT=y
> > +CONFIG_FASTBOOT_FLASH=y
> > +CONFIG_FASTBOOT_FLASH_MMC=y
> > +CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> > +CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
> > +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
>
> Do we need to enable FASTBOOT_CMD_OEM_PARTCONF and FASTBOOT_CMD_OEM_BOOTBUS
> to allow flashing a blank eMMC?
This is actually a very, very good point. Now, we have two ways of doing
this: either we add the fastboot commands and let the host issue these
commands or we just do this in the code. The first solution would imply
modifying the genio-flash tools to issue the command during provisioning
and this is something I'd like to avoid, so I'm going to do this
programmatically the same way we do for the SPL DA version.
Cheers,
--
Carlo Caione
next prev parent reply other threads:[~2026-09-29 7:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 21:17 [PATCH v2 0/3] Add Genio 510 and 700 BootROM download agents Carlo Caione
2026-09-23 21:17 ` [PATCH v2 1/3] arm: mediatek: enable SPL fastboot DAs on Genio 510 and 700 Carlo Caione
2026-09-28 22:43 ` David Lechner
2026-09-29 7:39 ` Carlo Caione
2026-09-23 21:17 ` [PATCH v2 2/3] arm: mediatek: enable U-Boot " Carlo Caione
2026-09-28 22:43 ` David Lechner
2026-09-29 7:43 ` Carlo Caione [this message]
2026-09-23 21:17 ` [PATCH v2 3/3] doc: board: mediatek: document Genio download agents Carlo Caione
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=artrGkbaSYG4xCsU@macbook \
--to=ccaione@baylibre.com \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=Michael.Srba@seznam.cz \
--cc=Suhrid.Subramaniam@mediatek.com \
--cc=alchark@gmail.com \
--cc=arnaud.ferraris@collabora.com \
--cc=bastien.curutchet@bootlin.com \
--cc=casey.connolly@linaro.org \
--cc=chris-qj.chen@mediatek.com \
--cc=chunfeng.yun@mediatek.com \
--cc=dlechner@baylibre.com \
--cc=igor.belwon@mentallysanemainliners.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jbx6244@gmail.com \
--cc=jmasson@baylibre.com \
--cc=jstephan@baylibre.com \
--cc=macpaul.lin@mediatek.com \
--cc=marek.vasut+usb@mailbox.org \
--cc=neil.armstrong@linaro.org \
--cc=pablo.sun@mediatek.com \
--cc=ryder.lee@mediatek.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=vsatoes@baylibre.com \
--cc=weijie.gao@mediatek.com \
/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.