From patchwork Fri Sep 6 05:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuan Liu via B4 Relay X-Patchwork-Id: 13793317 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FA6B1304BF; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; cv=none; b=IGpa74cZDZ2/yTQchTPmPoJNUD3OgPN0g5x5MlLmktTq/V32Io0E3fgWuegV+Qs3OAu03EKBUoduvhQJdar9NpOu0kAUGHVwtGwA3uK+ETdz3eqVPHlMiELutFxBDMj9H21+VEZ5nSYYiOKuvVbBBpgMtl8pSJPdmMojjOvwH/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; c=relaxed/simple; bh=I9JprPGgr2Q1JvjMeHkxOvLVu+H/5UNCtWt/M48Ns14=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ojxctj/d2H15xpOjqXh5o2sYCtyNlaZSsF3qJWaF+RzbVkR7zCq5SMVNfNqAHJwHjdNS5eBSnyI1Brgr4rE4QHGS7iqDvXBzDIQklZ+VpkPh3G/ywfTHrA+1nmGuOkgjDX9z9v2ho1F6LesYXB6utLgrAUgJ63dgjYRbl/hpS2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Li+xwak6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Li+xwak6" Received: by smtp.kernel.org (Postfix) with ESMTPS id C1FAFC4CEC8; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725601956; bh=I9JprPGgr2Q1JvjMeHkxOvLVu+H/5UNCtWt/M48Ns14=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Li+xwak6lwSBbAuxqsHiQ70CrZ4YDmU8reJOfqLZE2sDhVY22EzngQQ76gWGEYPwy FR1cP+SB+1+HZWggmz9cIG3X78F4ZPjTIayCiJBPhtNVpw71m/5Ub2/zdw+hucl412 K3v12+KuOYxjdhDPYTXuFr017hkMQUSIqUlR5L4xQKMGV/yxaGisM2QKyQH1LLpQDy nlIcPvGmrQcDgKHp+rNJq+X9ZPEPXqqbyQmoCQR45RbKxSLmJxqEX9x2e5r7iHukpX N9l5t7DGkSlDZy/w1GEGVp7rBQWvm33/Uz7Qri9f7zk5cyNTsVsRX/tf3qSWw6c2X0 X8FCl7YgsFrTg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFD64CD5BDD; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) From: Chuan Liu via B4 Relay Date: Fri, 06 Sep 2024 13:52:33 +0800 Subject: [PATCH 1/4] clk: meson: Support PLL with fixed fractional denominators Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-fix_clk-v1-1-2977ef0d72e7@amlogic.com> References: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> In-Reply-To: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> To: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuan Liu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725601955; l=2567; i=chuan.liu@amlogic.com; s=20240902; h=from:subject:message-id; bh=SoIKZiELa8FSJI7fmIZsiz6qIoB6+tJ8z3x3hDJR/OM=; b=HYGdsd4TDjl5DW9tu+regMVhcuVnmoqEWuyRRdEK8IXmAPDX+KAM5EnWN+mXPd6AJqh1qj1XV DlfZzdykYAXDTgKqia5Qg17K3yaT8fizM93sTUuRayorsD/5VsvJQC+ X-Developer-Key: i=chuan.liu@amlogic.com; a=ed25519; pk=fnKDB+81SoWGKW2GJNFkKy/ULvsDmJZRGBE7pR5Xcpo= X-Endpoint-Received: by B4 Relay for chuan.liu@amlogic.com/20240902 with auth_id=203 X-Original-From: Chuan Liu Reply-To: chuan.liu@amlogic.com From: Chuan Liu Some PLLs with fractional multipliers have fractional denominators that are fixed to "100000" instead of the previous "(1 << pll->frac.width)". Signed-off-by: Chuan Liu --- drivers/clk/meson/clk-pll.c | 22 +++++++++++++++++++--- drivers/clk/meson/clk-pll.h | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index bc570a2ff3a3..f0009c174564 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -36,6 +36,12 @@ #include "clk-regmap.h" #include "clk-pll.h" +/* + * Some PLLs with fractional multipliers have fractional denominators that + * are fixed to "100000" instead of the previous "(1 << pll->frac.width)". + */ +#define FIXED_FRAC_MAX 100000 + static inline struct meson_clk_pll_data * meson_clk_pll_data(struct clk_regmap *clk) { @@ -57,12 +63,17 @@ static unsigned long __pll_params_to_rate(unsigned long parent_rate, struct meson_clk_pll_data *pll) { u64 rate = (u64)parent_rate * m; + unsigned int frac_max; if (frac && MESON_PARM_APPLICABLE(&pll->frac)) { u64 frac_rate = (u64)parent_rate * frac; - rate += DIV_ROUND_UP_ULL(frac_rate, - (1 << pll->frac.width)); + if (pll->flags & CLK_MESON_PLL_FIXED_FRAC_MAX) + frac_max = FIXED_FRAC_MAX; + else + frac_max = (1 << pll->frac.width); + + rate += DIV_ROUND_UP_ULL(frac_rate, frac_max); } return DIV_ROUND_UP_ULL(rate, n); @@ -100,13 +111,18 @@ static unsigned int __pll_params_with_frac(unsigned long rate, unsigned int n, struct meson_clk_pll_data *pll) { - unsigned int frac_max = (1 << pll->frac.width); + unsigned int frac_max; u64 val = (u64)rate * n; /* Bail out if we are already over the requested rate */ if (rate < parent_rate * m / n) return 0; + if (pll->flags & CLK_MESON_PLL_FIXED_FRAC_MAX) + frac_max = FIXED_FRAC_MAX; + else + frac_max = (1 << pll->frac.width); + if (pll->flags & CLK_MESON_PLL_ROUND_CLOSEST) val = DIV_ROUND_CLOSEST_ULL(val * frac_max, parent_rate); else diff --git a/drivers/clk/meson/clk-pll.h b/drivers/clk/meson/clk-pll.h index 7b6b87274073..e996d3727eb1 100644 --- a/drivers/clk/meson/clk-pll.h +++ b/drivers/clk/meson/clk-pll.h @@ -29,6 +29,7 @@ struct pll_mult_range { #define CLK_MESON_PLL_ROUND_CLOSEST BIT(0) #define CLK_MESON_PLL_NOINIT_ENABLED BIT(1) +#define CLK_MESON_PLL_FIXED_FRAC_MAX BIT(2) struct meson_clk_pll_data { struct parm en; From patchwork Fri Sep 6 05:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuan Liu via B4 Relay X-Patchwork-Id: 13793319 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 370671EB3D; Fri, 6 Sep 2024 05:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; cv=none; b=AM1acYqv96PuGONWIfhOym89NEy3qCS79Yq9K7X0cmckQlpYQu1+28gh1v9B/k7BqZqb7Wf65jjdG1B1K7KieqRw6A+jUKTMN4lRtsEibA7j3CzHI4eW9myYdXyOmPo/NBg+OVNfO0o7dxu2AYGeET7Dj68xiHv16IPEM3UYakY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; c=relaxed/simple; bh=S3mFqsYvIRYGegsx08fYvuzsX6Qwu4VsDx147bN5fYc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MNkCNgG8bH2+WQilTrnmK0nokv9UT6KPu+FM8k0YgCfQ60D6eO2CuW7pRunzW+ZW6OPeEXboecjRddNiVOYcLTvqXMchag51SuVTEW5Je8Ei2LaMZkAGdBz5toHYRTPx9X28NRQjL7bTmHsY6iWuk0dUeuZKhsM/JGpuNYul1PI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YCUAAoKk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YCUAAoKk" Received: by smtp.kernel.org (Postfix) with ESMTPS id D445CC4CEC9; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725601956; bh=S3mFqsYvIRYGegsx08fYvuzsX6Qwu4VsDx147bN5fYc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YCUAAoKkVzT2EMiB9d27VUcc2cwtreBRMnj8ACMRtWT68xLZHapaFd8VxJwPlmrNa eXlp8EuZ4p9XYAKbWECgqunAnmbTcFPuU+zFacPZMnNYhA/UO+/Ea8XeXy5AJ/cIHB D3Rerl1wyv3x3kN56BxKQOMO7+xAshSmTWIECqT7GapOdkQQ+3b3ApMdB26UiuiJzs fM0m17qCQEL0zynEU1HvIhsQawZeiSyjfqWCehYLajnCZRze4v3up1WYLrTQEHE+Wo UazDJJwgOj+eQZZArA24Dv+IghHu/ATxBBGjk+1LWiAxTikBDV+o2Mv65hn4gr5Nrc A4uZUJi2Nikwg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3A64CD5BA4; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) From: Chuan Liu via B4 Relay Date: Fri, 06 Sep 2024 13:52:34 +0800 Subject: [PATCH 2/4] clk: meson: c3: pll: hifi_pll frequency is not accurate Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-fix_clk-v1-2-2977ef0d72e7@amlogic.com> References: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> In-Reply-To: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> To: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuan Liu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725601955; l=836; i=chuan.liu@amlogic.com; s=20240902; h=from:subject:message-id; bh=M/IqRKmFgbyGrESbxg574FVPvS6H4iQmlVvP8JBwBMQ=; b=fchMifHrKQ1Qtl5EJeyYwqm5AFN+WR+v2xXBG5jYR5Bv2xcf2EFq/9m415BdgCEIMgcTOHG5p ZLaESWUH2lsD2xDLkYxGRCwkuqlxfJmrulvCl1A4FRfKItaqvJsnTzp X-Developer-Key: i=chuan.liu@amlogic.com; a=ed25519; pk=fnKDB+81SoWGKW2GJNFkKy/ULvsDmJZRGBE7pR5Xcpo= X-Endpoint-Received: by B4 Relay for chuan.liu@amlogic.com/20240902 with auth_id=203 X-Original-From: Chuan Liu Reply-To: chuan.liu@amlogic.com From: Chuan Liu The fractional denominator of C3's hifi_pll fractional multiplier is fixed to 100000, so flag CLK_MESON_PLL_FIXED_FRAC_MAX is added. Fixes: 8a9a129dc565 ("clk: meson: c3: add support for the C3 SoC PLL clock") Signed-off-by: Chuan Liu --- drivers/clk/meson/c3-pll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/meson/c3-pll.c b/drivers/clk/meson/c3-pll.c index 32bd2ed9d304..a350173efe90 100644 --- a/drivers/clk/meson/c3-pll.c +++ b/drivers/clk/meson/c3-pll.c @@ -361,6 +361,7 @@ static struct clk_regmap hifi_pll_dco = { .range = &c3_gp0_pll_mult_range, .init_regs = c3_hifi_init_regs, .init_count = ARRAY_SIZE(c3_hifi_init_regs), + .flags = CLK_MESON_PLL_FIXED_FRAC_MAX, }, .hw.init = &(struct clk_init_data) { .name = "hifi_pll_dco", From patchwork Fri Sep 6 05:52:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuan Liu via B4 Relay X-Patchwork-Id: 13793318 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 370A6130AF6; Fri, 6 Sep 2024 05:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; cv=none; b=YAv1/6f6RFyxNg3kHsVhaSl6PxsWyB79a3ja+pQfIgUEIIHM4Wyj+DfQZdyS1sKZN1ZEePH4DwkfHmF2XQoUSVx30D73TpXn63tu8ewJ9oMHDavsEFBOwP4r8QkfhmhS8OLojorz0Ar0OixPmJSKukp/dxb6Bldg18Z/bJyzGg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; c=relaxed/simple; bh=fZnb4eOdBuuUWog66uoDoe+ZN8bX/78YQ6P8dpOsCpw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D/rXaiHytu9fLa/zaTvYxOwK6+LZ3E9h4aO1CnDMXKLZUgSdbun1KVHjkrseWoEqm4YT/XGkz8/imh9zhTS3/vo06zz/O7ZcicUnZdxBgcY+ubivAPSyp7IBZjxMTu41rjUoKxBfcK7MfiIbCzpSo+4jMBgeQi1y6i43dOknylQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qPqB5D00; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qPqB5D00" Received: by smtp.kernel.org (Postfix) with ESMTPS id DF67AC4CECC; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725601956; bh=fZnb4eOdBuuUWog66uoDoe+ZN8bX/78YQ6P8dpOsCpw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=qPqB5D00PLNLktkk6j0d+tG2sR8G64MDsJr5f4NK8gjwvX6sFtCEr5cL+fabhHS9+ Ym0V8JSSIqYsvxImVvHy62JdxbKrNOH6SZicXNt3P3JAwaaJrVnAnjNhBgGbTY7IxQ Zq2gjICUFWB4AUfqv86yaoKRDRScqyLZu3PCPNjhl8tTbm3ufHkLdBN0wYBouFLs3k Dt6L7hEyHgDN2QqcRozRL1a85o1vwOQyp1nNRTVQ1PI5PICp9Y9IJeG42BB8P+2I2X Su1AHtaLZZtZGEj1INrzEUrfLAN8ezUYe3qnXD/BHBbNBy0S2FAAVjW/sANowTlJsz YedEFGttKdjqQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D671ACE7AB2; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) From: Chuan Liu via B4 Relay Date: Fri, 06 Sep 2024 13:52:35 +0800 Subject: [PATCH 3/4] clk: meson: s4: pll: hifi_pll support fractional multiplier Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-fix_clk-v1-3-2977ef0d72e7@amlogic.com> References: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> In-Reply-To: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> To: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuan Liu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725601955; l=1150; i=chuan.liu@amlogic.com; s=20240902; h=from:subject:message-id; bh=9arg64z8UgGz40ls665ct4U5mW7FxNd6ZQXnRFwYvkw=; b=IogfYnGomgoFnpWnEW+aCeCWGoCRu5sjduQc9ITv14leLMU9GP9TTYlf8pekBb+LXLIr543YO OhNH1AkivSsAjqqOQYQGUTeWrKmzZRYalqnckEaeovZLnZ6Hg/9bc83 X-Developer-Key: i=chuan.liu@amlogic.com; a=ed25519; pk=fnKDB+81SoWGKW2GJNFkKy/ULvsDmJZRGBE7pR5Xcpo= X-Endpoint-Received: by B4 Relay for chuan.liu@amlogic.com/20240902 with auth_id=203 X-Original-From: Chuan Liu Reply-To: chuan.liu@amlogic.com From: Chuan Liu The s4's hifi_pll supports a fractional frequency multiplier, but frac parameters are not configured in the driver. Signed-off-by: Chuan Liu --- drivers/clk/meson/s4-pll.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/s4-pll.c b/drivers/clk/meson/s4-pll.c index b0258933fb9d..a97e19057b05 100644 --- a/drivers/clk/meson/s4-pll.c +++ b/drivers/clk/meson/s4-pll.c @@ -329,7 +329,6 @@ static struct clk_regmap s4_gp0_pll = { * Internal hifi pll emulation configuration parameters */ static const struct reg_sequence s4_hifi_init_regs[] = { - { .reg = ANACTRL_HIFIPLL_CTRL1, .def = 0x00010e56 }, { .reg = ANACTRL_HIFIPLL_CTRL2, .def = 0x00000000 }, { .reg = ANACTRL_HIFIPLL_CTRL3, .def = 0x6a285c00 }, { .reg = ANACTRL_HIFIPLL_CTRL4, .def = 0x65771290 }, @@ -354,6 +353,11 @@ static struct clk_regmap s4_hifi_pll_dco = { .shift = 10, .width = 5, }, + .frac = { + .reg_off = ANACTRL_HIFIPLL_CTRL1, + .shift = 0, + .width = 17, + }, .l = { .reg_off = ANACTRL_HIFIPLL_CTRL0, .shift = 31, From patchwork Fri Sep 6 05:52:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuan Liu via B4 Relay X-Patchwork-Id: 13793320 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6294913957E; Fri, 6 Sep 2024 05:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; cv=none; b=c8Ii+m0g2jGdl4q0XFgIet4EEkjf1vxQyIxs6ojKmvFv4UppRew26+DOXV55SULBhu7IBNKcJw2hAC1KDOY1Ihf/q9FS+SOt263bQtJHscuM5ifev1nanga3X54ViTge4UdKenEntp4s29b+aCCvJ3QeVt2xUj24GB1k32qflWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725601957; c=relaxed/simple; bh=NF51BZTpHooM2jXXouuv+vaFnFg1br4o/kba70yIL58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nD3TPuYFFGjhtgXeI5OatUqeCEMP+AAis/kOtSxomDtt15L2NICMDYknIa4GbYrcSn1mJ0jaXayyozga29DxaYe9cLppnuPrVSuPI5AdxdPPPxwvR48XX1wNnw0mQn0tXDjly9o0ayrmvRbflrEFc+7Nv1uQv5vWIjv0LAyvT20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BFyRRY4N; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BFyRRY4N" Received: by smtp.kernel.org (Postfix) with ESMTPS id F10CAC4CECD; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725601957; bh=NF51BZTpHooM2jXXouuv+vaFnFg1br4o/kba70yIL58=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=BFyRRY4NFXwkS4wHF0H/68dCuyWVIwSnIn0mPwTReAkVJRSePaPLXj5DQtiF83o5G GH/lzZDuQbcIleoQ2bAYMx4i6j7//0biTUnE59KtzQaJQIhpNzCD2l/WU+VwgPnGNA yoNUlLd9uGIoCwUGlkwv+rquLXNWHyILYMdjzLiXpiaDncRYAoWxzkhrursQ714/XK X1ybSLWhNaVRkwHBlZMu/VAWJXvgAnyG7EmdQaydUVXhwGgiQPZEPA7METuLqxnmJv VRQqzxo8/4iHxnESYxXh5FA3VEhFbsYbCqDPZbuip9AcXaYLMM9v996ebNUg/vuzRY VE/eYK9RuUvdQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D0DCE7AB4; Fri, 6 Sep 2024 05:52:36 +0000 (UTC) From: Chuan Liu via B4 Relay Date: Fri, 06 Sep 2024 13:52:36 +0800 Subject: [PATCH 4/4] clk: meson: s4: pll: hifi_pll frequency is not accurate Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-fix_clk-v1-4-2977ef0d72e7@amlogic.com> References: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> In-Reply-To: <20240906-fix_clk-v1-0-2977ef0d72e7@amlogic.com> To: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuan Liu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725601955; l=856; i=chuan.liu@amlogic.com; s=20240902; h=from:subject:message-id; bh=ro5ykdJDKk3Y3xDmm5Xm1OoCgPIR4AFyD2bYCkCFPEE=; b=IZ/yVuY2wLIpYN/mhZKmh78eSRhQWPOQXk6dCtA0gTmfYzo0NItf/y9PgHvE5d6fhK5WadFzv FjJPFyhAp4AAYn5pGpB2DtD/haOcypyrWQKn+SK+pRys+RXlfwNHg5p X-Developer-Key: i=chuan.liu@amlogic.com; a=ed25519; pk=fnKDB+81SoWGKW2GJNFkKy/ULvsDmJZRGBE7pR5Xcpo= X-Endpoint-Received: by B4 Relay for chuan.liu@amlogic.com/20240902 with auth_id=203 X-Original-From: Chuan Liu Reply-To: chuan.liu@amlogic.com From: Chuan Liu The fractional denominator of S4's hifi_pll fractional multiplier is fixed to 100000, so flag CLK_MESON_PLL_FIXED_FRAC_MAX is added. Signed-off-by: Chuan Liu --- drivers/clk/meson/s4-pll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/s4-pll.c b/drivers/clk/meson/s4-pll.c index a97e19057b05..a793ac2e8cc7 100644 --- a/drivers/clk/meson/s4-pll.c +++ b/drivers/clk/meson/s4-pll.c @@ -371,7 +371,8 @@ static struct clk_regmap s4_hifi_pll_dco = { .range = &s4_gp0_pll_mult_range, .init_regs = s4_hifi_init_regs, .init_count = ARRAY_SIZE(s4_hifi_init_regs), - .flags = CLK_MESON_PLL_ROUND_CLOSEST, + .flags = CLK_MESON_PLL_ROUND_CLOSEST | + CLK_MESON_PLL_FIXED_FRAC_MAX, }, .hw.init = &(struct clk_init_data){ .name = "hifi_pll_dco",