From: Andre Przywara <andre.przywara@arm.com>
To: Cody Eksal <masterr3c0rd@epochal.quest>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Yangtao Li <tiny.windzz@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Conor Dooley <conor+dt@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Nishanth Menon <nm@ti.com>, Rob Herring <robh@kernel.org>,
Stephen Boyd <sboyd@kernel.org>, Vinod Koul <vkoul@kernel.org>,
Viresh Kumar <vireshk@kernel.org>,
Parthiban <parthiban@linumiz.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v2 12/13] cpufreq: sun50i: add a100 cpufreq support
Date: Thu, 31 Oct 2024 12:18:55 +0000 [thread overview]
Message-ID: <20241031121855.179b44a0@donnerap.manchester.arm.com> (raw)
In-Reply-To: <20241031070232.1793078-13-masterr3c0rd@epochal.quest>
On Thu, 31 Oct 2024 04:02:25 -0300
Cody Eksal <masterr3c0rd@epochal.quest> wrote:
> From: Shuosheng Huang <huangshuosheng@allwinnertech.com>
>
> Let's add cpufreq nvmem based for allwinner a100 soc. It's similar to h6,
> let us use efuse_xlate to extract the differentiated part.
>
> Signed-off-by: Shuosheng Huang <huangshuosheng@allwinnertech.com>
> [masterr3c0rd@epochal.quest: add A100 to opp_match_list]
> Signed-off-by: Cody Eksal <masterr3c0rd@epochal.quest>
Looks good to me, and seems to work on my Teclast P80 tablet, so:
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Thanks,
Andre
> ---
> Changes in V2:
> - Add the A100 to the cpufreq-dt-platdev blacklist.
>
> drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
> drivers/cpufreq/sun50i-cpufreq-nvmem.c | 28 ++++++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
> index 18942bfe9c95..2a3e8bd317c9 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -103,6 +103,7 @@ static const struct of_device_id allowlist[] __initconst = {
> * platforms using "operating-points-v2" property.
> */
> static const struct of_device_id blocklist[] __initconst = {
> + { .compatible = "allwinner,sun50i-a100" },
> { .compatible = "allwinner,sun50i-h6", },
> { .compatible = "allwinner,sun50i-h616", },
> { .compatible = "allwinner,sun50i-h618", },
> diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> index 293921acec93..3a29c026d364 100644
> --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> @@ -22,6 +22,9 @@
> #define NVMEM_MASK 0x7
> #define NVMEM_SHIFT 5
>
> +#define SUN50I_A100_NVMEM_MASK 0xf
> +#define SUN50I_A100_NVMEM_SHIFT 12
> +
> static struct platform_device *cpufreq_dt_pdev, *sun50i_cpufreq_pdev;
>
> struct sunxi_cpufreq_data {
> @@ -45,6 +48,23 @@ static u32 sun50i_h6_efuse_xlate(u32 speedbin)
> return 0;
> }
>
> +static u32 sun50i_a100_efuse_xlate(u32 speedbin)
> +{
> + u32 efuse_value;
> +
> + efuse_value = (speedbin >> SUN50I_A100_NVMEM_SHIFT) &
> + SUN50I_A100_NVMEM_MASK;
> +
> + switch (efuse_value) {
> + case 0b100:
> + return 2;
> + case 0b010:
> + return 1;
> + default:
> + return 0;
> + }
> +}
> +
> static int get_soc_id_revision(void)
> {
> #ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
> @@ -108,6 +128,10 @@ static struct sunxi_cpufreq_data sun50i_h6_cpufreq_data = {
> .efuse_xlate = sun50i_h6_efuse_xlate,
> };
>
> +static struct sunxi_cpufreq_data sun50i_a100_cpufreq_data = {
> + .efuse_xlate = sun50i_a100_efuse_xlate,
> +};
> +
> static struct sunxi_cpufreq_data sun50i_h616_cpufreq_data = {
> .efuse_xlate = sun50i_h616_efuse_xlate,
> };
> @@ -116,6 +140,9 @@ static const struct of_device_id cpu_opp_match_list[] = {
> { .compatible = "allwinner,sun50i-h6-operating-points",
> .data = &sun50i_h6_cpufreq_data,
> },
> + { .compatible = "allwinner,sun50i-a100-operating-points",
> + .data = &sun50i_a100_cpufreq_data,
> + },
> { .compatible = "allwinner,sun50i-h616-operating-points",
> .data = &sun50i_h616_cpufreq_data,
> },
> @@ -291,6 +318,7 @@ static struct platform_driver sun50i_cpufreq_driver = {
>
> static const struct of_device_id sun50i_cpufreq_match_list[] = {
> { .compatible = "allwinner,sun50i-h6" },
> + { .compatible = "allwinner,sun50i-a100" },
> { .compatible = "allwinner,sun50i-h616" },
> { .compatible = "allwinner,sun50i-h618" },
> { .compatible = "allwinner,sun50i-h700" },
next prev parent reply other threads:[~2024-10-31 12:19 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 7:02 [PATCH v2 00/13] sunxi: A100/A133 second stage support Cody Eksal
2024-10-31 7:02 ` [PATCH v2 01/13] arm64: dts: allwinner: A100: Add PMU mode Cody Eksal
2024-10-31 7:02 ` [PATCH v2 02/13] arm64: dts: allwinner: a100: add watchdog node Cody Eksal
2024-10-31 14:14 ` Parthiban
2024-10-31 7:02 ` [PATCH v2 03/13] dt-bindings: phy: sun50i-a64: add a100 compatible Cody Eksal
2024-10-31 11:36 ` Andre Przywara
2024-10-31 14:35 ` Cody Eksal
2024-10-31 7:02 ` [PATCH v2 05/13] dt-bindings: usb: sunxi-musb: Add A100 compatible string Cody Eksal
2024-10-31 7:42 ` Krzysztof Kozlowski
2024-10-31 7:02 ` [PATCH v2 06/13] arm64: dts: allwinner: a100: add usb related nodes Cody Eksal
2024-10-31 11:55 ` Andre Przywara
2024-11-01 5:33 ` Parthiban
2024-11-01 6:14 ` Cody Eksal
2024-10-31 7:02 ` [PATCH v2 07/13] arm64: allwinner: A100: enable EHCI, OHCI and USB PHY nodes in Perf1 Cody Eksal
2024-11-02 11:29 ` Chen-Yu Tsai
2024-10-31 7:02 ` [PATCH v2 08/13] clk: sunxi-ng: a100: enable MMC clock reparenting Cody Eksal
2024-10-31 12:08 ` Andre Przywara
2024-11-02 21:44 ` Cody Eksal
2024-11-03 2:09 ` Andre Przywara
2024-11-07 1:46 ` Andre Przywara
2024-10-31 7:02 ` [PATCH v2 09/13] arm64: allwinner: a100: Add MMC related nodes Cody Eksal
2024-10-31 7:02 ` [PATCH v2 10/13] arm64: dts: allwinner: a100: perf1: Add eMMC and MMC node Cody Eksal
2024-11-02 11:48 ` Chen-Yu Tsai
2024-11-02 21:23 ` Cody Eksal
2024-11-03 2:54 ` Chen-Yu Tsai
2024-10-31 7:02 ` [PATCH v2 11/13] dt-bindings: opp: h6: Add A100 operating points Cody Eksal
2024-10-31 7:42 ` Krzysztof Kozlowski
2024-10-31 12:10 ` Andre Przywara
2024-11-02 11:50 ` Chen-Yu Tsai
2024-10-31 7:02 ` [PATCH v2 12/13] cpufreq: sun50i: add a100 cpufreq support Cody Eksal
2024-10-31 12:18 ` Andre Przywara [this message]
2024-10-31 14:19 ` Parthiban
2024-11-11 4:13 ` Viresh Kumar
2024-11-11 5:30 ` Chen-Yu Tsai
2024-11-11 5:55 ` Viresh Kumar
2024-11-18 15:36 ` Rob Herring
2025-01-09 22:53 ` Rob Herring
2025-01-10 3:56 ` Viresh Kumar
2024-10-31 7:02 ` [PATCH v2 13/13] arm64: dts: allwinner: a100: Add CPU Operating Performance Points table Cody Eksal
2024-11-02 11:46 ` (subset) [PATCH v2 00/13] sunxi: A100/A133 second stage support Chen-Yu Tsai
2024-11-10 9:25 ` Chen-Yu Tsai
2025-02-22 13:25 ` Chen-Yu Tsai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031121855.179b44a0@donnerap.manchester.arm.com \
--to=andre.przywara@arm.com \
--cc=conor+dt@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=masterr3c0rd@epochal.quest \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=nm@ti.com \
--cc=parthiban@linumiz.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=sboyd@kernel.org \
--cc=tiny.windzz@gmail.com \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@kernel.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox