Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211AbdHDLRj (ORCPT ); Fri, 4 Aug 2017 07:17:39 -0400 Received: from mail-by2nam03on0069.outbound.protection.outlook.com ([104.47.42.69]:22208 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751304AbdHDLRg (ORCPT ); Fri, 4 Aug 2017 07:17:36 -0400 Message-ID: <1501845448.17254.31.camel@nxp.com> Subject: Re: [PATCH 1/1] cpufreq: imx6q: imx6ull: use PLL1 for frequency higher than 528MHz From: Leonard Crestez To: =?ISO-8859-1?Q?S=E9bastien?= Szymanski , Shawn Guo , "Anson Huang" , Jacky Bai CC: , , Viresh Kumar , "Rafael J. Wysocki" , "Julien Boibessot" , Fabio Estevam , Date: Fri, 4 Aug 2017 14:17:28 +0300 In-Reply-To: <737b6166-1594-677b-1a08-4f9b795d9410@armadeus.com> References: <1501230993-15812-1-git-send-email-sebastien.szymanski@armadeus.com> <20170803020320.GG31819@dragon> <737b6166-1594-677b-1a08-4f9b795d9410@armadeus.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131463190534918031;(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)(336005)(39400400002)(39860400002)(39850400002)(39380400002)(39840400002)(39450400003)(39410400002)(2980300002)(1109001)(1110001)(339900001)(24454002)(377424004)(199003)(189002)(377454003)(2906002)(36756003)(38730400002)(2870700001)(6246003)(7416002)(53546010)(2950100002)(104016004)(23676002)(498600001)(53936002)(106466001)(50466002)(103116003)(229853002)(105606002)(54906002)(6636002)(8656003)(33646002)(5660300001)(68736007)(47776003)(4326008)(86362001)(356003)(626005)(5820100001)(81156014)(189998001)(77096006)(97736004)(8936002)(76176999)(50986999)(8676002)(50226002)(81166006)(305945005)(99106002)(32563001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0301MB0899;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD009;1:IYLpd6Tl/Ba/dE6ZHMnxL4bBGTLFdmCSwIxIjHVx0DkZlAOltkUpbFuCjpF5M/gJHhkg6MxC3WojqA4I5QKkiqdXusaqS+gv31u7Q6XrzXA16SU0SxjiOaxZ1jmbTlj6lPsJPr9XPetkhL3iZy2bbDJAAzgjSuTiouNlN98YnNt95nTvJkfy1IobadT1asqf/DG9WQPtesELFVeEbZpAIk4I/Go+p9HkZbHL9ShbpBMJElPbkR72MVXw5IVEBue3RXHoOelbWfYmLm32b6FHCcymnxb4o+St4dgyVA1gYNdU40IeOxCUyX4LEAOxJihzlxEdivb0jpGG9e3lXaSBviMPoGlLsPEoDaxVxmNDcyviKsD/wNXPcRMosNZLn7gEufv9ojGglUUvfjG4Nz1Gdaj9Vo2U2V/p80DThmVcwHo6WEoTESxyMpGsXOfZoRrIHYYdNNja8/G8KfKHu17Zrb7uRpi4fy4AZ8jbQgVNgMrpsb9M/gyO431tn9YIN8yMOwORPEYmPJJzU1zyS3sr0kSHRhcSBOFr9XNSj9Doo6zZKgoC1RR+U932S0LvxmEoH2JznPRjBa8Q9/jbHVzdJ4tzc6skrU8gFyBNvt8yAzJC8pyA9lMqp5NZqIWKbktusVmliBBgZBHfea03LitkTP+JW2KS8wvbIGjzSi9mCFwW+sFSV0Z46j93GaEjVSYPVs+DcJ8hpMnw/kD3xf+5EZd3ZlumWNfzTfMMhC443iW1gUkPCVy2anfq59MjcVuHg7lXciWXaH2zdwd8jOJcNcYf3eBJU2anjv1aFxa1F/5rQvPCF8CwJTvDnOi7I+1PJLTxMH/ucbIn5OjmcQ//DUfZGoPaQSvJ67bqbWZJSQY= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28ba7f17-f2d7-4fcd-2e2e-08d4db2a6754 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN3PR0301MB0899; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB0899;3:f3LfSFf3tRwhhw4TLx2jnX30EE/HjtreMQysh0Q8BDyY3DUJLPo2tNjTaLxzqM5Edga71Kd8MNtOgtiJM7IHz4SnabTAmfU6/MiN9YM4cVnDEYOHUqySPl47nvrKjWi3KOpCDz3VMHHgJR0wJkEzQkNwahhpLL4DWDXbrlgKzk9AdPs9EXkLNODIdEmvmolWVJtV/e92yizO1RHKUEKo34nYKeHG5OHak5vL6Bk1h+UGrOMC/wHNDlgcxFQCekb8L3UAkVrCoOlXQCY8ans+rDFp3oEjCJVVsOJgiwSPqIjE5UGeVkF7gAKuA8OaC8/lWtNrziauJFneZemlja04OaAlZ2U3mp5jA3wxG81WxWc=;25:FjG2lB9aAjNpTd6VPVh/vXqhKrNfOtEaefKLAm3fBhAO86y1V3NV8SwQctvgyQFEt0yxxgIFT15XoKyiWDqAzoqjsHV5AXStz5B6tYQErS+t8Q7vpGIzLls2jtYl+b0tXYQblSHkDB55UmAn5UCYIT0JdWLvSbzBxBCZbquCoa9wmRnj7qX2Wa7OegUX2uXacuPB2tuCRVX249+ldbkG9bqCyV9y36T9vhdvl/MRPez3LB3zGr75xnce6xEStwrlqJu00K+Yhs2SFWt4CVOJPQ3Di9bOZlfSItrD7SeOfJyNagRduiFGFDywRcUsRz7o5bz3AsxGiz67In6dH61XIQ== X-MS-TrafficTypeDiagnostic: BN3PR0301MB0899: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB0899;31:Khf/wim2QDChZbiDErVhzqZ4FS8WfLqKWHMYwNMvsA9yUCNyx4eorq0Mr2F1SBgVIfUF/Vs0GKbVKwkhw8jDVESUzm+dmxUd+2urDn2fV3KhEgP4l/5yq49fx7tftSeI38qElgtdl2qnTvATGuzlCKEkcitc23lWZG2wD8a7Xx1s9rgFR4GqeHNly0JMSJgRzoXL3ow/Ai8/bJD6Nwr/znSwTzVa4Bmt0zsSioWbDl8=;4:4S8BovgYZ/Y1gY94cUfJ7u6X3LWA2jUw02yCNOi501r1rmWjA/tVU7HEwpNsE6tGLm72HBpEtygM8knSmSJMmDg6O9QeDFVluQAjumworxrX+bNSKPGzLNFBesNxsbxzR1aA+jLq8Hq6/qa5y/RVOxTG7UjNcoHwfQ0ZKJc8xfOCHCMJ8MQh6SLohQ5PrLs/EUShIxKyqGRaNWMBhCPFpbBIZLeUfqG5yX4MJmeScHHRxfqS3B8MMwTCYDAvJRdZ X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123563025)(20161123556025)(20161123565025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR0301MB0899;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR0301MB0899; X-Forefront-PRVS: 0389EDA07F X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjAzMDFNQjA4OTk7MjM6cWhyc05SNEpPczd3ZURQRGtYSk5yUDhq?= =?utf-8?B?RHZoaDhvM2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iagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2017 11:17:33.2734 (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: BN3PR0301MB0899 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2351 Lines: 54 On Thu, 2017-08-03 at 09:32 +0200, Sébastien Szymanski wrote: > On 08/03/2017 04:03 AM, Shawn Guo wrote: > > On Fri, Jul 28, 2017 at 10:36:33AM +0200, Sébastien Szymanski wrote: > > > Setting the frequency higher than 528Mhz actually sets the ARM > > > clock to 528MHz. That's because PLL2 is used as the root clock when the > > > frequency is higher than 396MHz. > > > > > > cpupower frequency-set -f 792000 > > > > > > arm_clk_root on the CCM_CLKO2 signal is 528MHz instead of 792MHz. > > > > > > [ 61.606383] cpu cpu0: 396 MHz, 1025 mV --> 792 MHz, 1225 mV > > > > > > pll2 1 1 528000000 0 0 > > > pll2_bypass 1 1 528000000 0 0 > > > pll2_bus 3 3 528000000 0 0 > > > ca7_secondary_sel 1 1 528000000 0 0 > > > step 1 1 528000000 0 0 > > > pll1_sw 1 1 528000000 0 0 > > > arm 1 1 528000000 0 0 > > > > > > Fixes this by using the PLL1 as the root clock when the frequency is > > > higher than 528MHz. > > > > > > cpupower frequency-set -f 792000 > > > > > > arm_clk_root on the CCM_CLKO2 signal is now 792MHz as expected. > > > > > > [ 69.717987] cpu cpu0: 198 MHz, 950 mV --> 792 MHz, 1225 mV > > > > > > pll1 1 1 792000000 0 0 > > > pll1_bypass 1 1 792000000 0 0 > > > pll1_sys 1 1 792000000 0 0 > > > pll1_sw 1 1 792000000 0 0 > > > arm 1 1 792000000 0 0 > > > > > > Signed-off-by: Sébastien Szymanski > > > > Can you please specify on which SoCs you are seeing this problem? And I > > would like invite Anson and Leonard to review it. > > My SoC is MCIMX6Y2CVM08AA which is a 792MHz i.MX6ULL. I forgot to > mention that I added the following operating points in my device tree: > > operating-points: 792000 1225000 > fsl,soc-operating-points: 792000 1175000 Yeah, I was wondering about that. Adding support for higher imx6ul/ull frequencies "properly" requires adding the extra OPPs to .dtsi (they are different between 6ul and 6ull) and reading the speed grading from OCOTP to check if they are supported. This patch can only work if you hack OPPs for a specific board. Reading the speed grading is essential because otherwise you risk causing random crashes while running at frequencies not supported by the hardware.