From patchwork Mon Aug 3 04:47:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6927261 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 26B969F39D for ; Mon, 3 Aug 2015 06:01:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 412F120522 for ; Mon, 3 Aug 2015 06:01:20 +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 86068204EC for ; Mon, 3 Aug 2015 06:01:16 +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 1ZM8mD-0000lW-Lb; Mon, 03 Aug 2015 05:59:09 +0000 Received: from mail-by2on0143.outbound.protection.outlook.com ([207.46.100.143] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM8lK-0008QJ-RG for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2015 05:58:17 +0000 Received: from CO2PR03CA0041.namprd03.prod.outlook.com (10.141.194.168) by DM2PR0301MB0861.namprd03.prod.outlook.com (10.160.215.147) with Microsoft SMTP Server (TLS) id 15.1.225.19; Mon, 3 Aug 2015 05:57:53 +0000 Received: from BL2FFO11FD030.protection.gbl (2a01:111:f400:7c09::190) by CO2PR03CA0041.outlook.office365.com (2a01:111:e400:1414::40) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Mon, 3 Aug 2015 05:57:52 +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 BL2FFO11FD030.mail.protection.outlook.com (10.173.161.40) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Mon, 3 Aug 2015 05:57:52 +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 t735vQhe030467; Sun, 2 Aug 2015 22:57:48 -0700 From: Peter Chen To: Subject: [PATCH v2 06/10] usb: chipidea: add ahb burst configuration interface Date: Mon, 3 Aug 2015 12:47:14 +0800 Message-ID: <1438577238-10153-7-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438577238-10153-1-git-send-email-peter.chen@freescale.com> References: <1438577238-10153-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD030; 1:AhPKxkMGdojS3ra5Rfkybbniq2bN3AsHeF0mEVyRXX1vAadDOmqHBafcUy2uaNX0TWrfUPq+jBA0dSNR4p70GaGLayd+TJGqeLORguJi5DongQr3hNFL8E0RiTrhkGQkF3dYoB7Oo17kHMkEz0qjCb6km2nEzqVnnsLmiv1fZObREAOIQvkXG9DHn9TnYmRKSujSyhp115EHhNOleXC+BUnn9wn9O4m+RjPeAOwmRSI1wROhKZczlXmaq+L7TvQIYcmdIgspNo5Dw4KwGSHf8ivt1IRjMRMK12ncOwUXmYOOK/kEXmhP0p89RBMs8gRHQhJTNpECbNIdyrFiBcqIrQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(33646002)(189998001)(46102003)(77156002)(77096005)(36756003)(47776003)(86362001)(50226001)(62966003)(92566002)(105606002)(87936001)(2950100001)(106466001)(76176999)(2351001)(229853001)(5001960100002)(85426001)(104016003)(110136002)(50986999)(107886002)(19580395003)(19580405001)(50466002)(48376002)(6806004)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0861; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 2:/c/DfvyjmgiIP40zB0vetq+N5wuD5WV9humqO3De4dAPQtMRNTkNA5pzFu39rPDSyzDmgzmiYvnzCuG32jx5TV2XtZ1MBNcA18Vm++3jBgfWw4qqe90YtZ7RncelZhrcc/QXQIg1QgeintUbgpZ/N/wLHbjT0oNFfn+v1OPqCtg=; 3:KYMpQIbtB8T72N+tUHU30C6ZC2r0Xdsl/Tz/a+I3FuUNq0gj4uh9ccS0/fv0A/Jp1GNcBqfvJ+FOU7ZZjfoL0nnkoG4iQwPMZnKIkO2xbppi+tlQmuFxZjozGZbbFwOxWPSLc1WN09OJapnDsnsnpEO1eIol5vhmuuG8t6+IsxTz6rY/AqQ9NborEbtODE1NhWYhJ2y2FGf248LSBf0mkGeWzj19aM/9mAymGIS9OHU=; 25:c92b7Cn7mC5TGIJS0eMEdhprAEUok2l3k6XDlrMMdgr1GaNDfDVEaCRor4YqraHm040Wv1XGKqsfKyyVGdOxgIMo+4UusRqa9yLg0WJo2LTW7kFIhD4BWreibrVgHZQarElT5qFd8QvWzXCkKCYkeOpUK2HP+ECZkcxKzMQOdeDr5QyF1myvzjuZUzCDSQJE82XdF/g90/Q24OwZ6mTyu0XkZ6fhE46rkpEeBvi/hJO6iTpcsoXRhIT+xY5Y4vfMqitxMOIOEgdjNDxTnil5Vg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0861; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 20:WvDJnapodiKmPPdaKi0GD+9XEX8/3eDK3syUtLWAf3/VOi0ccNTcCuEUxbz6DpfWRDObRWhgYk5TZuu7buXfvCELwz7dtL4BUK7q8ZwZXhDCaQv5nHKGAY/G4d/lUSi+Th5WYzjWxpSyouAEaBrIu/fpbdFwatTQ1hoxEOhjUAJWRn8nOHm1qGwM1gMdbHn3vMx84IvOG357FUTpFTP9VQ7uKRivvM7JQ65YaR0Pgua82K94v7rTW9kifzwViOXSZUUnBR76xCpDLPptsOUmQMsP1c90AbE4ckoJxaUvMqE70oHdtze7ftfgth9w7Hy8T9O4CEYICw3Dk0xb/fp0bUKx3HFy39qsHCINiuugFTQ=; 4:8dIji6jf8+IPra65bN04wbB3dr/loJ1EifMxT/oclV3nq7yeoLl8BrF1cTUv2zgBotlWWTdeSVJzDv6sx+rOMLGL3F/mv4+xRfRKTmX4Dbf75Rw/5lT4X55T0wFOkQNg3SH6isZXAdvWdDIX+3UljHpVd02Ln94W2yve8YZDdX5Y3dYgABsa2t1Diq7B1M0znmxFeHiMJRfIh3DWKD4WxAP5GJmNc8VVadSpdTce/i5x3PzRZLwEjQCvFwAtiW6wInIoJ7I+/LKCICorOTo8SdyjDxl9JH6SPTCUCuJpZy4= 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: 0657D528EC X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0861; 23:w44lvuMxYofWltmbQPOS+bAQ1TOnIHHjnDkA9ZfpyM56/mvbda7wufH1Nql+NcpLmFVhVYRPTtgQQMTByrDohYB9NEmT4HPe2fB6/P6pOfcR7hs2UtGebEeHfoLeIMklAPMOqwc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r8T83BbGe/yTY=; 20:SFQ3i9DmKm8h3z+YSEMwU4o4Rg801PaZTRb9JtRgsFdvcYAmHQOxpBPi1ktjAO/tWTz9nYEZWa29E7/B6BVs0Q== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2015 05:57:52.0900 (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-20150802_225815_227747_626D058A X-CRM114-Status: GOOD ( 16.50 ) 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, robh+dt@kernel.org, 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.4 required=5.0 tests=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 38bd036..f60cbf6 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -439,6 +439,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); } /** @@ -647,6 +650,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 */