Received: by 10.223.185.116 with SMTP id b49csp2172464wrg; Mon, 12 Feb 2018 05:38:34 -0800 (PST) X-Google-Smtp-Source: AH8x225Hrsn/wyJYQ1D+aHXWyPJGgMXrY8RihrRwlK6PNnJCkQOh3veiVnNWjneW/dpZhxvwdhbX X-Received: by 2002:a17:902:a984:: with SMTP id bh4-v6mr10603459plb.95.1518442714773; Mon, 12 Feb 2018 05:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518442714; cv=none; d=google.com; s=arc-20160816; b=s3LXEDUXUop76dhVD1l/EzCLMIQqF85BbDcngyx2S4C95/r3d4s2qmpsZxyc9fIQkE c+GzOLBkPrDToPLefumM8BThBzm1pOkcmFMWvr+ISjej7tOwT4yN0aXtGbdhKLMjgosE szFvLqMo1JMEOJHXXoZJMNvr7vr/PFV/4xJx+egEytMicka4qIITN0rC/xmxBqdkYhc/ IC+Aaiy12h8yjC/BR+bc3UFz0W1y/kzGAptXvJqBfz6q05Hmno9HD0xyTkapixVDvR6m 4/IzNXpMiBaQdJ/BL9QwhfcHFsQRHEbPPc1yiVHZq2gC4FOb8ood5XHPcLkQrK1OyP9E 0llg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:user-agent:message-id :references:in-reply-to:subject:cc:to:from:date :content-transfer-encoding:mime-version:arc-authentication-results; bh=kB1yKZMvN0bFRKvDYPOKttyPYi1WVcpMXsTJ232yyR0=; b=EsrnAk4T9MNl3I4/zVKfMZ7h9pik2gGEP+/MzpBUH6+QFO4grpjQBECwfecRKyKIyV jN3NEyS05MNaiTqP+FBbfkaduwndQx9ngIjteIGQFgQNEABjT1B5sgizT0k4sNGyuoZ2 /yOc0gwuhwwYf3LOEFY+Bh9y76/XIBvLpsICJ5eoXy4BdJWfxu9VzXsPQKq85M+GCsNC 5b7Ti1wwmw4Mgm5WZMSIu5t3ILCahRKRh1S7o8YBW/6LrjF2le89QGIPvsh6IXWzgIdW sgmEzS25hxVRyBIpltU55UxWcyxr7m5cH/ny2+F3pfABnAx3r3EVfA3CUFJQ31rvS+7E zoQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=rIXmxffx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si1247511pgn.439.2018.02.12.05.38.20; Mon, 12 Feb 2018 05:38:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=rIXmxffx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933185AbeBLMCB (ORCPT + 99 others); Mon, 12 Feb 2018 07:02:01 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:36697 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932519AbeBLMCA (ORCPT ); Mon, 12 Feb 2018 07:02:00 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 2C13E5C040D; Mon, 12 Feb 2018 12:54:28 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 12 Feb 2018 13:01:57 +0100 From: Stefan Agner To: "Rafael J. Wysocki" , anson.huang@nxp.com Cc: "Rafael J. Wysocki" , Viresh Kumar , Fabio Estevam , Octavian Purdila , Shawn Guo , max.oss.09@gmail.com, marcel.ziswiler@toradex.com, Linux PM , linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , rjwysocki@gmail.com Subject: Re: [PATCH] cpufreq: imx6q: support frequencies >528MHz for i.MX6UL/ULL In-Reply-To: References: <20180118235836.17393-1-stefan@agner.ch> Message-ID: <6935d5dee61697743a7cb9f0760f33d5@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1518436468; bh=kB1yKZMvN0bFRKvDYPOKttyPYi1WVcpMXsTJ232yyR0=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; b=rIXmxffxujHoMRPiWzwvycpPbR3jvT2uHFjE1Dby+kZqOezL7glBZ/i9r+vHPmrJFj1/8mG8sKrUUj2P2gz2xe/IiCvfL2C+H3hzuPLfgPOF3okg8TbcJcVdja9BH0AyDCa6oFZ4lUY3efZbZX39/i4riXc5O3GNJD9vkAaIv48= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12.02.2018 11:18, Rafael J. Wysocki wrote: > On Fri, Jan 19, 2018 at 12:58 AM, Stefan Agner wrote: >> Depending on SKU i.MX6UL/i.MX6ULL support frequencies up to 900MHz. >> Use PLL1 sys clock for all operating points higher than 528MHz. >> >> Note: For higher operating points VDD_SOC_IN needs to be 125mV >> higher than the ARM set-point (see datasheet). Specifically, the >> i.MX6UL/ULL EVK boards have an external DC regulator which needs >> adjustment. The regulator adjustment is not covered with this >> change. >> >> Signed-off-by: Stefan Agner > > Can you please rebase this on top of 4.16-rc1? It doesn't apply for me as is. > Oh I see, Anson actually already submitted a patch which makes higher CPU rates working. My solution is slightly different in that it avoids unnecessary parent changes... I will rework this patch to apply this simplification to the current state of the driver. -- Stefan >> --- >> drivers/cpufreq/imx6q-cpufreq.c | 14 ++++++++------ >> 1 file changed, 8 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c >> index 628fe899cb48..840f6386c780 100644 >> --- a/drivers/cpufreq/imx6q-cpufreq.c >> +++ b/drivers/cpufreq/imx6q-cpufreq.c >> @@ -114,12 +114,14 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) >> */ >> clk_set_rate(arm_clk, (old_freq >> 1) * 1000); >> clk_set_parent(pll1_sw_clk, pll1_sys_clk); >> - if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) >> - clk_set_parent(secondary_sel_clk, pll2_bus_clk); >> - else >> - clk_set_parent(secondary_sel_clk, pll2_pfd2_396m_clk); >> - clk_set_parent(step_clk, secondary_sel_clk); >> - clk_set_parent(pll1_sw_clk, step_clk); >> + if (freq_hz <= clk_get_rate(pll2_bus_clk)) { >> + if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) >> + clk_set_parent(secondary_sel_clk, pll2_bus_clk); >> + else >> + clk_set_parent(secondary_sel_clk, pll2_pfd2_396m_clk); >> + clk_set_parent(step_clk, secondary_sel_clk); >> + clk_set_parent(pll1_sw_clk, step_clk); >> + } >> } else { >> clk_set_parent(step_clk, pll2_pfd2_396m_clk); >> clk_set_parent(pll1_sw_clk, step_clk); >> -- >> 2.15.1 >>