From patchwork Wed Jul 29 02:42:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6889041 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 2843E9F380 for ; Wed, 29 Jul 2015 03:56:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42FAF207B0 for ; Wed, 29 Jul 2015 03:56:15 +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 63DCE207AF for ; Wed, 29 Jul 2015 03:56:14 +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 1ZKIRk-0007YT-80; Wed, 29 Jul 2015 03:54:24 +0000 Received: from mail-by2on0133.outbound.protection.outlook.com ([207.46.100.133] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKIQE-0006B8-Hd for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2015 03:52:51 +0000 Received: from CO2PR03CA0021.namprd03.prod.outlook.com (10.141.194.148) by BY1PR0301MB0854.namprd03.prod.outlook.com (10.160.193.148) with Microsoft SMTP Server (TLS) id 15.1.225.19; Wed, 29 Jul 2015 03:52:28 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:129) by CO2PR03CA0021.outlook.office365.com (2a01:111:e400:1414::20) with Microsoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport; Wed, 29 Jul 2015 03:52:27 +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 BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Wed, 29 Jul 2015 03:52:27 +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 t6T3q5pS011896; Tue, 28 Jul 2015 20:52:24 -0700 From: Peter Chen To: , Subject: [PATCH 06/10] usb: chipidea: add ahb burst configuration interface Date: Wed, 29 Jul 2015 10:42:10 +0800 Message-ID: <1438137734-27311-7-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438137734-27311-1-git-send-email-peter.chen@freescale.com> References: <1438137734-27311-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:46owFw0JlbcTcCR6m0ZPnvpuemrVumvgiVk6s0Hnl7x9MzyIZOJ3NmW+4SfZndP5B17n81fonrcT4+hNipWCT4D85UyBkmbCvzYZYaqAwW+Q0TCYg+X+L52Eev32Xx1j/lIIcnRB+eWCKAUXot1wWBwFPKo9KHHh5MwDPgw/986jHIbpe14t0odoG/dsLk78V3hdAAnCIi1jogSIkA3MfnAOepxdUGnSBpMt6NS6jTWjbHcxR9HkpzKArR2c0F8TrICpxgvfiIuEw1NUyZlrtv95rYlLVTJHTdmSpnTBX0vdqoob5lBvMclpHEil93jdNR4E8hLqJqZvf1ktZIQLPg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(46102003)(189998001)(77156002)(106466001)(50986999)(48376002)(19580395003)(86362001)(47776003)(50466002)(105606002)(229853001)(104016003)(33646002)(87936001)(19580405001)(85426001)(92566002)(50226001)(76176999)(6806004)(77096005)(62966003)(5001920100001)(2950100001)(107886002)(5001960100002)(36756003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB0854; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0854; 2:o3BFBNpPd7/uAnFgw/Dtfv9l6kGfcrWXaH0mBNZ/kLU7sGEo6X07jD8nzfK16Aztx+m+sP8wUeh6vjtgDMcb3E+1YuKFGEObE4KP69NCrbNPvrJx1ohG3lW4thNe0UUGz0Q6S6Zfis9+ci2RvaTqZQ5S7voscmWuHVIr7xKB2BY=; 3:TbsXWFdCn8Jv+Ol//6q0nS7HTUobWBctD0W2RVuoSSToMVy3oaIAtmVnb8qccnCfOElcPJVf1jlu3g2ZhMLiRkN2a2y8Oc7T5p0Hbz9KrtJLfclJUrte0yY633yF2dxDQfme7BrobcMH2Fh2ZjpU5CoQVp/XXCpJA+kbcdiK74WeJ56l5rJJOONLodMS4xsTj75QXlwaS+aaRE4G4+gDRg/TlWbb5a0Q7+AISyBJVq4=; 25:vFPlKxWA11VwLbRoQxU5+dykgYHs1yNldA5gHt4NDwuc9WBWpVh7K0Dv5wc9EO15US7bwgqAsTGHldXAyEdGhlEglgoJ+MIefuTwMbAGl0tpJNQWUF5fdKobFISpzykzyD6zwABPKtwAtr3JxuS+BN69FsJXpL7wmMMzF3roWeZdG4GKlbh4/xzfFvnjjtRYNfn9VSeWHsHFFK6lBGjBy8SV0Pq8FidvE/TXlxXEw8ARMeW/tpY7pGsypcJadDLz2ikPyRMA5bU5afjVyNpJjQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB0854; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0854; 20:CbeBv47vmSmLRNgfp4cgktxDTKA+yxGBt/kbyPFv/QakImXDZeUBXx4Wr/699TmpXydYq5PLLoADznZTAN2ko3jrdHQvqyfOn2zQJj7pFrl1OTZyF/apuB60vsLCjZu2UBBBaOLyQSDWAy1Zn9yaq1k5sH0EgoWYQLAe2c+SDt0OmmbmvFM8sN/ZXkw7A0bJSKwzwIh9BJmvAq1dvFJ29UHGUvV4uR+j1YLIJmGSsnoYDspdTjQfRtHW1yXDKs8BmB1eeYcC0dG9elW1k1IFlnSfSqHEtaHfhk5HJBXgYOLe6yolcTO4c52yF+iWIJlwvGjUv7kDGLVTHA1yOYU/7uEpyF/SOzTOKDLPOBAT33I=; 4:LrdbTNW3SzjnQiRU0PQ8+wES8bvxRKoKXCHJw6khKuxjcQAk/ypDV6Yjyjv7Z3a7uYOx3l0K5/UYDzhU0NaJAAHZTmBMZ59l7k+ynLcoJPJWVgQOQZBfNTZ5kckoJziUQwbFQT3PGdyJrltTYJCaBHZa4zrzYTCTGnCXGh3XYvfSiVg9ux5t4m1JLVe8oMrEdW8VTaQc6QyR1kbFoBH94qEjLmQeSY8KHJKprNzx9bRIyht227htcDsAMCydNnhwaeHBJbKloqsxDCYCsHsGilWQkdB9MjhDMW+HYsWxSes= BY1PR0301MB0854: X-MS-Exchange-Organization-RulesExecuted 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:BY1PR0301MB0854; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB0854; X-Forefront-PRVS: 0652EA5565 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0854; 23:XnWATHdF56DIY0lsth4/cgAI1Q6hCzQB+S+58p9Ecxnav9IJVBt1X5YVSK4nn73zfSSeGMUGndeQzO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1PxsCfh0Q08qXLYOA3DujbSeBqBXnY0AutfOQ/ToUPp7Qv7m4gXDgK4DjFA7s77V+uKUI8JCJcBSAg=; 20:ne1YF82EByy2vf7ZfNhKONd4+RpJz6werB0arFTesd+Qbi5pG+0vZxYIxmANIxUB8dnx5yB8auHPwM4GN7I5gQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2015 03:52:27.9948 (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: BY1PR0301MB0854 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150728_205250_683895_E02AF02B X-CRM114-Status: GOOD ( 16.78 ) 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, pawel.moll@arm.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=-5.6 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 982f8cc..9848a4e 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_DISABLE_HOST_STREAMING BIT(10) #define CI_HDRC_DISABLE_STREAMING (CI_HDRC_DISABLE_DEVICE_STREAMING | \ CI_HDRC_DISABLE_HOST_STREAMING) +#define CI_HDRC_OVERRIDE_AHB_BURST BIT(11) 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 */