From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Mon, 03 Nov 2014 13:28:55 +0100 Subject: [U-Boot] [PATCH 1/5] imx:mx6sxsabresd add usb support In-Reply-To: <1414808359-4750-2-git-send-email-Peng.Fan@freescale.com> References: <1414808359-4750-1-git-send-email-Peng.Fan@freescale.com> <1414808359-4750-2-git-send-email-Peng.Fan@freescale.com> Message-ID: <54577507.5070509@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Peng, On 01/11/2014 03:19, Peng Fan wrote: > Add usb support for mx6sxsabresd board. > > Signed-off-by: Peng Fan > Signed-off-by: Ye.Li > --- > board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ > include/configs/mx6sxsabresd.h | 14 ++++++++++++++ > 2 files changed, 43 insertions(+) > > diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c > index 256ea29..016b8e8 100644 > --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c > +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c > @@ -296,3 +296,32 @@ int checkboard(void) > > return 0; > } > + > +#ifdef CONFIG_USB_EHCI_MX6 > +iomux_v3_cfg_t const usb_otg1_pads[] = { > + MX6_PAD_GPIO1_IO09__USB_OTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), > + MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID | MUX_PAD_CTRL(NO_PAD_CTRL) > +}; > + > +iomux_v3_cfg_t const usb_otg2_pads[] = { > + MX6_PAD_GPIO1_IO12__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), > +}; > + > +int board_ehci_hcd_init(int port) > +{ > + switch (port) { > + case 0: > + imx_iomux_v3_setup_multiple_pads(usb_otg1_pads, > + ARRAY_SIZE(usb_otg1_pads)); > + break; > + case 1: > + imx_iomux_v3_setup_multiple_pads(usb_otg2_pads, > + ARRAY_SIZE(usb_otg2_pads)); > + break; > + default: > + printf("MXC USB port %d not yet supported\n", port); > + return 1; > + } > + return 0; > +} > +#endif Frankly, I am expecting that this function power up the bus instead of pin multiplexing. If the pins are reserved for USB, why should we set the pinmux each time board_ehci_hcd_init() is called ? And, in any case, pins are not reset after their usage for USB. You can move this setup in board_init() or in another init function. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================