From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Grinberg Date: Mon, 06 Feb 2012 14:03:41 +0200 Subject: [U-Boot] [PATCH v3 5/7] OMAP3+: ehci-omap: enable usb host ports for beagle/panda In-Reply-To: <1328276312-30153-6-git-send-email-govindraj.raja@ti.com> References: <1328276312-30153-1-git-send-email-govindraj.raja@ti.com> <1328276312-30153-6-git-send-email-govindraj.raja@ti.com> Message-ID: <4F2FC19D.1020100@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/03/12 15:38, Govindraj.R wrote: > From: "Govindraj.R" > > For beagle and panda enable and use the ehci-omap.c generic > api's added to configure usb host ports based on data passed > from board file to configure in modes as specified from board data. > For panda initialise the mux pins for ehci usage. > > Signed-off-by: Govindraj.R Last neats and Acked-by: Igor Grinberg > --- > board/ti/beagle/beagle.c | 28 ++++++++++++++++++++++++++ > board/ti/panda/panda.c | 41 +++++++++++++++++++++++++++++++++++++++ > board/ti/panda/panda_mux_data.h | 16 +++++++------- > include/configs/omap4_panda.h | 23 ++++++++++++++++++++- > 4 files changed, 99 insertions(+), 9 deletions(-) > > diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c > index 98548ab..5031cf2 100644 > --- a/board/ti/beagle/beagle.c > +++ b/board/ti/beagle/beagle.c > @@ -45,6 +45,11 @@ > #include "beagle.h" > #include > > +#ifdef CONFIG_USB_EHCI > +#include > +#include > +#endif > + > #define pr_debug(fmt, args...) debug(fmt, ##args) > > #define TWL4030_I2C_BUS 0 > @@ -442,6 +447,29 @@ void show_boot_progress(int val) > if(val == 15) > usb_stop(); > } > + > +static struct omap_usbhs_board_data usbhs_bdata = { > + .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, > + .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, > + .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED > +}; > + > +int ehci_hcd_init(void) > +{ > + int ret = 0; > + > + ret = omap_ehci_hcd_init(&usbhs_bdata); > + return ret; > +} just: return omap_ehci_hcd_init(&usbhs_bdata); > + > +int ehci_hcd_stop(void) > +{ > + int ret; > + > + ret = omap_ehci_hcd_stop(); > + return ret; > +} same here: return omap_ehci_hcd_stop(); > + > #endif /* CONFIG_USB_EHCI */ > > #ifndef CONFIG_SPL_BUILD > diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c > index fc8c0b4..1f8509b 100644 > --- a/board/ti/panda/panda.c > +++ b/board/ti/panda/panda.c > @@ -26,9 +26,16 @@ > #include > #include > #include > +#include > > #include "panda_mux_data.h" > > +#ifdef CONFIG_USB_EHCI > +#include > +#include > +#include > +#endif > + > #define PANDA_ULPI_PHY_TYPE_GPIO 182 > > DECLARE_GLOBAL_DATA_PTR; > @@ -177,6 +184,40 @@ int board_mmc_init(bd_t *bis) > } > #endif > > +#ifdef CONFIG_USB_EHCI > + > +static struct omap_usbhs_board_data usbhs_bdata = { > + .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, > + .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, > + .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, > +}; > + > +int ehci_hcd_init(void) > +{ > + int ret; > + unsigned int utmi_clk; > + > + /* Now we can enable our port clocks */ > + utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL); > + utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK; > + sr32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, 0, 32, utmi_clk); > + > + ret = omap_ehci_hcd_init(&usbhs_bdata); > + if (ret < 0) > + return ret; > + > + return 0; return omap_ehci_hcd_init(&usbhs_bdata); ? > +} > + > +int ehci_hcd_stop(void) > +{ > + int ret; > + > + ret = omap_ehci_hcd_stop(); > + return ret; return omap_ehci_hcd_stop(); > +} > +#endif [...] -- Regards, Igor.