From patchwork Wed Aug 18 23:49:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Munegowda, Keshava" X-Patchwork-Id: 120346 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7JBnJKf028188 for ; Thu, 19 Aug 2010 11:49:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752915Ab0HSLtO (ORCPT ); Thu, 19 Aug 2010 07:49:14 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:35901 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752901Ab0HSLtM (ORCPT ); Thu, 19 Aug 2010 07:49:12 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o7JBnCDB005198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Aug 2010 06:49:12 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o7JBn91p012124; Thu, 19 Aug 2010 06:49:09 -0500 (CDT) Received: from localhost (a0393220-desktop.apr.dhcp.ti.com [172.24.137.6]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o7JBn7f15377; Thu, 19 Aug 2010 06:49:07 -0500 (CDT) From: Keshava Munegowda To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Cc: Keshava Munegowda , Anand Gadiyar Subject: [RFC] [PATCH 4/7] omap: usb: ehci: IO mux mode settings for omap4 Date: Thu, 19 Aug 2010 05:19:34 +0530 Message-Id: <1282175377-2784-5-git-send-email-keshava_mgowda@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1282175377-2784-4-git-send-email-keshava_mgowda@ti.com> References: <1282175377-2784-1-git-send-email-keshava_mgowda@ti.com> <1282175377-2784-2-git-send-email-keshava_mgowda@ti.com> <1282175377-2784-3-git-send-email-keshava_mgowda@ti.com> <1282175377-2784-4-git-send-email-keshava_mgowda@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 19 Aug 2010 11:49:19 +0000 (UTC) Index: linux-2.6/arch/arm/mach-omap2/usb-ehci.c =================================================================== --- linux-2.6.orig/arch/arm/mach-omap2/usb-ehci.c +++ linux-2.6/arch/arm/mach-omap2/usb-ehci.c @@ -214,6 +214,115 @@ static void setup_ehci_io_mux(const enum return; } +static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode) +{ + /* + * FIXME: This funtion should use mux framework functions; + * For now, we are hardcoding this. + */ + switch (port_mode[0]) { + case EHCI_HCD_OMAP_MODE_PHY: + + /* HUSB1_PHY CLK , INPUT ENABLED, PULLDOWN */ + omap_writew(0x010C, 0x4A1000C2); + + /* HUSB1 STP */ + omap_writew(0x0004, 0x4A1000C4); + + /* HUSB1_DIR */ + omap_writew(0x010C, 0x4A1000C6); + + /* HUSB1_NXT */ + omap_writew(0x010C, 0x4A1000C8); + + /* HUSB1_DATA0 */ + omap_writew(0x010C, 0x4A1000CA); + + /* HUSB1_DATA1 */ + omap_writew(0x010C, 0x4A1000CC); + + /* HUSB1_DATA2 */ + omap_writew(0x010C, 0x4A1000CE); + + /* HUSB1_DATA3 */ + omap_writew(0x010C, 0x4A1000D0); + + /* HUSB1_DATA4 */ + omap_writew(0x010C, 0x4A1000D2); + + /* HUSB1_DATA5 */ + omap_writew(0x010C, 0x4A1000D4); + + /* HUSB1_DATA6 */ + omap_writew(0x010C, 0x4A1000D6); + + /* HUSB1_DATA7 */ + omap_writew(0x010C, 0x4A1000D8); + + break; + + case EHCI_HCD_OMAP_MODE_TLL: + /* TODO */ + + break; + case EHCI_HCD_OMAP_MODE_UNKNOWN: + /* FALLTHROUGH */ + default: + break; + } + + switch (port_mode[1]) { + case EHCI_HCD_OMAP_MODE_PHY: + /* HUSB2_PHY CLK , INPUT PULLDOWN ENABLED */ + omap_writew(0x010C, 0x4A100160); + + /* HUSB2 STP */ + omap_writew(0x0002, 0x4A100162); + + /* HUSB2_DIR */ + omap_writew(0x010A, 0x4A100164); + + /* HUSB2_NXT */ + omap_writew(0x010A, 0x4A100166); + + /* HUSB2_DATA0 */ + omap_writew(0x010A, 0x4A100168); + + /* HUSB2_DATA1 */ + omap_writew(0x010A, 0x4A10016A); + + /* HUSB2_DATA2 */ + omap_writew(0x010A, 0x4A10016C); + + /* HUSB2_DATA3 */ + omap_writew(0x010A, 0x4A10016E); + + /* HUSB2_DATA4 */ + omap_writew(0x010A, 0x4A100170); + + /* HUSB2_DATA5 */ + omap_writew(0x010A, 0x4A100172); + + /* HUSB2_DATA6 */ + omap_writew(0x010A, 0x4A100174); + + /* HUSB2_DATA7 */ + omap_writew(0x010A, 0x4A100176); + + break; + + case EHCI_HCD_OMAP_MODE_TLL: + /* TODO */ + + break; + case EHCI_HCD_OMAP_MODE_UNKNOWN: + /* FALLTHROUGH */ + default: + break; + } + return; +} + void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata) { platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));