cpufreq: Add Loongson machine dependencies
Subsystems (2)
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).
--- drivers/cpufreq/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig +2 -0
@@ -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
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.cusesRST_CPU_ENandRST_CPU, neither of which is defined inasm/mach-loongson32/regs-clk.hunlessCONFIG_LOONGSON1_LS1B=y, andloongson2_cpufreq.creferences loongson2_clockmod_table[], which is only defined inarch/mips/loongson64/lemote-2f/clock.c, i.e. whenCONFIG_LEMOTE_MACH2F=y.Add these dependencies to
Kconfigto avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).Signed-off-by James Hogan <[email protected]>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@@ -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
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.cusesRST_CPU_ENandRST_CPU, neither of which is defined inasm/mach-loongson32/regs-clk.hunlessCONFIG_LOONGSON1_LS1B=y, andloongson2_cpufreq.creferences loongson2_clockmod_table[], which is only defined inarch/mips/loongson64/lemote-2f/clock.c, i.e. whenCONFIG_LEMOTE_MACH2F=y.Add these dependencies to
Kconfigto avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).Signed-off-by James Hogan <[email protected]>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@@ -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
Hi Huacai
Quoted 2 lines · Huacai Chen
I think it is better to make
LOONGSON1_CPUFREQdepends onCPU_LOONGSON1, andLOONGSON2_CPUFREQdepends onCPU_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.cusesRST_CPU_ENandRST_CPU, neither of which is defined inasm/mach-loongson32/regs-clk.hunlessCONFIG_LOONGSON1_LS1B=y, andloongson2_cpufreq.creferences loongson2_clockmod_table[], which is only defined inarch/mips/loongson64/lemote-2f/clock.c, i.e. whenCONFIG_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