
Adding TI OMAP3 platform specific USB functionality for enabling and disabling of Mentor USB OTG controller module. This functionality will be used by the Mentor USB Host controller driver.
Signed-off-by: Ravi Babu ravibabu@ti.com Signed-off-by: Swaminathan S swami.iyer@ti.com Signed-off-by: Thomas Abraham t-abraham@ti.com Signed-off-by: Ajay Kumar Gupta ajay.gupta@ti.com --- drivers/usb/Makefile | 1 + drivers/usb/omap3530_usb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/omap3530_usb.h | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/omap3530_usb.c create mode 100644 drivers/usb/omap3530_usb.h
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index d93be2b..d256d07 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -34,6 +34,7 @@ COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o +COBJS-$(CONFIG_USB_OMAP3530) += omap3530_usb.o
# device ifdef CONFIG_USB_DEVICE diff --git a/drivers/usb/omap3530_usb.c b/drivers/usb/omap3530_usb.c new file mode 100644 index 0000000..0a1e3bf --- /dev/null +++ b/drivers/usb/omap3530_usb.c @@ -0,0 +1,66 @@ +/* + * TI's OMAP3530 platform specific USB functions. + * + * Copyright (c) 2008 Texas Instruments + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments + */ + +#include <common.h> + +#include "omap3530_usb.h" +#include <asm/arch/cpu.h> +#include <asm/arch/sys_proto.h> +#include <asm/io.h> + +/* MUSB platform configuration */ +struct musb_config musb_cfg = { + (struct musb_regs *)MENTOR_USB0_BASE, + OMAP3530_USB_TIMEOUT, + 0 +}; + +/* MUSB module register overlay */ +struct omap3530_usb_regs *regs; + +/* + * This function performs OMAP3530 platform specific initialization for Mentor + * USB OTG controller. + */ +int musb_platform_init(void) +{ + regs = (struct omap3530_usb_regs *)OMAP3530_USB0_BASE; + /* Disable force standby */ + sr32((void *)®s->forcestdby, 0 , 1 , 0); + /* Set configuration for clock and interface clock to be always on */ + writel(0x1008, ®s->sysconfig); + /* Configure the PHY as PHY interface is 12-pin, 8-bit SDR ULPI */ + sr32((void *)®s->interfsel, 0, 1, 1); + return 0; +} + +/* + * This function performs OMAP3530 platform specific deinitialization for + * Mentor USB OTG controller. + */ +void musb_platform_deinit(void) +{ + /* MUSB soft-reset */ + writel(2, ®s->sysconfig); +} + diff --git a/drivers/usb/omap3530_usb.h b/drivers/usb/omap3530_usb.h new file mode 100644 index 0000000..10bc3e3 --- /dev/null +++ b/drivers/usb/omap3530_usb.h @@ -0,0 +1,49 @@ +/* + * TI's OMAP3530 platform specific USB functions. + * + * Copyright (c) 2008 Texas Instruments + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments + */ + +#ifndef __OMAP3530_MUSB_H__ +#define __OMAP3530_MUSB_H__ + +#include "musb_core.h" + +/* Base address of OMAP3530 usb0 wrapper */ +#define OMAP3530_USB0_BASE 0x480AB400 +/* Base address of OMAP3530 musb core */ +#define MENTOR_USB0_BASE 0x480AB000 +/* Timeout for OMAP3530 USB module */ +#define OMAP3530_USB_TIMEOUT 0x3FFFFFF + +/* + * OMAP3530 platform USB register overlay. + */ +struct omap3530_usb_regs { + u32 revision; + u32 sysconfig; + u32 sysstatus; + u32 interfsel; + u32 simenable; + u32 forcestdby; +}; + +#endif /* __OMAP3530_MUSB_H__ */ +