U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 1/3] arm: mediatek: enable SPL fastboot DAs on Genio 510 and 700
Date: Tue, 29 Sep 2026 09:39:00 +0200	[thread overview]
Message-ID: <artp7Bnc8b0FBD2t@macbook> (raw)
In-Reply-To: <5a9f1311-09ad-4c8d-8df6-09c26106d3b4@baylibre.com>

On Mon, Sep 28, 2026 at 17:43:22 +0100, David Lechner wrote:
> On 9/23/26 4:17 PM, Carlo Caione wrote:
> > From: Julien Masson <jmasson@baylibre.com>
> > 
> > Genio 510 and 700 need a way to provision blank eMMC and recover from
> > unusable boot firmware without relying on the installed bootloader.
> > Add a BootROM-loaded fastboot agent that also prepares the eMMC boot
> > settings so newly flashed firmware can boot.
> > 
> > U-Boot proper is preferred when the complete agent fits BootROM's SRAM
> > download area before DRAM initialization. Provide the SPL alternative
> > for tighter payload budgets, avoiding the space required by BL31 and
> > U-Boot proper. An external DDR loader is still required.
> 
> This is a bit short on details of why certain tecnical descisions are made
> in this patch.

I'll try to improve it when possible.
 
> > +	/* Reset to x1 SDR, backward-compatible timing for each boot. */
> > +	ret = mmc_set_boot_bus_width(mmc, 0, 0, 0);
> > +	if (ret)
> > +		printf("Cannot configure the eMMC boot bus: %d\n", ret);
> > +
> > +	if (!mmc->ext_csd[EXT_CSD_RST_N_FUNCTION]) {
> > +		ret = mmc_set_rst_n_function(mmc, 1);
> 
> If I understand correctly, this makes a permanant change to the eMMC hardware.
> It is documented in patch 3, but I wonder if we should add a comment here too.
> And I wonder if anyone would not want that setting.

This was ported over from the downstream MTK code so I think that this
is actually needed. I'll add a comment here.

> > diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
> > index 20befdba0e2..61fefcf9a34 100644
> > --- a/board/mediatek/MAINTAINERS
> > +++ b/board/mediatek/MAINTAINERS
> > @@ -18,13 +18,18 @@ MT8188/MT8370/MT8390
> >  M:	Macpaul Lin <Macpaul.Lin@mediatek.com>
> >  M:	Julien Stephan <jstephan@baylibre.com>
> >  S:	Maintained
> > +F:	arch/arm/dts/mt8370-genio-da-u-boot.dtsi
> >  F:	arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
> >  F:	arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
> >  F:	arch/arm/dts/mt8390-genio-common-u-boot.dtsi
> >  F:	arch/arm/dts/mtk-genio-*-binman-u-boot.dtsi
> >  F:	arch/arm/dts/mtk-genio-binman-u-boot.dtsi
> > +F:	configs/mt8370-genio-da-spl-fastboot.config
> > +F:	configs/mt8370-genio-da.config
> 
> These are not sorted in order.

:(
 
> > diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
> > index f296a72cf18..d8ef6e6afba 100644
> > --- a/drivers/usb/mtu3/mtu3_core.c
> > +++ b/drivers/usb/mtu3/mtu3_core.c
> > @@ -843,7 +843,10 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
> >  	mtu->mac_base = ssusb->mac_base;
> >  	mtu->ssusb = ssusb;
> >  	mtu->max_speed = usb_get_maximum_speed(dev_ofnode(ssusb->dev));
> > -	mtu->force_vbus = dev_read_bool(ssusb->dev, "mediatek,force-vbus");
> > +	/* Fixed peripheral mode must not depend on OTG session detection. */
> 
> Why not? From what I am seeing in the Linux driver it doesn't do this.
> And I'm not sure why mt8183 has "mediatek,force-vbus" here in the U-boot
> devicetree. Maybe lack of proper pinmux for that target in U-boot?
> 
> I feel like we should not be doing this for new boards. I would only expect
> to need to force vbus on a board where vbus wasn't wired up properly. That
> isn't the case here.
> 
> Is fastboot broken without this change?

I tested it and it is not. So it looks like this change is actually not
really needed.

Thanks for the review,

--
Carlo Caione

  reply	other threads:[~2026-09-29  7:39 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 [this message]
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
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=artp7Bnc8b0FBD2t@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox