[U-Boot] [PATCH 3/3] imx: mx6sllevk: add usb support

Peng Fan peng.fan at nxp.com
Thu Dec 22 02:16:57 CET 2016



> -----Original Message-----
> From: Jagan Teki [mailto:jagan at openedev.com]
> Sent: Wednesday, December 21, 2016 10:02 PM
> To: Peng Fan <peng.fan at nxp.com>
> Cc: Stefano Babic <sbabic at denx.de>; Marek Vasut <marex at denx.de>; u-
> boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH 3/3] imx: mx6sllevk: add usb support
> 
> On Wed, Dec 21, 2016 at 9:14 AM, Peng Fan <peng.fan at nxp.com> wrote:
> > Add usb support for mx6sllevk board.
> >
[.........]

> > +#define UCTRL_PWR_POL          (1 << 9)
> > +
> > +int board_ehci_hcd_init(int port)
> 
> Can't we do this from driver itself, .probe or somewhere?

This is to handle OTG power polarity, which is board specific.
There is no dts property now, so I add this in board file just like other fsl boards.
When there is an dts property upstreamed in Linux side, we could use that and move this code into driver part.

> 
> > +{
> > +       u32 *usbnc_usb_ctrl;
> > +
> > +       if (port > 1)
> > +               return -EINVAL;
> > +
> > +       usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET
> +
> > +                                port * 4);
> > +
> > +       /* Set Power polarity */
> > +       setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
> > +       return 0;
> > +}
> > diff --git a/configs/mx6sllevk_defconfig b/configs/mx6sllevk_defconfig
> > index 8ae049e..267cdc6 100644
> > --- a/configs/mx6sllevk_defconfig
> > +++ b/configs/mx6sllevk_defconfig
> > @@ -10,6 +10,7 @@ CONFIG_CMD_BOOTZ=y
> >  CONFIG_CMD_MEMTEST=y
> >  CONFIG_CMD_MMC=y
> >  CONFIG_CMD_I2C=y
> > +CONFIG_CMD_USB=y
> >  CONFIG_CMD_GPIO=y
> >  CONFIG_CMD_DHCP=y
> >  CONFIG_CMD_PING=y
> > @@ -34,3 +35,7 @@ CONFIG_DM_REGULATOR=y
> > CONFIG_DM_REGULATOR_PFUZE100=y  CONFIG_DM_REGULATOR_FIXED=y
> > CONFIG_DM_REGULATOR_GPIO=y
> > +CONFIG_USB=y
> > +CONFIG_DM_USB=y
> > +CONFIG_USB_EHCI_HCD=y
> > +CONFIG_USB_STORAGE=y
> > diff --git a/configs/mx6sllevk_plugin_defconfig
> > b/configs/mx6sllevk_plugin_defconfig
> > index e6be979..63d5bbc 100644
> > --- a/configs/mx6sllevk_plugin_defconfig
> > +++ b/configs/mx6sllevk_plugin_defconfig
> > @@ -11,6 +11,7 @@ CONFIG_CMD_BOOTZ=y
> >  CONFIG_CMD_MEMTEST=y
> >  CONFIG_CMD_MMC=y
> >  CONFIG_CMD_I2C=y
> > +CONFIG_CMD_USB=y
> >  CONFIG_CMD_GPIO=y
> >  CONFIG_CMD_DHCP=y
> >  CONFIG_CMD_PING=y
> > @@ -35,3 +36,7 @@ CONFIG_DM_REGULATOR=y
> > CONFIG_DM_REGULATOR_PFUZE100=y  CONFIG_DM_REGULATOR_FIXED=y
> > CONFIG_DM_REGULATOR_GPIO=y
> > +CONFIG_USB=y
> > +CONFIG_DM_USB=y
> > +CONFIG_USB_EHCI_HCD=y
> > +CONFIG_USB_STORAGE=y
> > diff --git a/include/configs/mx6sllevk.h b/include/configs/mx6sllevk.h
> > index b9f25cf..3f665a3 100644
> > --- a/include/configs/mx6sllevk.h
> > +++ b/include/configs/mx6sllevk.h
> > @@ -149,4 +149,13 @@
> >
> >  #define CONFIG_IOMUX_LPSR
> >
> > +/* USB Configs */
> > +#ifdef CONFIG_CMD_USB
> > +#define CONFIG_USB_HOST_ETHER
> > +#define CONFIG_USB_ETHER_ASIX
> > +#define CONFIG_USB_ETHER_RTL8152
> > +#define CONFIG_MXC_USB_PORTSC          (PORT_PTS_UTMI |
> PORT_PTS_PTW)
> > +#define CONFIG_USB_MAX_CONTROLLER_COUNT        2
> 
> I think this is even should managed from driver isn't it?

Thanks for pointing this out. This is not needed by DM USB, I'll remove it in V2.

Thanks,
Peng.

> 
> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream
> Maintainer Hyderabad, India.


More information about the U-Boot mailing list