From patchwork Thu Mar 19 01:19:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6044891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7970F9F399 for ; Thu, 19 Mar 2015 01:29:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C5D52024F for ; Thu, 19 Mar 2015 01:29:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCF94201FA for ; Thu, 19 Mar 2015 01:29:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYPCW-0006sp-Fl; Thu, 19 Mar 2015 01:24:44 +0000 Received: from mail-by2on0101.outbound.protection.outlook.com ([207.46.100.101] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYP96-000509-TT for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2015 01:21:13 +0000 Received: from BY2PR03CA076.namprd03.prod.outlook.com (10.141.249.49) by BY1PR0301MB0855.namprd03.prod.outlook.com (25.160.193.149) with Microsoft SMTP Server (TLS) id 15.1.118.21; Thu, 19 Mar 2015 01:20:49 +0000 Received: from BY2FFO11FD017.protection.gbl (2a01:111:f400:7c0c::125) by BY2PR03CA076.outlook.office365.com (2a01:111:e400:2c5d::49) with Microsoft SMTP Server (TLS) id 15.1.118.21 via Frontend Transport; Thu, 19 Mar 2015 01:20:49 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD017.mail.protection.outlook.com (10.1.14.105) with Microsoft SMTP Server (TLS) id 15.1.125.13 via Frontend Transport; Thu, 19 Mar 2015 01:20:49 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t2J1KGfj031896; Wed, 18 Mar 2015 18:20:46 -0700 From: Peter Chen To: , Subject: [PATCH 09/12] usb: chipidea: usbmisc_imx: add unburst setting for imx6 Date: Thu, 19 Mar 2015 09:19:20 +0800 Message-ID: <1426727963-32280-10-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426727963-32280-1-git-send-email-peter.chen@freescale.com> References: <1426727963-32280-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 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=peter.chen@freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(62966003)(77156002)(50986999)(77096005)(105606002)(50226001)(36756003)(2950100001)(47776003)(19580395003)(19580405001)(6806004)(85426001)(33646002)(86362001)(50466002)(46102003)(92566002)(106466001)(48376002)(87936001)(104016003)(229853001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB0855; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB0855; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BY1PR0301MB0855; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB0855; X-Forefront-PRVS: 052017CAF1 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2015 01:20:49.3083 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150318_182112_975926_01F718AE X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, pawel.moll@arm.com, robh+dt@kernel.org, Peter Chen , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With this setting and AHBBRST at SBUSCFG as "Incremental burst of unspecified length", each unburst size can be taken as one single transfer. It is benefit for unburst size transfer. Signed-off-by: Peter Chen --- drivers/usb/chipidea/usbmisc_imx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index 8af070f..6a6e73c 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -54,6 +54,7 @@ #define MX53_USB_PHYCTRL1_PLLDIV_MASK 0x3 #define MX53_USB_PLL_DIV_24_MHZ 0x01 +#define MX6_BM_UNBURST_SETTING BIT(1) #define MX6_BM_OVER_CUR_DIS BIT(7) #define MX6_BM_WAKEUP_ENABLE BIT(10) #define MX6_BM_ID_WAKEUP BIT(16) @@ -255,14 +256,21 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data) if (data->index > 3) return -EINVAL; + spin_lock_irqsave(&usbmisc->lock, flags); + if (data->disable_oc) { - spin_lock_irqsave(&usbmisc->lock, flags); reg = readl(usbmisc->base + data->index * 4); writel(reg | MX6_BM_OVER_CUR_DIS, usbmisc->base + data->index * 4); - spin_unlock_irqrestore(&usbmisc->lock, flags); } + /* SoC unburst setting */ + reg = readl(usbmisc->base + data->index * 4); + writel(reg | MX6_BM_UNBURST_SETTING, + usbmisc->base + data->index * 4); + + spin_unlock_irqrestore(&usbmisc->lock, flags); + usbmisc_imx6q_set_wakeup(data, false); return 0;