Hi Marek, > -----Original Message----- > From: Marek Vasut [mailto:ma...@denx.de] > Sent: Thursday, December 22, 2016 12:40 PM > To: Peng Fan <peng....@nxp.com>; sba...@denx.de > Cc: u-boot@lists.denx.de; van.free...@gmail.com > Subject: Re: [PATCH 3/3] imx: mx6sllevk: add usb support > > On 12/22/2016 02:13 AM, Peng Fan wrote: > > > > > >> -----Original Message----- > >> From: Marek Vasut [mailto:ma...@denx.de] > >> Sent: Wednesday, December 21, 2016 10:10 PM > >> To: Peng Fan <peng....@nxp.com>; sba...@denx.de > >> Cc: u-boot@lists.denx.de; van.free...@gmail.com > >> Subject: Re: [PATCH 3/3] imx: mx6sllevk: add usb support > >> > >> On 12/21/2016 09:14 AM, Peng Fan wrote: > >>> Add usb support for mx6sllevk board. > >>> > >>> Signed-off-by: Peng Fan <peng....@nxp.com> > >>> Cc: Stefano Babic <sba...@denx.de> > >>> --- > > [......] > > > >>> + > >>> +#define USB_OTHERREGS_OFFSET 0x800 > >>> +#define UCTRL_PWR_POL (1 << 9) > >>> + > >>> +int board_ehci_hcd_init(int port) > >>> +{ > >>> + 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; > >>> +} > >> > >> Is this function similar to what usb_oc_config() does ? > > > > No, this bit is not for overcurrent. According to RM, this is OTG > > Power Polarity This bit should be set according to power switch's enable > polarity. > > 1 Power switch has an active-high enable input > > 0 Power switch has an active-low enable input > > > > This is board specific. > > Great, except it should also be part of the driver , the same way as polarity > is > configured, yes ?
I just found that there is code for mx7, http://lists.denx.de/pipermail/u-boot/2016-July/260321.html Then do you agree I add such piece code in usb_power_config for mx6? " #ifdef CONFIG_MXC_USB_OTG_HACTIVE setbits_le32(ctrl, UCTRL_PWR_POL); #else clrbits_le32(ctrl, UCTRL_PWR_POL); #endif " Thanks, Peng > > > -- > Best regards, > Marek Vasut _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot