[PATCH 4/7] usb: ehci-mx6: Update driver to support i.MX8MM

Marek Vasut marex at denx.de
Mon Jun 29 04:30:22 CEST 2020


On 6/29/20 4:13 AM, Peng Fan wrote:

[...]

> @@ -366,7 +366,7 @@ static void usb_oc_config(int index)
>  	struct usbnc_regs *usbnc = (struct usbnc_regs *)(USB_BASE_ADDR +
>  			USB_OTHERREGS_OFFSET);
>  	void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[index]);
> -#elif defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8)
> +#elif defined(CONFIG_USB_EHCI_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8)

Can someone please clean up this growing ifdeffery ? This doesn't work
with the driver model. It's fine to do that in a subsequent patch, but
it really should be done soon.

>  	struct usbnc_regs *usbnc = (struct usbnc_regs *)(ulong)(USB_BASE_ADDR +
>  			(0x10000 * index) + USBNC_OFFSET);
>  	void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl1);
> @@ -469,7 +469,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
>  	enum usb_init_type type;
>  #if defined(CONFIG_MX6)
>  	u32 controller_spacing = 0x200;
> -#elif defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8)
> +#elif defined(CONFIG_USB_EHCI_MX7) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMX8)
>  	u32 controller_spacing = 0x10000;
>  #endif
>  	struct usb_ehci *ehci = (struct usb_ehci *)(ulong)(USB_BASE_ADDR +
> @@ -537,6 +537,12 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
>  	struct usb_ehci *ehci = priv->ehci;
>  	int ret;
>  
> +	ret = board_usb_init(priv->portnr, priv->init_type);
> +	if (ret) {
> +		printf("Failed to initialize board for USB\n");
> +		return ret;
> +	}

Are these hooks needed ?


More information about the U-Boot mailing list