From patchwork Fri Aug 7 07:15:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6966531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BDF9BC05AC for ; Fri, 7 Aug 2015 08:31:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6E4B20658 for ; Fri, 7 Aug 2015 08:31:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E84F420657 for ; Fri, 7 Aug 2015 08:31:03 +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 1ZNd0Y-0004PP-Rn; Fri, 07 Aug 2015 08:28:06 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNczW-0003iJ-Cj for linux-arm-kernel@bombadil.infradead.org; Fri, 07 Aug 2015 08:27:02 +0000 Received: from mail-bl2on0130.outbound.protection.outlook.com ([65.55.169.130] helo=na01-bl2-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZNczU-0005Ds-Pd for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 08:27:01 +0000 Received: from BN3PR0301CA0071.namprd03.prod.outlook.com (10.160.152.167) by DM2PR0301MB0861.namprd03.prod.outlook.com (10.160.215.147) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 7 Aug 2015 08:26:36 +0000 Received: from BN1BFFO11FD021.protection.gbl (2a01:111:f400:7c10::1:115) by BN3PR0301CA0071.outlook.office365.com (2a01:111:e400:401e::39) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Fri, 7 Aug 2015 08:26:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD021.mail.protection.outlook.com (10.58.144.84) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Fri, 7 Aug 2015 08:26:36 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t778Q8l7019852; Fri, 7 Aug 2015 01:26:32 -0700 From: Peter Chen To: , Subject: [PATCH v3 06/10] usb: chipidea: add ahb burst configuration interface Date: Fri, 7 Aug 2015 15:15:43 +0800 Message-ID: <1438931747-25209-7-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438931747-25209-1-git-send-email-peter.chen@freescale.com> References: <1438931747-25209-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD021; 1:fp1ZunoqJ1ShvFDTeOMaUYWyFmHFfct0EdbWwsrPP9lSzGain7wtwm7WgY05oMpD8+pDzLN1zFZKaWakKQ66HqBDRA9dgV5Bxc/JVlpwIM55vQTW1Wt8fm203d+F66f6WKs3Dh3Fp1jNj4zBkyrhY49uyDMduDDi/dGZlsPYqiyspOVOKkid0eP8c6Lk9T5gflYvWOVvn5ewsfsGDA3S+kFPoFKL8r5/jdNQICh/Zi6dWrpiOxHKXNTXkP0OarA8meIoXKHmFrhNlvISD1Af181i+2ngIcH/UUerVWQ7A+/Ke2gZ5SJmfOMjf+21BHCpxvMPGgPgZ6b+3ovHvSZ07g== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(6806004)(46102003)(47776003)(4001540100001)(5001860100001)(5001770100001)(5001830100001)(97736004)(36756003)(64706001)(106466001)(86362001)(19580405001)(81156007)(19580395003)(77156002)(85426001)(62966003)(68736005)(77096005)(105606002)(50986999)(76176999)(87936001)(189998001)(69596002)(2950100001)(107886002)(229853001)(5001960100002)(5001920100001)(92566002)(48376002)(50466002)(5003940100001)(104016003)(33646002)(50226001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0861; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 2:xeir5plce9B1M8dwOE38RcpMjpwYx8skB/LeXOCYrIMGEnVjakqHQYkqzKb5ymAgf2TW+BUw4z19UGYOfEJ/vTjaWbuZwtMmJmLbNBMQ/gTbT9sUyZ5GcxnIjNtvID7p+NNBRaeDmBcmzlvgU3CrwGlfMKSSuovvCPehytBQJRs=; 3:fonyE7+KgUgy1KhqGfRdYnqqR06GQbx06TNpGh318qLwql6BEG/DKzT61tW33AKxv3hSZfYL1s+6eez2xojaafh3LXVF3/zHw3buzrMpFVrsEaUNat7IKCq/cCypSnROgsTMy5s7DrB8FXyw70kuwWUoqXE8De3VeJGv/6EaqvctCYg5n5IOH44t/vARZibni6tETo+iWla6/NZ1097iqofvOK+arzj8gMzZKekYdb8=; 25:aTmpsxbbtFULQy2m0bN2cvEifcd2QKDTW3GIpej/LSbqIVVXKXQX3iHyIdlJ8IsyBPHPOj+DA1hcma6ZB52XyrhzCcULwBgW6FwquKj1uYBNNL7w1/xOPy1QSDQgUNrMm5if4Xk8OWCIV5VoCsrBuxk3WXKyesL70KpoyFp87e93dEcOHSjkPtnOjUXM2GhFmFp9ypFtO03Z/EPDl9KwRVuj/vFGVfCkcj/LqNY76qLmkpMiuDrKhM7i2R6/rEhekdyoXQf36Phte4Sx+DmdFA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0861; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 20:TvahvEqu/ELYfbHEK8s4lKYoS4oB/jiwCzH6joNzb6RhZvcMJlp2gjrEfCcSoEm1wr5gxSUzabD4SeMttGm9W0ll3bh/nW6yASYSR4ZX737pXTt0fhkG1JpGy8zd/efFFs3SlHcSOiFMbwNJa9v4jxO3jHdQm+P9fo0UZLKPL4iKaIn9zFG6KnyAMh6HZPYAxcPYAqUIJw4H9vydAh30h4lrI7yA0lUTqESTVh1vGZvRGBbrDR67vIRWj08lk4HZDtUMq66oH8L7L8OsGxukQp120pEt7EypgypceAdVFCK/pts99Vhl1t8nZT/oSMXK+jL2DqlsIGyp10gb+5p7J8gYFJHrzVvZZeC4GKh8JV4=; 4:Ga5yzOdiESEY1eepY78dq2UzmqVD93NswFoQVgVnAF2jec5ICjHnMhHNKQqiQKxA5BDHmLdmo2AYzD1kEANA3A5mUKYxRt29fkry/dldh4jdb+n/RzOvNUAmRLgDnI15YdFrQlmqaJqB9JU7ObjH9Ce9aYQl9fHmqcl/H5Dhg/hNSFeKfWnbh2n4KifHu/dvZ/iD+/VIpIT6sw29AlycGSHMK1F0K/Qlq8szMZjfFQA+bwN4jiGxhwUAJ5WjoXGkcfmGTiQW9Xf9oMqG+b3BwAjEZryYUJ1GTt0Sr3ogKqY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR0301MB0861; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0861; X-Forefront-PRVS: 066153096A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0861; 23:BcZEc8iA9SFG7U5J0CkqmoTkp2nuVtawe6lkV25?= =?us-ascii?Q?3nzhAKkE6Oz1R1f5W9L/8KxJKGyMCmNnBOCrjAs0zE+AppUFTHgswkxfonRs?= =?us-ascii?Q?JrPGM5W/tAsT0KZtg1dsfD/N3Uawh552YHo6FcipyrQs7QJgZa9xWpEjgI3D?= =?us-ascii?Q?T3wuCM+TDhAJ3FmmKnCefFj8dQ2Xrk5QE+Xum9FWssMd8igbMiyukWkA9h0K?= =?us-ascii?Q?NMT3YI6c1r0k+Kp4VeLbNcOY2bE4YJE2io3vMcVI5wEOPrVcxROh7qqQWf7m?= =?us-ascii?Q?vBAObEHErN0ctfWX6edWgdQPHcpPjrxT9YeAUoqYh1oNNa1APhm9i2VlD+U/?= =?us-ascii?Q?Zm8+00YS3SNsCY6+6VNMT2vSZCGoHbuqoZzBIXgfTZV9F9rvwieTqKlCkOQG?= =?us-ascii?Q?arXBtI/RA37uJPchQWP5g2q92HH4xl4q5e+SECUhhnDYbScJ7wVyD4LfIbKr?= =?us-ascii?Q?HZrOGNj8t23RkFBmwBXfgaHrggGXEeDSAj/DEoTGttclUJhroBL0rQktKUgW?= =?us-ascii?Q?m7dHrNby70GZzGh+8pnTQ3y9La8veVpDVlL1GJDQapZ/3pp6+7HKeyyttkzM?= =?us-ascii?Q?Or5yIPD7cxLhaHTs5dAYhgBWAn/EF9bkR5W926/dfxraXpoZYrJx8EqDzwWi?= =?us-ascii?Q?GQb7kks73VYjtuIz28Ex9/l/6x5v0RtkHciOUvUfkzzhosHX5DhPXkxZICxE?= =?us-ascii?Q?g676eUHQiykAs7N+4BSK6YARx24cNK/xyS6WTbfeYuVl8X68DQVjZlcM/T0Q?= =?us-ascii?Q?qev1nqHMZqMQfLgN4Ul/gICAELcWAnBlOPjnq9qbBGltKiL0n8nllW16iDC7?= =?us-ascii?Q?/jxkQqSDf6kPuKXNUWWnGZ7XQ9RfGWn/9sqK45JhcdtMpzgmAD7EebVKfKiW?= =?us-ascii?Q?oVvjTNKB2wm2AZbGKF6EhZEenyBl46AKvruX5ZjBMWTZ725ZkNzYH1hc/DCr?= =?us-ascii?Q?A60+RonqPzr7qt6oJilPvc1MDNBnrO3SZdKFSKyGVwCLgrfVfllxqrPjO88J?= =?us-ascii?Q?YmSygabeD7UoXeyZfAgjhSTlGzncparxKgvMgQH3tcrDysifHcluotoUq/bl?= =?us-ascii?Q?OV5ZLhPnA96B7rBrot8kVCs74nGx43NucZQ/s5oyIsyLeU8AkFPLyLP6fFN8?= =?us-ascii?Q?YuDMO5P0PGnFuAk0V8hppybUk9+wMcTWYNsHEVRY1a3wKYdmYo+EQUwPobJ0?= =?us-ascii?Q?Twn8EjgjJ4mBSmTE=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 5:uK11RrIADsfDwdDvuHGLePbGIxG+jPE4wAv5mD8wd4m89N1us8Yqbw7EFxEbJkCYSJin6k3fHNFsyMGfiffjGD7qmM6dD4TqzxxTCuk8KNy+Zoxd1ovqNAUWCwxyycAOcuUblCcfLuYmOUDltAti+w==; 24:OI4kMNu7e6b6/bU8wOxNevURR4YBiPwBywti65VED8RqxvLJeuQmO1acdo30fLb8UgK0wULr+NcoZiru/uyQujtYZoI3q5NsbPFJvFy7HEU=; 20:J/TBYH4oBRSmAa53YBLfhPZ/gVq6IovqE1f++6rrsPMYLRYLPJjduBCWb9vc2aQFXPxnmo39EtV4HbW4+1wPEA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2015 08:26:36.2256 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0861 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150807_042701_057546_52771F64 X-CRM114-Status: GOOD ( 17.17 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, pawel.moll@arm.com, gregkh@linuxfoundation.org, s.hauer@pengutronix.de, jun.li@freescale.com, Peter Chen , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org 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.3 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 The users can change it through dts or platform data if they want to change the default value. Signed-off-by: Peter Chen --- drivers/usb/chipidea/bits.h | 3 +++ drivers/usb/chipidea/core.c | 14 ++++++++++++++ include/linux/usb/chipidea.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h index 831a8f6..462ad02 100644 --- a/drivers/usb/chipidea/bits.h +++ b/drivers/usb/chipidea/bits.h @@ -25,6 +25,9 @@ #define VERSION (0xF << 25) #define CIVERSION (0x7 << 29) +/* SBUSCFG */ +#define AHBBRST_MASK 0x7 + /* HCCPARAMS */ #define HCCPARAMS_LEN BIT(17) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 97f937f..bde49f3 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -438,6 +438,9 @@ void ci_platform_configure(struct ci_hdrc *ci) hw_write(ci, OP_USBCMD, 0xff0000, ci->platdata->itc_setting << 16); + if (ci->platdata->flags & CI_HDRC_OVERRIDE_AHB_BURST) + hw_write_id_reg(ci, ID_SBUSCFG, AHBBRST_MASK, + ci->platdata->ahb_burst_config); } /** @@ -646,6 +649,17 @@ static int ci_get_platdata(struct device *dev, } } + if (of_find_property(dev->of_node, "ahb-burst-config", NULL)) { + ret = of_property_read_u32(dev->of_node, "ahb-burst-config", + &platdata->ahb_burst_config); + if (ret) { + dev_err(dev, + "failed to get ahb-burst-config\n"); + return ret; + } + platdata->flags |= CI_HDRC_OVERRIDE_AHB_BURST; + } + return 0; } diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 034f7e1..fe3c8eb 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -33,6 +33,7 @@ struct ci_hdrc_platform_data { #define CI_HDRC_FORCE_FULLSPEED BIT(6) #define CI_HDRC_TURN_VBUS_EARLY_ON BIT(7) #define CI_HDRC_SET_NON_ZERO_TTHA BIT(8) +#define CI_HDRC_OVERRIDE_AHB_BURST BIT(9) enum usb_dr_mode dr_mode; #define CI_HDRC_CONTROLLER_RESET_EVENT 0 #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 @@ -42,6 +43,7 @@ struct ci_hdrc_platform_data { bool tpl_support; /* interrupt threshold setting */ u32 itc_setting; + u32 ahb_burst_config; }; /* Default offset of capability registers */