diff mbox series

[4/5] cpufreq: Add support for RISC-V CPU Frequency scaling drivers

Message ID 20231214103342.30775-5-fusibrandon13@gmail.com (mailing list archive)
State New, archived
Delegated to: viresh kumar
Headers show
Series cpufreq support for the D1 | expand

Commit Message

Brandon Cheo Fusi Dec. 14, 2023, 10:33 a.m. UTC
Add Kconfig file for cpufreq scaling drivers that can handle RISC-V
CPUs. An entry is included for the Allwinner H6 cpufreq driver that
works with D1.

Signed-off-by: Brandon Cheo Fusi <fusibrandon13@gmail.com>
---
 drivers/cpufreq/Kconfig       |  4 ++++
 drivers/cpufreq/Kconfig.riscv | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 drivers/cpufreq/Kconfig.riscv

Comments

Viresh Kumar Dec. 14, 2023, 11:17 a.m. UTC | #1
On 14-12-23, 11:33, Brandon Cheo Fusi wrote:
> Add Kconfig file for cpufreq scaling drivers that can handle RISC-V
> CPUs. An entry is included for the Allwinner H6 cpufreq driver that
> works with D1.
> 
> Signed-off-by: Brandon Cheo Fusi <fusibrandon13@gmail.com>
> ---
>  drivers/cpufreq/Kconfig       |  4 ++++
>  drivers/cpufreq/Kconfig.riscv | 16 ++++++++++++++++
>  2 files changed, 20 insertions(+)
>  create mode 100644 drivers/cpufreq/Kconfig.riscv

We don't have a separate kconfig file for each architecture. Only if
there are too many entries for an architecture, we add a new file.
Brandon Cheo Fusi Dec. 15, 2023, 3:17 p.m. UTC | #2
On Thu, Dec 14, 2023 at 12:17 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 14-12-23, 11:33, Brandon Cheo Fusi wrote:
> > Add Kconfig file for cpufreq scaling drivers that can handle RISC-V
> > CPUs. An entry is included for the Allwinner H6 cpufreq driver that
> > works with D1.
> >
> > Signed-off-by: Brandon Cheo Fusi <fusibrandon13@gmail.com>
> > ---
> >  drivers/cpufreq/Kconfig       |  4 ++++
> >  drivers/cpufreq/Kconfig.riscv | 16 ++++++++++++++++
> >  2 files changed, 20 insertions(+)
> >  create mode 100644 drivers/cpufreq/Kconfig.riscv
>
> We don't have a separate kconfig file for each architecture. Only if
> there are too many entries for an architecture, we add a new file.
>
> --
> viresh

The sun50i cpufreq driver is currently only available when CONFIG_ARM or
CONFIG_ARM64 is selected, so this was the only decent way I could think
of making it accessible on either one of CONFIG_(ARM | ARM64 | RISC-V).
Any suggestions for a better workaround ?

Also I think future cpufreq drivers for RISC-V are going to happen, so we
might as well have the Kconfig file.

Kind Regards,
Brandon.
Samuel Holland Dec. 15, 2023, 9:09 p.m. UTC | #3
Hi Brandon,

On 12/15/23 09:17, Brandon Cheo Fusi wrote:
> On Thu, Dec 14, 2023 at 12:17 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>
>> On 14-12-23, 11:33, Brandon Cheo Fusi wrote:
>>> Add Kconfig file for cpufreq scaling drivers that can handle RISC-V
>>> CPUs. An entry is included for the Allwinner H6 cpufreq driver that
>>> works with D1.
>>>
>>> Signed-off-by: Brandon Cheo Fusi <fusibrandon13@gmail.com>
>>> ---
>>>  drivers/cpufreq/Kconfig       |  4 ++++
>>>  drivers/cpufreq/Kconfig.riscv | 16 ++++++++++++++++
>>>  2 files changed, 20 insertions(+)
>>>  create mode 100644 drivers/cpufreq/Kconfig.riscv
>>
>> We don't have a separate kconfig file for each architecture. Only if
>> there are too many entries for an architecture, we add a new file.
>>
>> --
>> viresh
> 
> The sun50i cpufreq driver is currently only available when CONFIG_ARM or
> CONFIG_ARM64 is selected, so this was the only decent way I could think
> of making it accessible on either one of CONFIG_(ARM | ARM64 | RISC-V).
> Any suggestions for a better workaround ?

Move the option to the main drivers/cpufreq/Kconfig, like QORIQ_CPUFREQ,
which is also used with multiple architectures (PowerPC and ARM, in that
case). We don't want two options for the same driver.

Regards,
Samuel
Viresh Kumar Dec. 18, 2023, 6:09 a.m. UTC | #4
On 15-12-23, 15:09, Samuel Holland wrote:
> Move the option to the main drivers/cpufreq/Kconfig, like QORIQ_CPUFREQ,
> which is also used with multiple architectures (PowerPC and ARM, in that
> case). We don't want two options for the same driver.

+1
diff mbox series

Patch

diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 35efb53d5..4bef39fed 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -239,6 +239,10 @@  if PPC32 || PPC64
 source "drivers/cpufreq/Kconfig.powerpc"
 endif
 
+if RISCV
+source "drivers/cpufreq/Kconfig.riscv"
+endif
+
 if MIPS
 config BMIPS_CPUFREQ
 	tristate "BMIPS CPUfreq Driver"
diff --git a/drivers/cpufreq/Kconfig.riscv b/drivers/cpufreq/Kconfig.riscv
new file mode 100644
index 000000000..025c7c439
--- /dev/null
+++ b/drivers/cpufreq/Kconfig.riscv
@@ -0,0 +1,16 @@ 
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# RISC-V CPU Frequency scaling drivers
+#
+
+config ALLWINNER_SUN50I_CPUFREQ_NVMEM
+	tristate "Allwinner nvmem based SUN50I CPUFreq driver"
+	depends on ARCH_SUNXI
+	depends on NVMEM_SUNXI_SID
+	select PM_OPP
+	help
+	  This adds the nvmem based CPUFreq driver for Allwinner
+	  H6/D1 SoCs.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called sun50i-cpufreq-nvmem.
\ No newline at end of file