From: Sumit Garg <sumit.garg@kernel.org>
To: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Cc: Casey Connolly <casey.connolly@linaro.org>,
trini@konsulko.com, neil.armstrong@linaro.org, lukma@denx.de,
seanga2@gmail.com, marex@denx.de, malysagreg@gmail.com,
arturs.artamonovs@analog.com, utsav.agarwal@analog.com,
vasileios.bimpikas@analog.com, ian.roberts@timesys.com,
nathan.morrison@timesys.com, peng.fan@nxp.com,
alif.zakuan.yuslaimi@altera.com, kory.maincent@bootlin.com,
sjg@chromium.org, jerome.forissier@linaro.org, ziyao@disroot.org,
stefan.roese@mailbox.org, mkorpershoek@kernel.org,
rui.silva@linaro.org, ilias.apalodimas@linaro.org,
luca.weiss@fairphone.com, quic_varada@quicinc.com,
u-boot@lists.denx.de, u-boot-qcom@groups.io
Subject: Re: [PATCH v2 4/7] arch: arm: mach-snapdragon: Make USB speed fixup configurable
Date: Fri, 26 Dec 2025 16:43:11 +0530 [thread overview]
Message-ID: <aU5tx8VkWCxwLbHN@sumit-xelite> (raw)
In-Reply-To: <69375261-2c75-4093-9dd3-a3a97505c417@oss.qualcomm.com>
On Wed, Dec 03, 2025 at 04:51:20PM +0530, Balaji Selvanathan wrote:
>
> On 11/26/2025 7:54 PM, Casey Connolly wrote:
> > Hi Balaji,
> >
> > On 24/11/2025 16:55, Balaji Selvanathan wrote:
> > > Add CONFIG_QCOM_USB_FIXUP option to allow platforms to disable
> > > the USB speed limitation fixup when they have proper super-speed
> > > USB support in U-Boot.
> > In general, we prefer to handle cases like this at runtime rather than
> > compile time. Could you rework this to check for the "qcom,sc7280-dwc3"
> > compatible and just skip the check in that case? I would also propose
> > adding a log_warning() in the fixup case so that folks working on other
> > platforms know to add their compatible too.
> >
> > Obviously that's still not an ideal solution, maybe it would be possible
> > to implement the Super Smart (tm) fix and actually check if a driver
> > /will/ bind to the ss-phy node before the fixup, it depends how slow
> > that would be.
> This is good idea. Actually, I have implemented the super smart fix rather
> than hardcoding
>
> "qcom,sc7280-dwc3" in code. The respined code is here: https://lore.kernel.org/u-boot/20251203110735.1959862-5-balaji.selvanathan@oss.qualcomm.com/;
> The code checks if the SS PHY driver is indeed available and if it exists, then it skips doing
> USB HS fixup.
> The entire time to check if the SS PHY driver is available is ~125ms. Request to say if this is reasonable.
I don't think it's reasonable to add more than 125ms in boot for every
platform considering slower platforms as compared to RB3G2 where it will
be much worse.
Lets just rather add a static check for "qcom,sc7280-dwc3" to skip the
USB fixup.
-Sumit
> The power domain fixup is taking ~98us (mentioning just for comparison).
> Thanks,
> Balaji
>
> >
> > Kind regards,
> >
> > > Currently, U-Boot limits USB to high-speed mode on all Qualcomm
> > > platforms by fixing up the device tree at runtime. This was
> > > necessary because most platforms lacked super-speed PHY drivers.
> > >
> > > However, newer platforms now have proper QMP PHY drivers that support
> > > super-speed USB. For these platforms, the fixup is counterproductive
> > > as it prevents the hardware from operating at its full capability.
> > >
> > > This change:
> > > - Adds CONFIG_QCOM_USB_FIXUP (default y) to maintain backward
> > > compatibility with existing platforms
> > > - Wraps the fixup code with #ifdef to allow selective disabling
> > > - Allows platforms with super-speed support to disable the fixup
> > > via their defconfig
> > >
> > > Platforms without super-speed PHY drivers will continue to work
> > > as before with the fixup enabled by default.
> > >
> > > Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
> > > ---
> > > arch/arm/mach-snapdragon/Kconfig | 10 ++++++++++
> > > arch/arm/mach-snapdragon/of_fixup.c | 4 ++++
> > > 2 files changed, 14 insertions(+)
> > >
> > > diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
> > > index 976c0e35fce..6c53aeef597 100644
> > > --- a/arch/arm/mach-snapdragon/Kconfig
> > > +++ b/arch/arm/mach-snapdragon/Kconfig
> > > @@ -29,6 +29,16 @@ config SYS_MALLOC_LEN
> > > config LNX_KRNL_IMG_TEXT_OFFSET_BASE
> > > default 0x80000000
> > > +config QCOM_USB_FIXUP
> > > + bool "Enable USB speed fixup for Qualcomm platforms"
> > > + default y
> > > + help
> > > + Enable runtime fixup of USB device tree nodes to limit USB to
> > > + high-speed mode. This is needed on some Qualcomm platforms where
> > > + U-Boot doesn't support super-speed USB.
> > > + Disable this for platforms that have proper super-speed USB support
> > > + in U-Boot.
> > > +
> > > config SYS_BOARD
> > > string "Snapdragon SoCs based board"
> > > help
> > > diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
> > > index eec2c0c757e..6a64168f67e 100644
> > > --- a/arch/arm/mach-snapdragon/of_fixup.c
> > > +++ b/arch/arm/mach-snapdragon/of_fixup.c
> > > @@ -27,6 +27,7 @@
> > > #include <stdlib.h>
> > > #include <time.h>
> > > +#ifdef CONFIG_QCOM_USB_FIXUP
> > > /* U-Boot only supports USB high-speed mode on Qualcomm platforms with DWC3
> > > * USB controllers. Rather than requiring source level DT changes, we fix up
> > > * DT here. This improves compatibility with upstream DT and simplifies the
> > > @@ -115,6 +116,7 @@ static void fixup_usb_nodes(struct device_node *root)
> > > log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret);
> > > }
> > > }
> > > +#endif
> > > /* Remove all references to the rpmhpd device */
> > > static void fixup_power_domains(struct device_node *root)
> > > @@ -157,7 +159,9 @@ static int qcom_of_fixup_nodes(void * __maybe_unused ctx, struct event *event)
> > > {
> > > struct device_node *root = event->data.of_live_built.root;
> > > +#ifdef CONFIG_QCOM_USB_FIXUP
> > > time_call(fixup_usb_nodes, root);
> > > +#endif
> > > time_call(fixup_power_domains, root);
> > > return 0;
next prev parent reply other threads:[~2025-12-26 11:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 15:54 [PATCH v2 0/7] Enable USB3 Super-Speed support for QCM6490/SC7280 Balaji Selvanathan
2025-11-24 15:54 ` [PATCH v2 1/7] drivers: clk: qcom: sc7280: Add USB3 PHY pipe clock Balaji Selvanathan
2025-11-26 14:30 ` Casey Connolly
2025-12-23 8:31 ` Sumit Garg
2025-11-24 15:54 ` [PATCH v2 2/7] drivers: usb: dwc3: Add delay after core soft reset Balaji Selvanathan
2025-12-23 9:05 ` Sumit Garg
2025-12-24 5:56 ` Balaji Selvanathan
2025-12-26 7:27 ` Sumit Garg
2025-11-24 15:54 ` [PATCH v2 3/7] drivers: phy: qcom: Add QMP USB3-DP Combo PHY driver Balaji Selvanathan
2025-11-24 19:51 ` Tom Rini
2025-11-25 10:33 ` Balaji Selvanathan
2025-11-26 14:46 ` Casey Connolly
2025-11-28 3:31 ` Balaji Selvanathan
2025-12-03 11:13 ` Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 4/7] arch: arm: mach-snapdragon: Make USB speed fixup configurable Balaji Selvanathan
2025-11-26 14:24 ` Casey Connolly
2025-12-03 11:21 ` Balaji Selvanathan
2025-12-26 11:13 ` Sumit Garg [this message]
2025-11-24 15:55 ` [PATCH v2 5/7] arch: arm: dts: qcs6490-rb3gen2: Override USB3 PHY clocks Balaji Selvanathan
2025-11-26 14:26 ` Casey Connolly
2025-12-03 11:36 ` Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 6/7] configs: qcm6490: Enable super-speed USB support Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 7/7] MAINTAINERS: Add entry for Qualcomm PHY drivers Balaji Selvanathan
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=aU5tx8VkWCxwLbHN@sumit-xelite \
--to=sumit.garg@kernel.org \
--cc=alif.zakuan.yuslaimi@altera.com \
--cc=arturs.artamonovs@analog.com \
--cc=balaji.selvanathan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=ian.roberts@timesys.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=kory.maincent@bootlin.com \
--cc=luca.weiss@fairphone.com \
--cc=lukma@denx.de \
--cc=malysagreg@gmail.com \
--cc=marex@denx.de \
--cc=mkorpershoek@kernel.org \
--cc=nathan.morrison@timesys.com \
--cc=neil.armstrong@linaro.org \
--cc=peng.fan@nxp.com \
--cc=quic_varada@quicinc.com \
--cc=rui.silva@linaro.org \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=stefan.roese@mailbox.org \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
--cc=utsav.agarwal@analog.com \
--cc=vasileios.bimpikas@analog.com \
--cc=ziyao@disroot.org \
/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