[U-Boot] [PATCH v2 1/3] usb:ehci-mx6 add board_ehci_usb_mode function

Marek Vasut marex at denx.de
Fri Nov 7 09:26:32 CET 2014


On Friday, November 07, 2014 at 02:10:28 AM, Peng Fan wrote:
[...]
> >> In board/freescale/mx6sxsabresd/mx6sxsabresd.c:
> >> 295 int board_usb_phy_mode(int port)
> >> 296 {
> >> 297         void __iomem *phy_reg;
> >> 298         void __iomem *phy_ctrl;
> >> 299         u32 val;
> >> 300
> >> 301         switch (port) {
> >> 302         case 0:
> >> 303                 phy_reg = (void __iomem *)USB_PHY0_BASE_ADDR;
> >> 304                 phy_ctrl = (void __iomem *)(phy_reg + USBPHY_CTRL);
> >> 305                 val = __raw_readl(phy_ctrl);
> >> 306                 return val & USBPHY_CTRL_OTG_ID;
> >> 307         case 1:
> >> 308                 /* Work in HOST mode. */
> >> 309                 return 0;
> >> 310         }
> >> 311
> >> 312         /* suppress warning msg */
> >> 313         return 0;
> >> 314 }
> >> 
> >> Is this piece of code fine?
> > 
> > These ad-hoc hooks are starting to become absolute horror, but I guess
> > this one (if properly documented) might just work. Let's see what will
> > come out of this approach.
> 
> Sent out v3 patch set just now. Please review.

Done, there're only minor comments.

Thanks!

Best regards,
Marek Vasut


More information about the U-Boot mailing list