Skip to contentSkip to conversation

cpufreq: Add Loongson machine dependencies

PATCH In review James Hogan 3 participants 4 messages Nov 15, 2017 – Nov 17, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: Add Loongson machine dependencies

From: James Hogan <[email protected]>

The MIPS loongson cpufreq drivers don't build unless configured for the correct machine type, due to dependency on machine specific architecture headers and symbols in machine specific platform code.

More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU, neither of which is defined in asm/mach-loongson32/regs-clk.h unless CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references loongson2_clockmod_table[], which is only defined in arch/mips/loongson64/lemote-2f/clock.c, i.e. when CONFIG_LEMOTE_MACH2F=y.

Add these dependencies to Kconfig to avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).

Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Keguang Zhang <[email protected]>
Cc Ralf Baechle <[email protected]>
---
 drivers/cpufreq/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig +2 -0
index 4ebae43118ef..d8addbce40bc 100644
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
 
 config LOONGSON2_CPUFREQ
 	tristate "Loongson2 CPUFreq Driver"
+	depends on LEMOTE_MACH2F
 	help
 	  This option adds a CPUFreq driver for loongson processors which
 	  support software configurable cpu frequency.
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
 
 config LOONGSON1_CPUFREQ
 	tristate "Loongson1 CPUFreq Driver"
+	depends on LOONGSON1_LS1B
 	help
 	  This option adds a CPUFreq driver for loongson1 processors which
 	  support software configurable cpu frequency.
Signature · 1 line
2.14.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 41 lines · James Hogan

From: James Hogan <[email protected]>

The MIPS loongson cpufreq drivers don't build unless configured for the correct machine type, due to dependency on machine specific architecture headers and symbols in machine specific platform code.

More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU, neither of which is defined in asm/mach-loongson32/regs-clk.h unless CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references loongson2_clockmod_table[], which is only defined in arch/mips/loongson64/lemote-2f/clock.c, i.e. when CONFIG_LEMOTE_MACH2F=y.

Add these dependencies to Kconfig to avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).

Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Keguang Zhang <[email protected]>
Cc Ralf Baechle <[email protected]>
---
 drivers/cpufreq/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig +1 -0
index 4ebae43118ef..d8addbce40bc 100644
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
 
 config LOONGSON2_CPUFREQ
 	tristate "Loongson2 CPUFreq Driver"
+	depends on LEMOTE_MACH2F
 	help
 	  This option adds a CPUFreq driver for loongson processors which
 	  support software configurable cpu frequency.

drivers/cpufreq/Kconfig config LOONGSON2_CPUFREQ · line 294

Quoted 7 lines
drivers/cpufreq/Kconfig +1 -0
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
 
 config LOONGSON1_CPUFREQ
 	tristate "Loongson1 CPUFreq Driver"
+	depends on LOONGSON1_LS1B
 	help
 	  This option adds a CPUFreq driver for loongson1 processors which
 	  support software configurable cpu frequency.
Signature · 1 line
viresh
#2 lore raw
In reply to James Hogan

I think it is better to make LOONGSON1_CPUFREQ depends on CPU_LOONGSON1, and LOONGSON2_CPUFREQ depends on CPU_LOONGSON2

Quoted 52 lines · James Hogan

From: James Hogan <[email protected]>

The MIPS loongson cpufreq drivers don't build unless configured for the correct machine type, due to dependency on machine specific architecture headers and symbols in machine specific platform code.

More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU, neither of which is defined in asm/mach-loongson32/regs-clk.h unless CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references loongson2_clockmod_table[], which is only defined in arch/mips/loongson64/lemote-2f/clock.c, i.e. when CONFIG_LEMOTE_MACH2F=y.

Add these dependencies to Kconfig to avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).

Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Keguang Zhang <[email protected]>
Cc Ralf Baechle <[email protected]>
---
 drivers/cpufreq/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig +2 -1
index 4ebae43118ef..d8addbce40bc 100644
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
 
 config LOONGSON2_CPUFREQ
        tristate "Loongson2 CPUFreq Driver"
+       depends on LEMOTE_MACH2F
        help
          This option adds a CPUFreq driver for loongson processors which
          support software configurable cpu frequency.
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
 
 config LOONGSON1_CPUFREQ
        tristate "Loongson1 CPUFreq Driver"
+       depends on LOONGSON1_LS1B
        help
          This option adds a CPUFreq driver for loongson1 processors which
          support software configurable cpu frequency.
--

2.14.1

#3 lore raw

Hi Huacai

Quoted 2 lines · Huacai Chen

I think it is better to make LOONGSON1_CPUFREQ depends on CPU_LOONGSON1, and LOONGSON2_CPUFREQ depends on CPU_LOONGSON2

Yes, that may well be preferable, however as stated below both drivers have stricter dependencies than that which break the build for certain configurations:

Quoted 7 lines · James Hogan
Quoted 6 lines

More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU, neither of which is defined in asm/mach-loongson32/regs-clk.h unless CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references loongson2_clockmod_table[], which is only defined in arch/mips/loongson64/lemote-2f/clock.c, i.e. when CONFIG_LEMOTE_MACH2F=y.

If those issues are fixed such that the drivers build on any respective loongson1 / loongson2 configuration then the dependencies can always be updated again to reflect that.

Cheers
James