From patchwork Thu Aug 6 14:13:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 6956081 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 84361C05AC for ; Thu, 6 Aug 2015 06:25:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A93BD20673 for ; Thu, 6 Aug 2015 06:25:07 +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 C07742065E for ; Thu, 6 Aug 2015 06:25:06 +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 1ZNEa6-000091-GH; Thu, 06 Aug 2015 06:23:10 +0000 Received: from mail-by2on0112.outbound.protection.outlook.com ([207.46.100.112] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNEa2-0008Vv-SO for linux-arm-kernel@lists.infradead.org; Thu, 06 Aug 2015 06:23:07 +0000 Received: from BY2PR03CA049.namprd03.prod.outlook.com (10.141.249.22) by DM2PR03MB495.namprd03.prod.outlook.com (10.141.85.149) with Microsoft SMTP Server (TLS) id 15.1.231.11; Thu, 6 Aug 2015 06:22:45 +0000 Received: from BN1AFFO11FD029.protection.gbl (2a01:111:f400:7c10::178) by BY2PR03CA049.outlook.office365.com (2a01:111:e400:2c5d::22) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Thu, 6 Aug 2015 06:22:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; pengutronix.de; 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 BN1AFFO11FD029.mail.protection.outlook.com (10.58.52.184) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Thu, 6 Aug 2015 06:22:43 +0000 Received: from anson-OptiPlex-790.ap.freescale.net (anson-OptiPlex-790.ap.freescale.net [10.192.242.118]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t766MctK014807; Wed, 5 Aug 2015 23:22:40 -0700 From: Anson Huang To: , Subject: [PATCH] clk: imx: increase AXI clock rate to 264MHz for i.MX6UL Date: Thu, 6 Aug 2015 22:13:56 +0800 Message-ID: <1438870436-16061-1-git-send-email-b20788@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD029; 1:CgOW86n3T/u/HFbhmIfRFGU1up+A1VXylu3vZ0tCEtnJxya5fv8kSER/E0EtrKR7d9sY/CRT2GPitLW5xYc11Xi8idFhpRRvA8Li7fq3H9tJzvd23YznSHbAOZuZHCrNpebfnQ0c9j7WTsXT9vZcTe7hEeYrfFDQQOKI20iu1DVnwMUvcJlF2f2HKMxfge/MMEetjBkO6BWyfUaVnNvjpx0nStqrYMXj1SBaT728qWdWUQy5Xawg/J/Kt3UPOp9/U364rch+vwkTq9atFfmyUIu8bl+EPkH8NIOJ2KzHqRdpl2vpoBXvskiXpi2WDmNL X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(5003940100001)(47776003)(64706001)(189998001)(50986999)(68736005)(77096005)(92566002)(36756003)(50226001)(62966003)(77156002)(104016003)(229853001)(50466002)(48376002)(19580395003)(19580405001)(6806004)(69596002)(87936001)(85426001)(4001540100001)(81156007)(5001960100002)(5001830100001)(5001860100001)(97736004)(5001770100001)(105606002)(106466001)(33646002)(46102003)(42262002)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB495; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB495; 2:TC8xPuNj/Iwl6FDaERT+Dzfn2p1wsOpG29bqojvI8z6IcpFTec9D/y3HEn6+XGjaobbGSnkkEpchz1y6Nt4qQGSmfGcQ5lMm6Ovkzt4UXpJ1TfCJldy9LfT6FzY9BGzr53L3OUJI/nA846KSxJZDgxklNF1GFZ+DEJicE2uIdcM=; 3:5f6Fyh+vk0kaqHBroDvqf9iuE1BG7O16FBsLFnupm6bYVEgtCbnPteOZpS6NiIHPmtGfBn/iW7esyaLGIV1miABdUWYh2cC3dTHxSqaKr32ot7gJ5eo4b+ADLqPJJ40Rn1I+BfwJtFCnZ6rXdOBkoMKug1+yJ27qYAKGlx3QEQs64D1ut8kyfShaYZ4xBDcgVUthhLbwzx6gBa2eQeJLopMRJiFxW8uJJnZdy0o5ydM=; 25:+5qXUapn5dp+v1+qh9OLysCEAZnOuvnQuaalnGijTnbHA4rz6uvWa2lu9VzKV3iXu/o2rCaF1Rm9HtzkHUMgkRLvO3I0GqZ2fzzyV+1tUdF4zJzGj9WDr/HTKjzgwNNd5V6mc1CX9SDrhy7saZDUn7dQhCBFIC9TeZ1SGPucnJWSq7xyhZS3BJTRW0kls5o9++0tn9Cy4LQQasvbrclVi8AB0DSMzj3fZiOvfdKBCRFdDN09yfWk0BMQZrq3IcSNHsK1xkzBDCsFDyNW+C7Kdg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB495; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB495; 20:+RCHnDXqG6dYJj5VooeFD4/h/KfOaYaq/p0kpx+rbCUBE26BKSLmnZd/dWRP9UVCf/xnCcYeDHlSwoo1yeKo+sjN1gGgwNW9YcO1NLJfWHckg6SF0Q4QhUTs7q+iK4cgKEHkkP15o4i5l4wOVJje/ENsZlwf1wkliY6NuDg2sO3eDIv83EjUufX9PygNgT1zxvEq+Y9+XpuS9qR9mjK/kyoYwigtEO1D+Mn2SLk5Kb9K90XFf+UDYFjUOYz40b9nCnlbX6XO4E2ol/H1RT+UVsGb6QUyjrIDKFbddZnNswFIp53bV7Jd6Oj6sIt3H4jgNayn0cVEDLLUdxwVv4UTqZDLFZJepJuLStGJt3BXJJc=; 4:aKhAicM7i1DcUv08+s6185pn4o9aXW+cjGc/Sl4KD3bf8BLT8BqHxQOSobOPx6OoSB0Nl9j97hSqAVdjWLFCzS/FK3YGe+QpqdXcdlY0gqsMTgCtOoKfqF9Ot5vPKr2U21HTAqkAublYlhj5ZWIBvZc+tcDWiqnA+il9684dol2WDHOIPY4k88Wfq5sSCC7TWwe7Fij/GBmL6fogDhCYt6BkfkdL4P9eM+stwKR+K+zijDUQLTZWwiCBY01hUgtsgOnbCV7I2NH7NyJEQPGVjOfImO2qZU92dzYI/LAfFuE= 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:DM2PR03MB495; BCL:0; PCL:0; RULEID:; SRVR:DM2PR03MB495; X-Forefront-PRVS: 06607E485E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB495; 23:e380z88J1kEC2q6cZ/Jgz9DDQm/bL+r3mATjR1ZPfF?= =?us-ascii?Q?ErM6gybGVzbDnLr3PO3V1M6mLKfzyXwW7g2N8dIOoV2l+ybQCV4QYsnAj8bl?= =?us-ascii?Q?D9QYJ2MQ6IP99GQHE2TBOq0uZUufFvht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4mUWufwKiSy7iAnVEjG51AMSdUUCetPfd5wQI/1c+dL2/RvFThp02OC?= =?us-ascii?Q?oniCDB1Un8n5cPEQZVD87X6g44v1Xm4yjk7rY3pwZKPuBoOQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB495; 5:Anh76ZmoOUxp6xhjdblNI+3sJvxbQ3m3ZxrHP1o64qSTQhR+vHn/Sgr5T5CA3t+cEjDknTaCNv1376pw/qOZA27iy6sizuNKMI4EzW82R9luv54dXQDohwWGe/SVg/jc+YflQ6EkYJSXm8nhaZw9BA==; 24:6bans6vbJZAa8Jac9hkUin1b765+6fvmBiQL/pvRJRVrnAD9BWS920+2t7BrsGygI5XuUoddA3XC+FBMBzDY8jXwfLrkE4PQqJoK59KNhZs=; 20:4x2pbl5Rv5LGVdNfVaK8UBAe8ed2Mp2G5AfONTE6qrDG5kwqjpYaHWllOFADnpOtPFd2QcgalzHJ82SVo5zm6w== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2015 06:22:43.1958 (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: DM2PR03MB495 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150805_232306_971900_16DFDCBB X-CRM114-Status: GOOD ( 14.90 ) X-Spam-Score: 0.0 (/) 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: shawnguo@kernel.org, kernel@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_06_12, 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 On i.MX6UL, AXI clock rate's design target is 264MHz, but by default it is only set to 198MHz which is NOT good enough for performance, this patch increases AXI clock rate from 198MHz to 264MHz to meet the design target, this is done by switching its parent clock "periph" from 396MHz PFD to 528MHz PLL. Signed-off-by: Anson Huang --- drivers/clk/imx/clk-imx6ul.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index aaa3665..01718d0 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -407,6 +407,24 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clk_data.clk_num = ARRAY_SIZE(clks); of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); + /* + * Lower the AHB clock rate before changing the parent clock source, + * as AHB clock rate can NOT be higher than 133MHz, but its parent + * will be switched from 396MHz PFD to 528MHz PLL in order to increase + * AXI clock rate, so we need to lower AHB rate first to make sure at + * any time, AHB rate is <= 133MHz. + */ + clk_set_rate(clks[IMX6UL_CLK_AHB], 99000000); + + /* Change periph_pre clock to pll2_bus to adjust AXI rate to 264MHz */ + clk_set_parent(clks[IMX6UL_CLK_PERIPH_CLK2_SEL], clks[IMX6UL_CLK_PLL3_USB_OTG]); + clk_set_parent(clks[IMX6UL_CLK_PERIPH], clks[IMX6UL_CLK_PERIPH_CLK2]); + clk_set_parent(clks[IMX6UL_CLK_PERIPH_PRE], clks[IMX6UL_CLK_PLL2_BUS]); + clk_set_parent(clks[IMX6UL_CLK_PERIPH], clks[IMX6UL_CLK_PERIPH_PRE]); + + /* Make sure AHB rate is 132MHz */ + clk_set_rate(clks[IMX6UL_CLK_AHB], 132000000); + /* set perclk to from OSC */ clk_set_parent(clks[IMX6UL_CLK_PERCLK_SEL], clks[IMX6UL_CLK_OSC]);