From: Carlo Caione <ccaione@baylibre.com>
To: David Lechner <dlechner@baylibre.com>
Cc: u-boot@lists.u-boot-project.org,
GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
"Suhrid Subramaniam" <Suhrid.Subramaniam@mediatek.com>,
"Macpaul Lin (林智斌)" <Macpaul.Lin@mediatek.com>,
"Pablo Sun (孫毓翔)" <pablo.sun@mediatek.com>,
"Arnaud Ferraris" <arnaud.ferraris@collabora.com>,
"Mattijs Korpershoek" <mkorpershoek@kernel.org>,
"Tom Rini" <trini@konsulko.com>, "Simon Glass" <sjg@chromium.org>,
"Sam Day" <me@samcday.com>,
"Quentin Schulz" <quentin.schulz@cherry.de>,
"Vitor Sato Eschholz" <vsatoes@baylibre.com>,
"Lukasz Majewski" <lukma@denx.de>,
"Marek Vasut" <marek.vasut+usb@mailbox.org>,
"Peng Fan" <peng.fan@nxp.com>,
"Jaehoon Chung" <jh80.chung@samsung.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Julien Masson" <jmasson@baylibre.com>,
"Alexey Charkov" <alchark@gmail.com>,
"Adrian Freihofer" <adrian.freihofer@siemens.com>,
"Francois Berder" <fberder@outlook.fr>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
"Vincent Jardin" <vjardin@free.fr>,
"Peter Robinson" <pbrobinson@gmail.com>
Subject: Re: [PATCH v5 5/5] fastboot: add SPL support
Date: Wed, 9 Sep 2026 23:23:24 +0200 [thread overview]
Message-ID: <aqHOCHRyUGfhJcXf@macbook> (raw)
In-Reply-To: <7b98b6c4-078e-48f1-98d1-1b65fc19b611@baylibre.com>
On Wed, Sep 09, 2026 at 16:16:16 +0100, David Lechner wrote:
> On 9/6/26 3:02 PM, Carlo Caione wrote:
> > Some recovery and initial-provisioning flows run before usable firmware
> > is available in persistent storage. In these flows the SoC ROM loads a
> > small first stage, but that stage must still provide a standard protocol
> > with which the host can provision the device.
> >
>
> ...
>
> > diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
> > index 111516fd1b3..a2a89fc04f8 100644
> > --- a/drivers/fastboot/fb_command.c
> > +++ b/drivers/fastboot/fb_command.c
> > @@ -48,10 +48,59 @@ static void oem_board(char *, char *);
> > static void run_ucmd(char *, char *);
> > static void run_acmd(char *, char *);
> >
> > -static const struct {
> > +struct fastboot_command {
> > const char *command;
> > void (*dispatch)(char *cmd_parameter, char *response);
> > -} commands[FASTBOOT_COMMAND_COUNT] = {
> > +};
> > +
> > +#ifdef CONFIG_XPL_BUILD
> > +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
> > + [FASTBOOT_COMMAND_GETVAR] = {
> > + .command = "getvar",
> > + .dispatch = getvar
> > + },
> > + [FASTBOOT_COMMAND_DOWNLOAD] = {
> > + .command = "download",
> > + .dispatch = download
> > + },
> > + [FASTBOOT_COMMAND_FLASH] = {
> > + .command = "flash",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_ERASE] = {
> > + .command = "erase",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_CONTINUE] = {
> > + .command = "continue",
> > + .dispatch = okay
> > + },
> > + [FASTBOOT_COMMAND_REBOOT] = {
> > + .command = "reboot",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_REBOOT_BOOTLOADER] = {
> > + .command = "reboot-bootloader",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > + (reboot_bootloader), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_REBOOT_FASTBOOTD] = {
> > + .command = "reboot-fastboot",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > + (reboot_fastbootd), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_REBOOT_RECOVERY] = {
> > + .command = "reboot-recovery",
> > + .dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > + (reboot_recovery), (NULL))
> > + },
> > + [FASTBOOT_COMMAND_SET_ACTIVE] = {
> > + .command = "set_active",
> > + .dispatch = okay
> > + },
> > +};
>
> Do we really need to make a complete second table or can we just #ifndef
> the indivdual commands in the existing table?
That was actually suggested by Mattijs here
https://lore.kernel.org/all/877blphqmg.fsf@kernel.org/
next prev parent reply other threads:[~2026-09-09 21:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
2026-09-09 20:31 ` David Lechner
2026-09-11 12:34 ` Mattijs Korpershoek
2026-09-11 13:33 ` Carlo Caione
2026-09-11 14:49 ` Mattijs Korpershoek
2026-09-06 20:02 ` [PATCH v5 2/5] fastboot: use the common handler for USB reboot Carlo Caione
2026-09-06 20:02 ` [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware Carlo Caione
2026-09-11 12:38 ` Mattijs Korpershoek
2026-09-06 20:02 ` [PATCH v5 4/5] image: sparse: add phase-aware SPL support Carlo Caione
2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
2026-09-09 21:16 ` David Lechner
2026-09-09 21:23 ` Carlo Caione [this message]
2026-09-09 21:57 ` David Lechner
2026-09-11 12:26 ` Mattijs Korpershoek
2026-09-11 13:30 ` Mattijs Korpershoek
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=aqHOCHRyUGfhJcXf@macbook \
--to=ccaione@baylibre.com \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=Macpaul.Lin@mediatek.com \
--cc=Suhrid.Subramaniam@mediatek.com \
--cc=adrian.freihofer@siemens.com \
--cc=alchark@gmail.com \
--cc=arnaud.ferraris@collabora.com \
--cc=dlechner@baylibre.com \
--cc=fberder@outlook.fr \
--cc=ilias.apalodimas@linaro.org \
--cc=jh80.chung@samsung.com \
--cc=jmasson@baylibre.com \
--cc=lukma@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=marek.vasut+usb@mailbox.org \
--cc=me@samcday.com \
--cc=mkorpershoek@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=pablo.sun@mediatek.com \
--cc=pbrobinson@gmail.com \
--cc=peng.fan@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=vjardin@free.fr \
--cc=vsatoes@baylibre.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.