Received: by 10.223.176.46 with SMTP id f43csp189695wra; Thu, 18 Jan 2018 16:01:36 -0800 (PST) X-Google-Smtp-Source: ACJfBovZN8Zc7+8h6GQLoAJWdcWnOvHcBOWI4EyacXc/U9UJrOa1z2nzQ+erLq5aoAbzzEbnphCl X-Received: by 2002:a17:902:4483:: with SMTP id l3-v6mr598490pld.382.1516320096594; Thu, 18 Jan 2018 16:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516320096; cv=none; d=google.com; s=arc-20160816; b=C3nKPX3/NUDmTgcqc2aEqt6tJB4iqg2pjCW2gG5ca5zkP2DD0b2U+AvmkRH0EAHf39 h3stIjybeos9v/QOxb/stTSSJI2hBKRoJohGZWFtTLZzJGSkvB4e/kjyQapZYE44fiBu Jqgw709NpWREGveArFcAMFS0at85ZZMHCqynYaURiro4EeEjfZRlnBPVTyvuLQV6dvtu QOFPYlgUnVouKwpCy3d71rwk3uenvStILaNPq9cnEc0wlxqmFZOuKe0qNRg607oRJwBb tYsYpkOkqNvkWmRLTjdPuWxdZbGmh4jycsiFY83F3X5zNrVl9gAz5vjMJ7WckcQkW6F9 TvtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:message-id:date:subject:cc :to:from:arc-authentication-results; bh=ZIlG4fx5a57MJ3xOtmhblRvzOoLrw6ynHZ3wYW2DrhU=; b=iOyrKmS/sc0RMZ3uUYxsIognc7fPG3H2fN6m7g9XB8eWuFH5r+9MaW8gQ3herrNSGX 90+HSaxAu17BRqDNRsheCJUwjCweoMvKJUUporujRVXs4cqxq3tElSQYDbiCL8i5Vpwq Hq8NMG7MuKHA7O3NFrx3ckTjGu+knweSw4NcuE0sI0Rzuwf3HbKvf7nANEGyfT+X6jOs 7sNplrILYO/LIdfXZLyhSYVxz3XOpqhYmeh8BoKjZQaotOXOPq+0xqdQk6X721NxEOBF 3zFr2tZxLhWnWZ1NglVfs3mpmxSMjLanoT7A+Gm8MnIfTpw/Mi3FU8YpMDxopI8vHodE 5SGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=BLYFEdUp; 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 y9si6761792pgp.312.2018.01.18.16.01.22; Thu, 18 Jan 2018 16:01:36 -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=BLYFEdUp; 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 S932842AbeARX6u (ORCPT + 99 others); Thu, 18 Jan 2018 18:58:50 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:34723 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932394AbeARX6m (ORCPT ); Thu, 18 Jan 2018 18:58:42 -0500 Received: from trochilidae.lan (unknown [IPv6:2001:1620:c6e::127]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 703195C21F9; Fri, 19 Jan 2018 00:51:46 +0100 (CET) From: Stefan Agner To: rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: fabio.estevam@nxp.com, octavian.purdila@nxp.com, shawnguo@kernel.org, max.oss.09@gmail.com, marcel.ziswiler@toradex.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] cpufreq: imx6q: support frequencies >528MHz for i.MX6UL/ULL Date: Fri, 19 Jan 2018 00:58:36 +0100 Message-Id: <20180118235836.17393-1-stefan@agner.ch> X-Mailer: git-send-email 2.15.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1516319506; bh=ZIlG4fx5a57MJ3xOtmhblRvzOoLrw6ynHZ3wYW2DrhU=; h=From:To:Cc:Subject:Date:Message-Id; b=BLYFEdUppnxdeGIsrqOmsW1p4k4gTpEOYbCaLC5SIhVPo1MTstQlUE+ySg+aVQarvrnyPuJ/XtKC5nqIhgBWshCXxB/DtkTGwoiuMcmXEqeJSZuSY3Uu3VDcXhD0jehYdp96/e6pR5wz/avbIUVtWLSKhTJuDz2JlR0D8bCryJI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + } } else { clk_set_parent(step_clk, pll2_pfd2_396m_clk); clk_set_parent(pll1_sw_clk, step_clk); -- 2.15.1