From patchwork Tue Aug 23 14:56:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 9295059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 48AD1607D0 for ; Tue, 23 Aug 2016 07:10:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AAC4283ED for ; Tue, 23 Aug 2016 07:10:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07928287D2; Tue, 23 Aug 2016 07:10:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_06_12,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DFC0283ED for ; Tue, 23 Aug 2016 07:10:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bc5of-0001HT-G7; Tue, 23 Aug 2016 07:08:09 +0000 Received: from mail-bl2nam02on0071.outbound.protection.outlook.com ([104.47.38.71] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bc5oZ-0000wx-8L for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2016 07:08:05 +0000 Received: from DM2PR03CA0022.namprd03.prod.outlook.com (10.141.96.21) by CY4PR03MB2710.namprd03.prod.outlook.com (10.173.43.141) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Tue, 23 Aug 2016 07:07:39 +0000 Received: from BL2FFO11OLC010.protection.gbl (2a01:111:f400:7c09::147) by DM2PR03CA0022.outlook.office365.com (2a01:111:e400:2428::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Tue, 23 Aug 2016 07:07:39 +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=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; 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 BL2FFO11OLC010.mail.protection.outlook.com (10.173.160.154) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Tue, 23 Aug 2016 07:07:39 +0000 Received: from anson-OptiPlex-790.ap.freescale.net (anson-OptiPlex-790.ap.freescale.net [10.192.242.177]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7N77ZVa024859; Tue, 23 Aug 2016 00:07:36 -0700 From: Anson Huang To: Subject: [PATCH] ARM: imx6: add opp table when cpufreq is enabled Date: Tue, 23 Aug 2016 22:56:11 +0800 Message-ID: <1471964171-27480-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131164096598898470; (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)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(86362001)(50986999)(48376002)(36756003)(5003940100001)(92566002)(50466002)(97736004)(105606002)(19580405001)(87936001)(189998001)(110136002)(106466001)(626004)(4326007)(305945005)(8666005)(104016004)(2351001)(7846002)(19580395003)(77096005)(356003)(2906002)(229853001)(47776003)(81156014)(8936002)(8676002)(81166006)(11100500001)(68736007)(85426001)(586003)(50226002)(5660300001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2710; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC010; 1:eDU6r3sHUd0eRKPsvHELlxjweeeTmnufMrvkJ0NwIeOeqDya5hK6gdOlHGrVefjUWKfPzQlKDiXZgAmJw/OiB1mDrbl+U5rsokculjdNkHANy79vniFRKey7D0xWsRZE7YE6Rllho3iD8I6YA/ctOLWeaNexEt8SYS7HJdT9RoyeK8L5RE09c7cxPDMxBDjyO53/hdcGJ7KgDC4u6eXdNPKT8zM45CO6vJ+9JsOfHUcPLrG4JOWujW8UpCUd8/PkKErOx8/tVEooN9KT3TjBQ7l9goAEkKkDRVWvqMpylpj0irlVVG6oB95gwYeRSuv5QyL7oigA4dVa1utwTPEbY0up+UhuYuHKIuWy9Gp0xHMtowZ/EUuCct3NYnusgHJP39T4Q1CNN0vlYyWeiUCjsu04BM0uYsCQiqJBZzvCDnF8d6A2s7/pdlJe5vpetAaKfEd7VEqGZneoa29nykzGFG8OS27+fhSUVSMan88hNoCiDFvvY+/gvPFGv2Kekg+a+Lc8O0MowrKm7OfgB/8i7hRILYgU7YTUQnfOrjeB4RFF47jM4ykPxEBgPoxgT/DcQMSheGflerMLyWchKiJlWhvZLokfKqZU1zb0xlTok9Xiw9iRPCmct6lSmKQqMpcDmzrDJSoe0op3KTod9lLqnSPhyjJgnAgc5594/PCbsrodiXcebFwZHusd08ZO0PEdAPHG3AsI4WjnsuwZS4FjgJ44+d9aWLZ8RZ/kf5YrPcc= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 463b0123-480c-4227-8acf-08d3cb242b71 X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2710; 2:vZ+US+EuqBVD5aBbl00M2id+VhlE4DDa83FhLEfChvfRQwbhvaopZLwMij1UZ4ncWuxUFUnQU8OhXI4Qss1DdWtqrkqnGSCSu97l5f/AUSheIEAL75j1F8/JP1j1Cc7ccuSB21Bshdm8I9qqeVtUXAE4/Z8aW0MdQUDZkGkaIJjCemWf5o/FH9BD95Tq5TdM; 3:1ghvZpzd+17XxoNETU91T0L8aK3MCtEL/i/HpFDEm0Ls31BF1QIyzWkPyVn8k1uqnXk75By5uV77MPEp18gpcevs4wdOFtR8+QtY4NRUl86BGyVcYYVu3AwXCodEgvVxvlPTGXpBX30yTESLwhbRQlI4L/W5tk6YDEk9Xyomn++pF5ygXFJGPHrcqjiG3K53SQ1BAUJDlRU4t5cz/DKUMjDuRIa8pPfTomGEEu9NVq0=; 25:AjGMOSzpHhzl+2E5xr0FToc0NXsDV6BladtuPYIPcQ+amuytArOIyN2tlKWhQxFWMWx46esG9DtHggdpzVxkXOdDYMeKSbSc1faz+LAL3VhvWj6rqm++MTn/mxSC14z+MZo94t6MLrVmW8DMPjp1PwInszJahmsfIlTjMwnriqN3yfzHo+S22nDaZV6RNTgTJlbNAhDRq2efWQlg3QhOttU0W8xI4q3pVqXjy4leYPmbbSGXXR3Zk2B60tpbWY9mgHiNtOfK4CtrFN89N8lG1wbwCVZbrkhHMTrZNkK3Nm8Vf7b6nzygEg2TLhrCOZxpNTEnxIChv9u0vn7Xi8CUEk5XksrnShpSmSQ4TxRveUM08do0mcKF4AGSWX5cGN1YcKc5aHUF1BnutYLoEQpnQ4dYP6dwGRs7uUSfLoy7JR8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2710; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2710; 31:MEH+s86kQ6ETD5dmHZ2TsqtcZ/hZsjK3K27b92+kUSgOCqRYjzyJ3yu1aIzaoxy77liwZdhwAyJhgGhYkxmrR0ua4kxoQoIYc0VHV3GyHn9wbETwCjKS99diiFa/t50ftdDdgRAu9dAqSB8O/E/7NVUQkAQZb/XlJLxQbTlNgvuuptkumxmxTLCrIulESc5c2a1V56GirLKkUO4IWb4Z7lMUcwfjP9rZ7rIvNZBSA6w=; 4:jnXCfCacYm+Xh92dxld8Jq+eIu13QcfC9644Q9WCYFsQqD34dhDK2WSKO1B2Zh+xIYMIpATPmNmYEBUYt6bRpb07b4T/tI380CtjdZGO5+b4HqsTVsX27OEuXbKmKJ/4jQM4yCqYsc8q3pvatoo5bQsheALBZ/t9TennFc5WHBr15T+7Po/13EtZ1YRyBRFqUDRDdjxPZPYbegtMQsjwyjnj7Y6Nn1Y6/2quxHxeOGwpgtHWCzRMBKb9VsI4irdEmgIe5Aur+z3DeWj0KBIL1ic0MZMl2FzR/3T3xEGWCec8CTmOdhbA6gh8Fe/aAbDXrQF8raCKIw435G37fezKqOOD1LPpOU/QRYSV1cMbM3PLwhgv5BYf34Q6gt/EZ4O34D6+j4clyvv/Ww5D0/VVkZjOeSMnAIxtuXP5hlV2RQiqghoNM6gyCCgSo3VBjfixhHMj+MxM+mxf/9LgaQUH3QAfyNZv/YDxl9llTM4ijXWlyoF8ZnS7q7PJP0pfOtBEwHs6p9i+0oWm09omSYv687oOTruGD1BxDdwBV9m7uPI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:CY4PR03MB2710; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2710; X-Forefront-PRVS: 004395A01C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2710; 23:SL+buzD7Xqcn4OfG+BZ3NWxhSY/A+qIz1WddcsVZE?= =?us-ascii?Q?VrVxVXxKo+UoCqBI6iIDf9fLEA38KIk3jI3QXDgVfFAPkvZPaFldyat+jgT2?= =?us-ascii?Q?O61v8i2YXtKE3SP7NOJCVTaLaacLtlqjeKS+SDYTz9D5mxQ72Oa0FDNsnAwj?= =?us-ascii?Q?qKOzFFbAAZLkG+KGPZt1w4TrH4TgkGlvmLMBoqa3kVqbRJrurBOcpsqcn/i9?= =?us-ascii?Q?WfSdsD9ulfTtVoGJkyrmQS+QAKHnGcL0F3iHQEBjIKQncpb07S/J8sKfBAUb?= =?us-ascii?Q?VfDv+A9LBpeciF1f04qVoLD9bkmXCYrmytJhY799nEwxC97SmdNwYhyPkjri?= =?us-ascii?Q?gaTBlcEmFsaomI5rxdh/2ALo6+pG6AsFxSn2/O40BXrWsJRKdyB8MLJ49Eem?= =?us-ascii?Q?a8Qd8iv89OGD2xcAZUSQgigUj6NhdCkzYKpobhtorGCNUQUedKmPfjaPtyBm?= =?us-ascii?Q?NlnSA2CkFyA0LUBT81qXJ8i3eBMXmFriZYs9kgqHeTB7jE7VUMwemIA+hDlk?= =?us-ascii?Q?q47E8YYoYf27B6wkVJKPVztCmufIcA0sLIgmlh7FviP/drFZDi69Sh0mTews?= =?us-ascii?Q?Vl8Xl4EWYo5udrqFyVzdmJzUdd19P22E0n9HgyTX6n6Tgvck6UCz2KeMxORZ?= =?us-ascii?Q?ELuy8L13HDipN6Re0KJljpich0egWjD31p1sY7slZMh2JyJPAA5Ehmrqz700?= =?us-ascii?Q?4NvwI4+OuyS9umpLzp81/lyEJnGVViP0WjRLFbpxOR3rmIN6S0silthPa+V8?= =?us-ascii?Q?IojddP9CdlcDO+/55N8IPG0hJ6BtqX/rg7dYA463kR0TAKv5MUV/yG5LlrGG?= =?us-ascii?Q?S3uhvPVXJ2WrEfHukDG7Mc3cts/dGZdie9MqO03ojX9AaRitpkM5g3MUmnpv?= =?us-ascii?Q?JXe6pBmhPNW347FXAyhKKNRlvISqkd3qQAFbnPQj6sHLi2ZHH9I8rIMxOL3J?= =?us-ascii?Q?jIrRMQ/GUqxpiJKmtJEeicNL0KwrWcqibEZLgKip5NFwmc0GR+iKRgqZdu+n?= =?us-ascii?Q?tSf8wOS6FkPi7g+kb10sStpfBNvMtw1gqJI/YzQTziGWkKtgENsb4eARy3oq?= =?us-ascii?Q?xoYI718PY9pk3+Hau584qmeqKKcxZ7xZHkohQHmnpzo0SXknQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2710; 6:VTljPgZxZNJlWKtCLeLFwvD3/nEDUL5fVNk65Vv7WxMLrgKBEfjXz85ttIP9XzqX6r9Wvzqms/XbyZEERnI3YbS3srWL+aWU/fdXOP8CYJ/LuF+T/iQbKV2um3ndukhTA33TPoz6pzmaHz/Bd6fJq7jsgzMSu68L5XtNjB+Z8ow4myVf3LdW4rmC7S6AbhqYHdKqKO8kW5VXBuGyLobHEoE1B8cYHGL6QcKQGkjPkpw7pX21Qec9+kB6KY366lw5/J1yg9XrC6TTRR9LsDPHy83J+f7uTkducj9eJfIjnHU=; 5:uJz7D1c++8A2poDmFyNNrJbHfH7G/lWHU4VeroCRvTSd8iFoVw97aGnlhu7/YipyZk0c/lFL+6yrvZnySkcFJXZX5eMGoybyp63X65wIoGnogF7h6r4ToczptOPHGqCrnEA15Ku4zB2fNj7m+/rqV7oImpRHp5a5HriR/E/jCec=; 24:fuGXEwnCze9anol5SW2rWaswvPw7m61i2LuJ9JJGpGD7tNcRozWhhoTnuWwGP9GnW16djD2oQnLWHqhE/BKykrKTleDsI84c/Auzo8nQVgU=; 7:hhf6xydSivTESEFIEF3c1/LN6ab6wPOibyIMVscOv5VUMOCkJYYMvoemyH3GVXV9s4DSEnDj9zD3KYxbLgYezDVgRBAV5DjF/Ppmvq/QM3HvPln1tgPfqZs0NUQQhBDo9+P7ANz3G+N+2RRfGslhl0zSELR/jv3PCv8KPl5+fkWD4sxwwZo9OKMwCD/t21eEH6Zfj/M1teSE2GJEEILY6eKaLuGuvOpKassSfz7m7ohVCFjMBdt3+grttwb7yWXf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2016 07:07:39.5778 (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: CY4PR03MB2710 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160823_000803_574969_A2ECF90D X-CRM114-Status: GOOD ( 18.32 ) 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: fabio.estevam@nxp.com, peter.chen@nxp.com, shawnguo@kernel.org, linux@armlinux.org.uk, kernel@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On those i.MX6 platforms which have no speed grading check, opp table will NOT be created in platform code, so cpufreq driver will have below error message: cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19) As cpufreq driver expects opp table is supplied by platform, so it is better to add opp table if cpufreq is enabled. Signed-off-by: Anson Huang Reviewed-by: Peter Chen Tested-by: Peter Chen --- arch/arm/mach-imx/common.h | 1 + arch/arm/mach-imx/mach-imx6q.c | 31 ++++--------------------------- arch/arm/mach-imx/mach-imx6sl.c | 4 +++- arch/arm/mach-imx/mach-imx6sx.c | 4 +++- arch/arm/mach-imx/mach-imx6ul.c | 4 +++- arch/arm/mach-imx/pm-imx6.c | 25 +++++++++++++++++++++++++ 6 files changed, 39 insertions(+), 30 deletions(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index bcca481..b757811 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -124,6 +124,7 @@ static inline void imx6_suspend(void __iomem *ocram_vbase) {} #endif void imx6_pm_ccm_init(const char *ccm_compat); +void imx6_pm_opp_init(void); void imx6q_pm_init(void); void imx6dl_pm_init(void); void imx6sl_pm_init(void); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 97fd251..09d295b 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -338,32 +338,6 @@ put_node: of_node_put(np); } -static void __init imx6q_opp_init(void) -{ - struct device_node *np; - struct device *cpu_dev = get_cpu_device(0); - - if (!cpu_dev) { - pr_warn("failed to get cpu0 device\n"); - return; - } - np = of_node_get(cpu_dev->of_node); - if (!np) { - pr_warn("failed to find cpu0 node\n"); - return; - } - - if (dev_pm_opp_of_add_table(cpu_dev)) { - pr_warn("failed to init OPP table\n"); - goto put_node; - } - - imx6q_opp_check_speed_grading(cpu_dev); - -put_node: - of_node_put(np); -} - static struct platform_device imx6q_cpufreq_pdev = { .name = "imx6q-cpufreq", }; @@ -378,7 +352,10 @@ static void __init imx6q_init_late(void) imx6q_cpuidle_init(); if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { - imx6q_opp_init(); + struct device *cpu_dev = get_cpu_device(0); + + imx6_pm_opp_init(); + imx6q_opp_check_speed_grading(cpu_dev); platform_device_register(&imx6q_cpufreq_pdev); } } diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index 0408490..009bfa8 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c @@ -38,8 +38,10 @@ static void __init imx6sl_fec_init(void) static void __init imx6sl_init_late(void) { /* imx6sl reuses imx6q cpufreq driver */ - if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { + imx6_pm_opp_init(); platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); + } imx6sl_cpuidle_init(); } diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index 7f52d9b..2c5b78b 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c @@ -93,8 +93,10 @@ static void __init imx6sx_init_late(void) { imx6sx_cpuidle_init(); - if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { + imx6_pm_opp_init(); platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); + } } static const char * const imx6sx_dt_compat[] __initconst = { diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index 6bb7d9c..c2cd61c 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -80,8 +80,10 @@ static void __init imx6ul_init_irq(void) static void __init imx6ul_init_late(void) { - if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { + imx6_pm_opp_init(); platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); + } } static const char * const imx6ul_dt_compat[] __initconst = { diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index fe708e2..9a6f34c 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -620,6 +621,30 @@ void __init imx6_pm_ccm_init(const char *ccm_compat) writel_relaxed(val, ccm_base + CLPCR); } +void __init imx6_pm_opp_init(void) +{ + struct device_node *np; + struct device *cpu_dev = get_cpu_device(0); + + if (!cpu_dev) { + pr_warn("failed to get cpu0 device\n"); + return; + } + np = of_node_get(cpu_dev->of_node); + if (!np) { + pr_warn("failed to find cpu0 node\n"); + return; + } + + if (dev_pm_opp_of_add_table(cpu_dev)) { + pr_warn("failed to init OPP table\n"); + goto put_node; + } + +put_node: + of_node_put(np); +} + void __init imx6q_pm_init(void) { imx6_pm_common_init(&imx6q_pm_data);