From patchwork Thu Jul 28 08:21:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Constantine Shulyupin X-Patchwork-Id: 1014702 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6S8MdSA004063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Jul 2011 08:23:02 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6S8LREX031360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Jul 2011 03:21:27 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p6S8LRbK015585; Thu, 28 Jul 2011 03:21:27 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 0325E80627; Thu, 28 Jul 2011 03:21:27 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 2F3FF80626 for ; Thu, 28 Jul 2011 03:21:25 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id p6S8LOja021620 for ; Thu, 28 Jul 2011 03:21:24 -0500 (CDT) Received: from psmtp.com (na3sys009amx214.postini.com [74.125.149.54]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id p6S8LOiU020796 for ; Thu, 28 Jul 2011 03:21:24 -0500 Received: from oproxy8-pub.bluehost.com ([69.89.22.20]) by na3sys009amx214.postini.com ([74.125.148.10]) with SMTP; Thu, 28 Jul 2011 04:21:24 EDT Received: (qmail 27887 invoked by uid 0); 28 Jul 2011 08:21:23 -0000 Received: from unknown (HELO box668.bluehost.com) (66.147.244.168) by oproxy8.bluehost.com with SMTP; 28 Jul 2011 08:21:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=makelinux.com; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=qHjR5mYqI2BdJ2xEoz5dQpthmfw4kbCDWDlYOFcYBok=; b=TcRaraapEt5DA2pM98fBLU+5YmcDmlMRMmW1v7ZRusVcKvTZnUDZDvT+91vIPwqzi4CLw1wqHcnEqHUnXWkVJcaowXsYYUpv6IHqz9QdrJts8x9xhfxH7UU6w4sfDztw; Received: from igld-84-228-138-200.inter.net.il ([84.228.138.200] helo=localhost.localdomain) by box668.bluehost.com with esmtpa (Exim 4.76) (envelope-from ) id 1QmLqN-0005eH-14; Thu, 28 Jul 2011 02:21:23 -0600 From: const@MakeLinux.com To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH] Enable USB on dm365 Date: Thu, 28 Jul 2011 11:21:07 +0300 Message-Id: <1311841267-31932-1-git-send-email-const@MakeLinux.com> X-Mailer: git-send-email 1.7.0.4 X-Identified-User: {1470:box668.bluehost.com:makelinu:makelinux.net} {sentby:smtp auth 84.228.138.200 authed with poster@makelinux.net} X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:85.75748/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [35/1] X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Jul 2011 08:23:12 +0000 (UTC) From: Constantine Shulyupin Signed-off-by: Constantine Shulyupin --- arch/arm/mach-davinci/board-dm365-evm.c | 2 ++ drivers/usb/musb/davinci.c | 6 ++++++ drivers/usb/musb/davinci.h | 1 + 3 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 8710614..c62ca53 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -612,6 +613,7 @@ static __init void dm365_evm_init(void) dm365_init_spi0(BIT(0), dm365_evm_spi_info, ARRAY_SIZE(dm365_evm_spi_info)); + davinci_setup_usb(500, 8); } MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 2a2adf6..905a107 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -72,6 +72,11 @@ static inline void phy_on(void) /* power everything up; start the on-chip PHY and its PLL */ phy_ctrl &= ~(USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN); phy_ctrl |= USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON; + + if (cpu_is_davinci_dm365()) { + phy_ctrl |= USBPHY_CLKFREQ_24MHZ; + } + __raw_writel(phy_ctrl, USB_PHY_CTRL); /* wait for PLL to lock before proceeding */ diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h index 046c844..1bf50e6 100644 --- a/drivers/usb/musb/davinci.h +++ b/drivers/usb/musb/davinci.h @@ -17,6 +17,7 @@ /* Integrated highspeed/otg PHY */ #define USBPHY_CTL_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x34) #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ +#define USBPHY_CLKFREQ_24MHZ BIT(13) #define USBPHY_PHYCLKGD BIT(8) #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ #define USBPHY_VBDTCTEN BIT(6) /* v(bus) comparator */