From patchwork Wed Apr 20 09:34:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8887681 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 6F6F79F1D3 for ; Wed, 20 Apr 2016 09:46:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 807DF2017D for ; Wed, 20 Apr 2016 09:45:59 +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 DF3112024C for ; Wed, 20 Apr 2016 09:45:56 +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 1asofj-0006tg-7s; Wed, 20 Apr 2016 09:43:47 +0000 Received: from mail-by2on0069.outbound.protection.outlook.com ([207.46.100.69] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1asoen-0005Zu-E1 for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2016 09:42:51 +0000 Received: from BLUPR0301CA0020.namprd03.prod.outlook.com (10.162.113.158) by BY2PR0301MB0709.namprd03.prod.outlook.com (10.160.63.151) with Microsoft SMTP Server (TLS) id 15.1.453.26; Wed, 20 Apr 2016 09:42:28 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::118) by BLUPR0301CA0020.outlook.office365.com (2a01:111:e400:5259::30) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Wed, 20 Apr 2016 09:42:27 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Wed, 20 Apr 2016 09:42:27 +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 u3K9g0iX016915; Wed, 20 Apr 2016 02:42:24 -0700 From: Dong Aisheng To: Subject: [RESEND PATCH 8/8] clk: imx7d: only enable minimum required clocks Date: Wed, 20 Apr 2016 17:34:40 +0800 Message-ID: <1461144880-8724-9-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461144880-8724-1-git-send-email-aisheng.dong@nxp.com> References: <1461144880-8724-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131056189475488082; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(4326007)(50466002)(2950100001)(11100500001)(19580405001)(104016004)(19580395003)(50986999)(5008740100001)(6806005)(76176999)(586003)(1220700001)(1096002)(36756003)(86362001)(48376002)(87936001)(77096005)(110136002)(105606002)(189998001)(33646002)(50226001)(106466001)(5003940100001)(92566002)(229853001)(81166005)(2351001)(85426001)(2906002)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0709; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD014; 1:n5T0nlHYGywJm8vKY7ocrmlDn5pYXsKpNUi1Nk8tqP2n4Umh4dLP5a6hTWWx/VUA6NXMIm0WJQEwwZaGzUYWLXOCNgnhDcWSt+Cr01LwyORuLTKVS+/hjl1Tf1vlY0fBGcR9uLUEMO7CbVwik+RPsH8DmLQABrJIPsQ64ndU5ZY2RJMUZnV9FEtAhXC9vx7bmWFyIhgTEJn5elj9i3vHwcvzXtDpRqpYgHyK+fPBu/dka6AGnxCznddqmzX7ZECmYQP7y1szpTB5LdFU+9mkAWg0NsTrm5ctJlx7l+FrIU3/XAIVzLm/ioI3JTlxfESPnr1yoiyAprrFdYGQLcE3YIF+gejKphZ3ncmcrWDXizl7UdMmHVHydkIWXebaeZB44NidmJoKzosOTE1T9v6DJuUpmjfoDewhf7Yj/VdelOjsMXmVgMUoC0CRty2639TtQJ/udLvmfGyo95uJB+Tf6jsdPqYyuJSN8znTN8e24jQMVfCb0a4GKP9aEXTEIvDHm4j854ToXVgg6IiLprglDFz2D0NCD8lt9d6FRI8WqEdq1pUP7mqpapRnAzN9zWS49jZ6Vff4FCxjWUOZPW5Mo0yAtVDbgx73+j8OMGgxy3K2TMu2DdUB4oeLQGFR7FZMM0gkRfD6WVdXHrt3V20YfsRj6xFCnPk08coHrwlPlDFce05agbJeN1cFnrV3R//9 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f5133d66-1db9-480e-8152-08d3690015c4 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0709; 2:Ly3+ms7T87F23Q/0sg7L0qeAcGn39hfOwcyAQ8RZBsfsZEwrJZJMXav4BAkgHMBk2hvLDGbhnsnx+Jvw/Jlv5sr/xr+aAF4+kNgPfuRJCcZNSOkBVuw3L9tfrorjg5nxXeoyxGRldGdOnZSLiSt3XY8kSzjyIvYViSXpjOb9sVkmGt7xZyrOpSKn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Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13015025)(13018025)(13024025)(13023025)(13017025)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB0709; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0709; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0709; 4:zTSTmPl9xdkOPfs+YLO8XsedM5pQlzr0NCMy1og/5zZw9JE5j5YxiLlYSqxT6cdUSVsJtKQqAclNw9x8kTnWgwGX9NgyN/7+JLyE1Bjwp2a+l0Z2Yz6WaHjmQna6hkoLh4hSoEdzCqmyY9wc4a7fpMKmbuF7HPiw4dvZDFtU8vRaSZeDmta9fHe/HRYL7OrG+HhT8A8TRNbDErLBRpPZwjEqK721mGgCA1FDehB2Sq+hwAV9U24Kf794i59PX26S0jtFVCqLQt/s6xw47nNFpOujcgHefN6UqNq4xSL0ckv9RS39Jy7F65yn2rJ8LtIlqVH54R9RCMZR++cj3dJdrRNRZBgR4TsFPeck0/1XESUJOffWMs0+4ARdbDH7wTKDXf0rssvjRiXGIp1diJ1QrpoZnt/pO6GjatZt7e1OGOOWRGYs4UE3a/iRe3JK5IxB531hRa1HEcqrW9anHVhJg2INYpF8rcHWxJgWuV6/9m0= X-Forefront-PRVS: 0918748D70 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0709; 23:70xSrUeOYviLVoqzpzqPK/nSqJ/QsOD+v5FSDpD?= =?us-ascii?Q?mWPnN65FRnPvSPYZCaTaSbvBcEXZOvrhlk/sc7+gqvJOulO+lpwNa2gYFCc2?= =?us-ascii?Q?Vpp+DSP26PmKU3/5eTdK9nkkrlv9vlJQaw/sE6DOiHZ9R0AH6O+x4nIYgSfp?= =?us-ascii?Q?lrbHEmCB1vw4ww4+JkAlu465RFVmUiR3bJbKf4udibk+q2aGn7djbDAZzin9?= =?us-ascii?Q?7JHuOtIasZ/TGT9hEZj93VDO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jbiDD0/AIn8wUovaR003YqZeG8zl+HgqVsoEST5+ABPUtUFc5A6OjVwPz0DFuyXAh6xIY8HDceUA2c3sUUpXux5BA7XwWlbMFN87FVtowq/gzDl2saY4DpP5Tj2/bT17l0kzSWhrub4XmIfATw2/qcq/0QA0=; 24:utBhwTcDABgt3TukosBAYnGVOblpNc6F3flTZ0ObQ7AhZsrA2MR05iC4HeMd2esM32oROcmBS86/KD+GEvvozZra0teBdHTdViY6p0zI3vY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 09:42:27.3460 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0709 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160420_024249_604261_217FA12B X-CRM114-Status: GOOD ( 15.12 ) 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: aisheng.dong@nxp.com, anson.huang@nxp.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, 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.2 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 Formerly clk core does not support imx7d clock type well that all its clock operations requires the parent clock on. Therefore we enabled all clocks by default in clock driver initialization for other module clocks operate well. After patch 'clk: imx7d: using api with flag CLK_OPS_PARENT_ON', clk core can handle such clock type well, so we don't have to enable them all by default anymore. Instead, we only enable a minimum required set of clocks. Cc: Michael Turquette Cc: Stephen Boyd Cc: Shawn Guo Signed-off-by: Dong Aisheng --- drivers/clk/imx/clk-imx7d.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c index 980b2b8..18d23da 100644 --- a/drivers/clk/imx/clk-imx7d.c +++ b/drivers/clk/imx/clk-imx7d.c @@ -361,6 +361,14 @@ static const char *pll_enet_bypass_sel[] = { "pll_enet_main", "pll_enet_main_src static const char *pll_audio_bypass_sel[] = { "pll_audio_main", "pll_audio_main_src", }; static const char *pll_video_bypass_sel[] = { "pll_video_main", "pll_video_main_src", }; +static int const clks_init_on[] __initconst = { + IMX7D_ARM_A7_ROOT_CLK, IMX7D_MAIN_AXI_ROOT_CLK, + IMX7D_PLL_SYS_MAIN_480M_CLK, IMX7D_NAND_USDHC_BUS_ROOT_CLK, + IMX7D_DRAM_PHYM_ROOT_CLK, IMX7D_DRAM_ROOT_CLK, + IMX7D_DRAM_PHYM_ALT_ROOT_CLK, IMX7D_DRAM_ALT_ROOT_CLK, + IMX7D_AHB_CHANNEL_ROOT_CLK, +}; + static struct clk_onecell_data clk_data; static struct clk ** const uart_clks[] __initconst = { @@ -846,14 +854,8 @@ static void __init imx7d_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); - /* TO BE FIXED LATER - * Enable all clock to bring up imx7, otherwise system will be halt and block - * the other part upstream Because imx7d clock design changed, clock framework - * need do a little modify. - * Dong Aisheng is working on this. After that, this part need be changed. - */ - for (i = 0; i < IMX7D_CLK_END; i++) - clk_prepare_enable(clks[i]); + for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) + clk_prepare_enable(clks[clks_init_on[i]]); /* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */ clk_set_parent(clks[IMX7D_GPT1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);