From patchwork Thu Jan 18 23:58:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10174265 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 8BAF860230 for ; Thu, 18 Jan 2018 23:59:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76FED28511 for ; Thu, 18 Jan 2018 23:59:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B9872854F; Thu, 18 Jan 2018 23:59:05 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87EBD28541 for ; Thu, 18 Jan 2018 23:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=32+kGboNKnJvG3inbPb9cl91igO6J4dqm7qJZ5QfGJQ=; b=CWW G6mrTKMy5Fsgk0xwd5QqpOA9O0S0g90+X+UNh6vC4v1Uh3N6E2F7bBRnBXMz6UotGa3Q8OacNt5Ef m4RHeFW0NFURL2/PuseFMwdiVQQQClp3GlPbEp7EEEpCZZs8WFll10kcZKTU8cPrEma6gvn8Fm7OW 5gNjMJGckWhRMNV2OzBn1GiEeEr7Yczxhp9U1W2Z3bVYmvkUPwvwki+OfF0XtXD796kXt6uisLPIn hj3zjujBctsujDp4H6Birb5wraU3tDMC4ZVJmpeBO+ar70C0yhjzLpnmpFjl3R6LwkV62riIGeblY bKwXw2gdJ9c5LYAslNw3L1STXAfTVEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecK5G-0004k4-7I; Thu, 18 Jan 2018 23:59:02 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecK5B-0004j2-RA for linux-arm-kernel@lists.infradead.org; Thu, 18 Jan 2018 23:58:59 +0000 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 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= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pm@vger.kernel.org, marcel.ziswiler@toradex.com, max.oss.09@gmail.com, linux-kernel@vger.kernel.org, Stefan Agner , octavian.purdila@nxp.com, fabio.estevam@nxp.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 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 Reviewed-by: Anson Huang Acked-by: Viresh Kumar --- 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);