From: Paul Kocialkowski Date: Sat, 27 Feb 2016 18:19:05 +0000 (+0100) Subject: usb: musb-new: omap2430: OMAP4 MUSB USB controller support X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=27754d18fc1b5a5c6a6e86ababf44b382a6dc7d9;p=u-boot.git usb: musb-new: omap2430: OMAP4 MUSB USB controller support This adds support for the OMAP4 MUSB USB controller, with a matching Linux compat definition, TWL6030 USB device setup and USBOTGHS register setup. Signed-off-by: Paul Kocialkowski --- diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h index 46f83d9b36..1fc9391b8e 100644 --- a/drivers/usb/musb-new/linux-compat.h +++ b/drivers/usb/musb-new/linux-compat.h @@ -37,4 +37,8 @@ #define CONFIG_SOC_OMAP3430 #endif +#ifdef CONFIG_OMAP4430 +#define CONFIG_ARCH_OMAP4 +#endif + #endif /* __LINUX_COMPAT_H__ */ diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index 9f307e991b..684ad9539a 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -23,8 +23,10 @@ #include #else #include +#include #include #include +#include #include "linux-compat.h" #endif @@ -434,6 +436,17 @@ static int omap2430_musb_enable(struct musb *musb) __PRETTY_FUNCTION__); } #endif + +#ifdef CONFIG_TWL6030_POWER + twl6030_usb_device_settings(); +#endif + +#ifdef CONFIG_OMAP4430 + u32 *usbotghs_control = (u32 *)((*ctrl)->control_usbotghs_ctrl); + *usbotghs_control = USBOTGHS_CONTROL_AVALID | + USBOTGHS_CONTROL_VBUSVALID | USBOTGHS_CONTROL_IDDIG; +#endif + return 0; #endif } diff --git a/drivers/usb/musb-new/omap2430.h b/drivers/usb/musb-new/omap2430.h index 56998c794f..0c3dd8bfd9 100644 --- a/drivers/usb/musb-new/omap2430.h +++ b/drivers/usb/musb-new/omap2430.h @@ -50,4 +50,12 @@ #define OTG_FORCESTDBY 0x414 # define ENABLEFORCE (1 << 0) +/* + * OMAP4-specific definitions + */ + +#define USBOTGHS_CONTROL_AVALID (1 << 0) +#define USBOTGHS_CONTROL_VBUSVALID (1 << 2) +#define USBOTGHS_CONTROL_IDDIG (1 << 4) + #endif /* __MUSB_OMAP243X_H__ */