From patchwork Tue Nov 4 07:50:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 406458 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3AF28140079 for ; Tue, 4 Nov 2014 18:50:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 479214B8F8; Tue, 4 Nov 2014 08:49:56 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b6nZkZ9D0BRW; Tue, 4 Nov 2014 08:49:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48B434B901; Tue, 4 Nov 2014 08:49:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 82ED44B8D1 for ; Tue, 4 Nov 2014 08:49:44 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BeyLdnr5Vd3Z for ; Tue, 4 Nov 2014 08:49:44 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0144.outbound.protection.outlook.com [157.56.110.144]) by theia.denx.de (Postfix) with ESMTPS id 017274B8CF for ; Tue, 4 Nov 2014 08:49:39 +0100 (CET) Received: from BY2PR03CA008.namprd03.prod.outlook.com (10.255.93.25) by BLUPR03MB245.namprd03.prod.outlook.com (10.255.213.13) with Microsoft SMTP Server (TLS) id 15.1.11.14; Tue, 4 Nov 2014 07:49:33 +0000 Received: from BN1AFFO11FD007.protection.gbl (10.255.93.4) by BY2PR03CA008.outlook.office365.com (10.255.93.25) with Microsoft SMTP Server (TLS) id 15.1.11.14 via Frontend Transport; Tue, 4 Nov 2014 07:49:32 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Tue, 4 Nov 2014 07:49:31 +0000 Received: from linux-vaa1.ap.freescale.net (linux-vaa1.ap.freescale.net [10.193.102.217]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sA47nPHe031168; Tue, 4 Nov 2014 00:49:29 -0700 From: Peng Fan To: Date: Tue, 4 Nov 2014 15:50:00 +0800 Message-ID: <1415087402-26007-2-git-send-email-Peng.Fan@freescale.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1415087402-26007-1-git-send-email-Peng.Fan@freescale.com> References: <1415087402-26007-1-git-send-email-Peng.Fan@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(6806004)(97736003)(44976005)(84676001)(4396001)(50226001)(26826002)(50466002)(47776003)(104166001)(20776003)(21056001)(110136001)(102836001)(50986999)(120916001)(89996001)(64706001)(86362001)(575784001)(95666004)(36756003)(229853001)(106466001)(31966008)(99396003)(87286001)(92566001)(2351001)(105606002)(92726001)(107046002)(104016003)(76176999)(77156002)(62966003)(88136002)(46102003)(68736004)(93916002)(19580405001)(87936001)(48376002)(19580395003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB245; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB245; X-Exchange-Antispam-Report-Test: UriScan:; X-Forefront-PRVS: 03853D523D Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Peng.Fan@freescale.com; X-OriginatorOrg: freescale.com Cc: fabio.estevam@freescale.com, marex@denx.de, u-boot@lists.denx.de, B37916@freescale.com Subject: [U-Boot] [PATCH v2 1/3] usb:ehci-mx6 add board_ehci_usb_mode function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Include a weak function board_ehci_usb_mode to gives board code a choice. If the board want the otg port work in host mode but not device mode, this should be handled. Signed-off-by: Peng Fan Signed-off-by: Ye Li --- Changes v2: Introduce a new weak function to let board have a choice to decide which mode to work at. drivers/usb/host/ehci-mx6.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 9ec5a0a..3662a80 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -193,6 +193,11 @@ static void usb_oc_config(int index) __raw_writel(val, ctrl); } +int __weak board_ehci_usb_mode(int index, enum usb_init_type *type) +{ + return 0; +} + int __weak board_ehci_hcd_init(int port) { return 0; @@ -223,6 +228,8 @@ int ehci_hcd_init(int index, enum usb_init_type init, usb_internal_phy_clock_gate(index, 1); type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE : USB_INIT_HOST; + board_ehci_usb_mode(index, &type); + *hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength); *hcor = (struct ehci_hcor *)((uint32_t)*hccr + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));