回复: [PATCH v1 2/7] usb: ehci-mx6: Fix usb_oc_config() for i.MX7/8M/9/7ULP/8 and 8ULP platforms
Alice Guo (OSS)
alice.guo at oss.nxp.com
Thu Dec 25 11:41:48 CET 2025
> -----邮件原件-----
> 发件人: Marek Vasut <marek.vasut at mailbox.org>
> 发送时间: 2025年12月16日 19:16
> 收件人: Alice Guo (OSS) <alice.guo at oss.nxp.com>; dl-uboot-imx
> <uboot-imx at nxp.com>; u-boot at lists.denx.de
> 抄送: Stefano Babic <sbabic at nabladev.com>; Fabio Estevam
> <festevam at gmail.com>; Tom Rini <trini at konsulko.com>; Marek Vasut
> <marex at denx.de>; Marek Vasut <marek.vasut at mailbox.org>; Ye Li
> <ye.li at nxp.com>; tharvey at gateworks.com; Peng Fan <peng.fan at nxp.com>;
> Mattijs Korpershoek <mkorpershoek at kernel.org>; Lukasz Majewski
> <lukma at denx.de>; Sherry Sun <sherry.sun at nxp.com>; Kever Yang
> <kever.yang at rock-chips.com>; Jonas Karlman <jonas at kwiboo.se>; Quentin
> Schulz <quentin.schulz at cherry.de>; George Chan <gchan9527 at gmail.com>;
> Simon Glass <sjg at chromium.org>; David Zang <davidzangcs at gmail.com>; Alice
> Guo <alice.guo at nxp.com>
> 主题: Re: [PATCH v1 2/7] usb: ehci-mx6: Fix usb_oc_config() for
> i.MX7/8M/9/7ULP/8 and 8ULP platforms
>
> On 12/16/25 7:38 AM, alice.guo at oss.nxp.com wrote:
> > From: Alice Guo <alice.guo at nxp.com>
> >
> > The usb_oc_config() function previously assumed that the overcurrent
> > control register index always matches the USB controller index, which
> > is true for i.MX6 but not for i.MX7/8M/9/7ULP/8/8ULP. On these
> > platforms, the overcurrent control is located in the USB OTG Control 1
> > register, which is always at index 0.
> >
> > Signed-off-by: Alice Guo <alice.guo at nxp.com>
> > ---
> > drivers/usb/host/ehci-mx6.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
> > index cfaf49d67f0..03ff4ce10d5 100644
> > --- a/drivers/usb/host/ehci-mx6.c
> > +++ b/drivers/usb/host/ehci-mx6.c
> > @@ -280,7 +280,12 @@ static void ehci_mx6_powerup_fixup(struct ehci_ctrl
> *ctrl, uint32_t *status_reg,
> > /* Should be done in the MXS PHY driver */
> > static void usb_oc_config(struct usbnc_regs *usbnc, int index)
> > {
> > +#if defined(CONFIG_MX6)
> > void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[index]);
> > +#elif defined(CONFIG_USB_EHCI_MX7) || defined(CONFIG_MX7ULP) ||
> defined(CONFIG_IMX8) || \
> > + defined(CONFIG_IMX8ULP)
> > + void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[0]); #endif
> Can we simply pass 0 to this function as index for non-MX6 instead of this
> ifdeffery ?
Even if I move the condition from inside the usb_oc_config() to the call site, I still cannot avoid conditional compilation because the logic is platform-specific.
Given this, is it acceptable to keep the current change as it is?
Best Regards,
Alice Guo
More information about the U-Boot
mailing list