Received: by 10.223.185.116 with SMTP id b49csp1275991wrg; Sun, 11 Feb 2018 08:20:15 -0800 (PST) X-Google-Smtp-Source: AH8x226GcS5KDP3pycAg5qEtxz0lyeLQeQCswofKHpT6izjOuBw90pjoWbpTzGnnWL6qjNsrERbq X-Received: by 10.98.219.68 with SMTP id f65mr8786356pfg.25.1518366014988; Sun, 11 Feb 2018 08:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518366014; cv=none; d=google.com; s=arc-20160816; b=OlTmayfNXvAhnjfE0ZWvh+Hr5w8tPEu3jmTbTfDGnV5y9QVGE3hSeU9gA9z9tIbzuy UKAbxAoVKx72Cs0feeMaxPX3PmYLovL5yYvmAqqPlSM78bmLveectoSXB4Zkqj4+PedS NDkEreIFdHkrhgXhJnnX0rvCbu7IeLaTEdgRby1yWmpJE/SGPjRVoegws/qp/2ikRZB+ 7SJB8GNqn7y/MZbvr2gvxshCOkmj7duLnilsFpEiS16sMNX0RD3ycudld7KS5t1/XpDG vL+0fY5uFzJoNUOteLetMUcVnECk0PIhI64Y3Q8AG16aEr+yWdTUSuNy44QyC0+3iefg 0IYA== 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=dFHH2SRbyC1sGx79cFSBuyV0t8JrPiO0e8VVABAO3ak=; b=PQjVP7ydg82nEmLwafMO/TKwQSvgb7+VPsSyc/ilAXF5B2/jDwdEUOXsK6E1TJmkg4 SCa/eyjslDZbXIhQsc2AZ2+fZhpnCfoxC3U19Rugy6A6igAUcZidZta9NiUN8VHBY/gC R5TBW0jRA6OIyp8R2nqyeNr9tk96vn7jB/3CNQRKOn6nQ6AO4Kv3cDS7AZgn+FLQoCOb SRu4PZhIphIPuULRpL2q6Rd4hlWDRED4DJ0/JtTvsuc9ixpWi/ZNFiXCRk2R5f1RqPJI +IUoN+K1fgV3U+THLCf89Sx0mTxki17JbZOM+lwRI7TgzGvDsWqbC3ajQwA19FJp344U LqgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=pKr14t7q; 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 n11si2315825pgq.230.2018.02.11.08.19.21; Sun, 11 Feb 2018 08:20:14 -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=pKr14t7q; 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 S932070AbeBKQRh (ORCPT + 99 others); Sun, 11 Feb 2018 11:17:37 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:54928 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbeBKQRf (ORCPT ); Sun, 11 Feb 2018 11:17:35 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0606A5C1241; Sun, 11 Feb 2018 17:10:05 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sun, 11 Feb 2018 17:17:32 +0100 From: Stefan Agner To: Anson Huang Cc: Fabio Estevam , rjw@rjwysocki.net, viresh kumar , linux-pm@vger.kernel.org, Marcel Ziswiler , max.oss.09@gmail.com, linux-kernel , Octavian Purdila , Fabio Estevam , Shawn Guo , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , dl-linux-imx Subject: Re: [PATCH] cpufreq: imx6q: support frequencies >528MHz for i.MX6UL/ULL In-Reply-To: References: <20180118235836.17393-1-stefan@agner.ch> Message-ID: <79baed40abbcc72920fd133bc43e378a@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=1518365405; bh=dFHH2SRbyC1sGx79cFSBuyV0t8JrPiO0e8VVABAO3ak=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; b=pKr14t7q/jE2yOJE6UV1rBVsy+rJCTDnUR0ysYNYc4vfCO2KYVgqJE99gwzerM3PLtVYj+c+WQBimuehJ6r6930MMILDyc4eTs4JwDTxYxexjEIk03IPgXUHtPwAfMP3ChuNUpz+8BuDJargX1oHIwHRpArhUcPnEbf+ZKVHaWo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.02.2018 02:42, Anson Huang wrote: > Anson Huang > Best Regards! > > >> -----Original Message----- >> From: Fabio Estevam [mailto:festevam@gmail.com] >> Sent: Sunday, February 11, 2018 12:26 AM >> To: Stefan Agner ; Anson Huang >> Cc: rjw@rjwysocki.net; viresh kumar ; >> linux-pm@vger.kernel.org; Marcel Ziswiler ; >> max.oss.09@gmail.com; linux-kernel ; Octavian >> Purdila ; Fabio Estevam >> ; Shawn Guo ; moderated >> list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE >> ; dl-linux-imx >> Subject: Re: [PATCH] cpufreq: imx6q: support frequencies >528MHz for >> i.MX6UL/ULL >> >> Hi Anson, >> >> On Thu, Jan 18, 2018 at 9:58 PM, 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 >> > --- >> > 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); >> > + } > > For cpufreq > 528MHz, ARM PLL needs to be set_rate, I did NOT see > where sets ARM PLL rate? This is done unconditionally after the if statement: if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) { /* * When changing pll1_sw_clk's parent to pll1_sys_clk, * CPU may run at higher than 528MHz, this will lead to * the system unstable if the voltage is lower than the * voltage of 528MHz, so lower the CPU frequency to one * half before changing CPU frequency. */ 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_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); if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) { clk_set_rate(pll1_sys_clk, new_freq * 1000); clk_set_parent(pll1_sw_clk, pll1_sys_clk); } else { /* pll1_sys needs to be enabled for divider rate change to work. */ pll1_sys_temp_enabled = true; clk_prepare_enable(pll1_sys_clk); } } /* Ensure the arm clock divider is what we expect */ ret = clk_set_rate(arm_clk, new_freq * 1000); -- Stefan > > Anson. > >> > } else { >> > clk_set_parent(step_clk, pll2_pfd2_396m_clk); >> > clk_set_parent(pll1_sw_clk, step_clk); >> >> Could you please help reviewing this patch? >> >> Thanks