[PATCH v1 2/7] usb: ehci-mx6: Fix usb_oc_config() for i.MX7/8M/9/7ULP/8 and 8ULP platforms
Marek Vasut
marek.vasut at mailbox.org
Tue Dec 16 12:15:43 CET 2025
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 ?
More information about the U-Boot
mailing list