Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp869666ybe; Thu, 19 Sep 2019 05:14:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLm0S/PgQtM6id81WqUVMGiWEX/rLKu+PMgR1YHvypEDld3qNvY/hEWW+5vYFgTLdrFfw/ X-Received: by 2002:a50:eb41:: with SMTP id z1mr2887140edp.261.1568895294622; Thu, 19 Sep 2019 05:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568895294; cv=none; d=google.com; s=arc-20160816; b=SShEFyw1y1PbShNfhP9kiLFCtuj2A4nCI6orj/33GWAc+m6BschuMXl36lO3rVTS/B p4AvJNGNKYQkkQtYYP/fbhMZdpsXuANNhfwlfR37xWvtpLiZhLI+AqGjUgvI5AeH/IuA tQliuIbcbL8DYZ/bxRH2tJsCJE5vhTW2jVWudPBSkJaYAeTqhUwnC91w7fEmXatsz2JR spVAvhuvGLfqIUpAn+KlTGJqzI08Hfp6/ZsLiyuG6cj8/m0O0aIFulZWRf4hsBFXfojE d8kJ203XZCbhqM0xio4EzN04NjO3iPV3DUGv7ly99wsV425La0Dh43MhOUE0mHyFppJo 3puQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ve+wzZh8jIbj36VSXYKI7yL2XeCKd4lhGJ7BfZhWHhk=; b=G56QXRCeD/9ERNffJc02M2sXMhFUDKPuH8R0ib2HZqEd568sWGqvUkTxVzD0WBNcsT AgZcgqzG/wQksRE4/AjaC2oZjIFhEgN5KhC3XeFjj4zROWC03wY9Fx4UG+47QvGTZp98 4FVA0KsiJp68OIpaKkeWR0f9YblhMNeW1P0eEH13/diuNhaMPpSAA2m7b2GwPwrk+sR7 Gf8HX0tOzRMo1c0nIOlpfs5cZT8mkO95OkU4wFI80P/GgHaAydhtwwu1GgnsV+hl9MNe UkZ2wcwbYS6QVA9ozOGMrZYk/5JkCP65cjY9RSRr+5ZMYgwKq2Z4Z8qkgXMbGvTiFtg+ Yxxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oNG10dYr; 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 j14si4857646edt.298.2019.09.19.05.14.30; Thu, 19 Sep 2019 05:14:54 -0700 (PDT) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oNG10dYr; 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 S2388716AbfISJgh (ORCPT + 99 others); Thu, 19 Sep 2019 05:36:37 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55076 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388644AbfISJge (ORCPT ); Thu, 19 Sep 2019 05:36:34 -0400 Received: by mail-wm1-f66.google.com with SMTP id p7so3581616wmp.4 for ; Thu, 19 Sep 2019 02:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ve+wzZh8jIbj36VSXYKI7yL2XeCKd4lhGJ7BfZhWHhk=; b=oNG10dYrCbn1pG2d0FdlS4/80H49wI5hR3HIWwCnhqqjA62jSItQNspBjzxvSMedTr 4q8EAzYaQHcdosVIBhH6EkIz97rHE3T2imgWxPw+AJbGfy+/3bFQWAssrFRGNQyZZxws BqcbL59e6P+hICngHdTLTNZQJxf+Kigt4Arc8y+Zy41JmjnfhoGqIfb0KaDnvFaZc1te 7zkGKrqNzp10j43LIeTAazbGfmtTUShsFgb11nRienzG70jNMu2lh/L0WmRaiY+zrNQC cECvYUo+1KTMaRsTURjUfLEAVXk7x+cvMRG9mqFeUaTb4mCSQrwEBkE0bVLHhhe+9x3Z Xk2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ve+wzZh8jIbj36VSXYKI7yL2XeCKd4lhGJ7BfZhWHhk=; b=Pc9eDyxCf7HXwlJLhNP9fAHonSO0d4ha+hLz4+oLCoCgkio4+9Y02Z5k9fooTtGj78 OVLHl5IDmwPlV83IstL1MYswqi8kOJ1lDRVFNck/1Pxcfz/qe+z9CHpxprYX5xuXjk50 lHjaX4Oih+Arw5LXudvOxU4iy8AXswbnTMzjpfKqvaMjIdxNiOpMNMj3Eo5fDkRS1Ax0 DvtfQkOKYwAvlXKMzHZpF0R2t/1eMJB8E+oDno3rgLjszYyGR/ujzmzpSAZ6j6wGj6Yo oQrF6NVMWkHqRT5A1vUuZdEudEQ19byes2rLcWMH6ie3e4T/tD56v5MnPlZsh74L6JMD ojcg== X-Gm-Message-State: APjAAAUKkB6OXvNrQ5oVR5HRgHqUZa6LYHD9LeLTVmF2lOnQaG2C7N49 g3m/sIddo52Ds5uUmwv8cK/+OQ== X-Received: by 2002:a1c:c589:: with SMTP id v131mr1915621wmf.163.1568885790845; Thu, 19 Sep 2019 02:36:30 -0700 (PDT) Received: from bender.baylibre.local (wal59-h01-176-150-251-154.dsl.sta.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id q19sm16701186wra.89.2019.09.19.02.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 02:36:30 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com Cc: Neil Armstrong , linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] clk: meson: g12a: set CLK_MUX_ROUND_CLOSEST on the cpu clock muxes Date: Thu, 19 Sep 2019 11:36:26 +0200 Message-Id: <20190919093627.21245-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190919093627.21245-1-narmstrong@baylibre.com> References: <20190919093627.21245-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When setting the 100MHz, 500MHz, 666MHz and 1GHz rate for CPU clocks, CCF will use the SYS_PLL to handle these frequencies, but: - using FIXED_PLL derived FCLK_DIV2/DIV3 clocks is more precise - the Amlogic G12A/G12B/SM1 Suspend handling in firmware doesn't handle entering suspend using SYS_PLL for these frequencies Adding CLK_MUX_ROUND_CLOSEST on all the muxes of the non-SYS_PLL cpu clock tree helps CCF always selecting the FCLK_DIV2/DIV3 as source for these frequencies. Fixes: ffae8475b90c ("clk: meson: g12a: add notifiers to handle cpu clock change") Signed-off-by: Neil Armstrong --- drivers/clk/meson/g12a.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index 33c7e04b4a82..b3af61cc6fb9 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -343,6 +343,7 @@ static struct clk_regmap g12a_cpu_clk_premux0 = { .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x3, .shift = 0, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk_dyn0_sel", @@ -409,6 +410,7 @@ static struct clk_regmap g12a_cpu_clk_postmux0 = { .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x1, .shift = 2, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk_dyn0", @@ -465,6 +467,7 @@ static struct clk_regmap g12a_cpu_clk_dyn = { .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x1, .shift = 10, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk_dyn", @@ -484,6 +487,7 @@ static struct clk_regmap g12a_cpu_clk = { .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x1, .shift = 11, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk", @@ -503,6 +507,7 @@ static struct clk_regmap g12b_cpu_clk = { .offset = HHI_SYS_CPU_CLK_CNTL0, .mask = 0x1, .shift = 11, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpu_clk", @@ -522,6 +527,7 @@ static struct clk_regmap g12b_cpub_clk_premux0 = { .offset = HHI_SYS_CPUB_CLK_CNTL, .mask = 0x3, .shift = 0, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpub_clk_dyn0_sel", @@ -567,6 +573,7 @@ static struct clk_regmap g12b_cpub_clk_postmux0 = { .offset = HHI_SYS_CPUB_CLK_CNTL, .mask = 0x1, .shift = 2, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpub_clk_dyn0", @@ -644,6 +651,7 @@ static struct clk_regmap g12b_cpub_clk_dyn = { .offset = HHI_SYS_CPUB_CLK_CNTL, .mask = 0x1, .shift = 10, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpub_clk_dyn", @@ -663,6 +671,7 @@ static struct clk_regmap g12b_cpub_clk = { .offset = HHI_SYS_CPUB_CLK_CNTL, .mask = 0x1, .shift = 11, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cpub_clk", -- 2.22.0