diff mbox series

clk: samsung: allow compile testing of Exynos, S3C64xx and S5Pv210

Message ID 20201119164509.754851-1-krzk@kernel.org (mailing list archive)
State Not Applicable
Headers show
Series clk: samsung: allow compile testing of Exynos, S3C64xx and S5Pv210 | expand

Commit Message

Krzysztof Kozlowski Nov. 19, 2020, 4:45 p.m. UTC
So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
respective SOC/ARCH Kconfig option.  On a kernel built for selected
SoCs, this allowed to build only limited set of matching clock drivers.
However compile testing was not possible in such case as Makefile object
depent on SOC/ARCH option.

Add separate Kconfig options for each of them to be able to compile
test.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/clk/samsung/Kconfig  | 67 ++++++++++++++++++++++++++++++++++--
 drivers/clk/samsung/Makefile | 22 ++++++------
 include/linux/clk/samsung.h  |  4 +--
 3 files changed, 78 insertions(+), 15 deletions(-)

Comments

Chanwoo Choi Nov. 20, 2020, 10:39 a.m. UTC | #1
On 11/20/20 1:45 AM, Krzysztof Kozlowski wrote:
> So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
> respective SOC/ARCH Kconfig option.  On a kernel built for selected
> SoCs, this allowed to build only limited set of matching clock drivers.
> However compile testing was not possible in such case as Makefile object
> depent on SOC/ARCH option.
> 
> Add separate Kconfig options for each of them to be able to compile
> test.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/clk/samsung/Kconfig  | 67 ++++++++++++++++++++++++++++++++++--
>  drivers/clk/samsung/Makefile | 22 ++++++------
>  include/linux/clk/samsung.h  |  4 +--
>  3 files changed, 78 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/clk/samsung/Kconfig b/drivers/clk/samsung/Kconfig
> index 7e9c186e57ef..0441c4f73ac9 100644
> --- a/drivers/clk/samsung/Kconfig
> +++ b/drivers/clk/samsung/Kconfig
> @@ -2,10 +2,73 @@
>  # Recent Exynos platforms should just select COMMON_CLK_SAMSUNG:
>  config COMMON_CLK_SAMSUNG
>  	bool "Samsung Exynos clock controller support" if COMPILE_TEST
> -	# Clocks on ARM64 SoCs (e.g. Exynos5433, Exynos7) are chosen by
> -	# EXYNOS_ARM64_COMMON_CLK to avoid building them on ARMv7:
> +	select S3C64XX_COMMON_CLK if ARM && ARCH_S3C64XX
> +	select S5PV210_COMMON_CLK if ARM && ARCH_S5PV210
> +	select EXYNOS_3250_COMMON_CLK if ARM && SOC_EXYNOS3250
> +	select EXYNOS_4_COMMON_CLK if ARM && ARCH_EXYNOS4
> +	select EXYNOS_5250_COMMON_CLK if ARM && SOC_EXYNOS5250
> +	select EXYNOS_5260_COMMON_CLK if ARM && SOC_EXYNOS5260
> +	select EXYNOS_5410_COMMON_CLK if ARM && SOC_EXYNOS5410
> +	select EXYNOS_5420_COMMON_CLK if ARM && SOC_EXYNOS5420
>  	select EXYNOS_ARM64_COMMON_CLK if ARM64 && ARCH_EXYNOS
>  
> +config S3C64XX_COMMON_CLK
> +	bool "Samsung S3C64xx clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung S3C64xx SoCs.
> +	  Choose Y here only if you build for this SoC.
> +
> +config S5PV210_COMMON_CLK
> +	bool "Samsung S5Pv210 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung S5Pv210 SoCs.
> +	  Choose Y here only if you build for this SoC.
> +
> +config EXYNOS_3250_COMMON_CLK
> +	bool "Samsung Exynos3250 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos3250 SoCs. Choose Y here only if you build for this SoC.
> +
> +config EXYNOS_4_COMMON_CLK
> +	bool "Samsung Exynos4 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos4212 and Exynos4412 SoCs. Choose Y here only if you build for
> +	  this SoC.
> +
> +config EXYNOS_5250_COMMON_CLK
> +	bool "Samsung Exynos5250 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos5250 SoCs. Choose Y here only if you build for this SoC.
> +
> +config EXYNOS_5260_COMMON_CLK
> +	bool "Samsung Exynos5260 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos5260 SoCs. Choose Y here only if you build for this SoC.
> +
> +config EXYNOS_5410_COMMON_CLK
> +	bool "Samsung Exynos5410 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos5410 SoCs. Choose Y here only if you build for this SoC.
> +
> +config EXYNOS_5420_COMMON_CLK
> +	bool "Samsung Exynos5420 clock controller support" if COMPILE_TEST
> +	depends on COMMON_CLK_SAMSUNG
> +	help
> +	  Support for the clock controller present on the Samsung
> +	  Exynos5420 SoCs. Choose Y here only if you build for this SoC.
> +
>  config EXYNOS_ARM64_COMMON_CLK
>  	bool "Samsung Exynos ARMv8-family clock controller support" if COMPILE_TEST
>  	depends on COMMON_CLK_SAMSUNG
> diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile
> index 6891b087acff..028b2e27a37e 100644
> --- a/drivers/clk/samsung/Makefile
> +++ b/drivers/clk/samsung/Makefile
> @@ -4,15 +4,15 @@
>  #
>  
>  obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o clk-cpu.o
> -obj-$(CONFIG_SOC_EXYNOS3250)	+= clk-exynos3250.o
> -obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
> -obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4412-isp.o
> -obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5250.o
> -obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5-subcmu.o
> -obj-$(CONFIG_SOC_EXYNOS5260)	+= clk-exynos5260.o
> -obj-$(CONFIG_SOC_EXYNOS5410)	+= clk-exynos5410.o
> -obj-$(CONFIG_SOC_EXYNOS5420)	+= clk-exynos5420.o
> -obj-$(CONFIG_SOC_EXYNOS5420)	+= clk-exynos5-subcmu.o
> +obj-$(CONFIG_EXYNOS_3250_COMMON_CLK)	+= clk-exynos3250.o
> +obj-$(CONFIG_EXYNOS_4_COMMON_CLK)	+= clk-exynos4.o
> +obj-$(CONFIG_EXYNOS_4_COMMON_CLK)	+= clk-exynos4412-isp.o
> +obj-$(CONFIG_EXYNOS_5250_COMMON_CLK)	+= clk-exynos5250.o
> +obj-$(CONFIG_EXYNOS_5250_COMMON_CLK)	+= clk-exynos5-subcmu.o
> +obj-$(CONFIG_EXYNOS_5260_COMMON_CLK)	+= clk-exynos5260.o
> +obj-$(CONFIG_EXYNOS_5410_COMMON_CLK)	+= clk-exynos5410.o
> +obj-$(CONFIG_EXYNOS_5420_COMMON_CLK)	+= clk-exynos5420.o
> +obj-$(CONFIG_EXYNOS_5420_COMMON_CLK)	+= clk-exynos5-subcmu.o
>  obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK)	+= clk-exynos5433.o
>  obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o
>  obj-$(CONFIG_EXYNOS_CLKOUT)	+= clk-exynos-clkout.o
> @@ -21,5 +21,5 @@ obj-$(CONFIG_S3C2410_COMMON_CLK)+= clk-s3c2410.o
>  obj-$(CONFIG_S3C2410_COMMON_DCLK)+= clk-s3c2410-dclk.o
>  obj-$(CONFIG_S3C2412_COMMON_CLK)+= clk-s3c2412.o
>  obj-$(CONFIG_S3C2443_COMMON_CLK)+= clk-s3c2443.o
> -obj-$(CONFIG_ARCH_S3C64XX)	+= clk-s3c64xx.o
> -obj-$(CONFIG_ARCH_S5PV210)	+= clk-s5pv210.o clk-s5pv210-audss.o
> +obj-$(CONFIG_S3C64XX_COMMON_CLK)	+= clk-s3c64xx.o
> +obj-$(CONFIG_S5PV210_COMMON_CLK)	+= clk-s5pv210.o clk-s5pv210-audss.o
> diff --git a/include/linux/clk/samsung.h b/include/linux/clk/samsung.h
> index 79097e365f7f..38b774001712 100644
> --- a/include/linux/clk/samsung.h
> +++ b/include/linux/clk/samsung.h
> @@ -10,7 +10,7 @@
>  
>  struct device_node;
>  
> -#ifdef CONFIG_ARCH_S3C64XX
> +#ifdef CONFIG_S3C64XX_COMMON_CLK
>  void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f,
>  		      unsigned long xusbxti_f, bool s3c6400,
>  		      void __iomem *base);
> @@ -19,7 +19,7 @@ static inline void s3c64xx_clk_init(struct device_node *np,
>  				    unsigned long xtal_f,
>  				    unsigned long xusbxti_f,
>  				    bool s3c6400, void __iomem *base) { }
> -#endif /* CONFIG_ARCH_S3C64XX */
> +#endif /* CONFIG_S3C64XX_COMMON_CLK */
>  
>  #ifdef CONFIG_S3C2410_COMMON_CLK
>  void s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,
> 

It looks good to me for compile testing. Thanks.

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Sylwester Nawrocki Nov. 20, 2020, 4:36 p.m. UTC | #2
On 11/19/20 17:45, Krzysztof Kozlowski wrote:
> So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
> respective SOC/ARCH Kconfig option.  On a kernel built for selected
> SoCs, this allowed to build only limited set of matching clock drivers.
> However compile testing was not possible in such case as Makefile object
> depent on SOC/ARCH option.

"objects depend" or "object depends" ?

> Add separate Kconfig options for each of them to be able to compile
> test.
> 
> Signed-off-by: Krzysztof Kozlowski<krzk@kernel.org>

The patch look good to me, thanks.
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

I guess it's best now to merge it through your tree as it depends on 
patches already sent to arm-soc? Next time it might be better to use 
immutable branches right away to keep the clk changes in the clk 
maintainer's tree.

--
Regards,
Sylwester
Krzysztof Kozlowski Nov. 22, 2020, 11:34 a.m. UTC | #3
On Fri, Nov 20, 2020 at 05:36:35PM +0100, Sylwester Nawrocki wrote:
> On 11/19/20 17:45, Krzysztof Kozlowski wrote:
> > So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
> > respective SOC/ARCH Kconfig option.  On a kernel built for selected
> > SoCs, this allowed to build only limited set of matching clock drivers.
> > However compile testing was not possible in such case as Makefile object
> > depent on SOC/ARCH option.
> 
> "objects depend" or "object depends" ?

"object depends"

> 
> > Add separate Kconfig options for each of them to be able to compile
> > test.
> > 
> > Signed-off-by: Krzysztof Kozlowski<krzk@kernel.org>
> 
> The patch look good to me, thanks.
> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> 
> I guess it's best now to merge it through your tree as it depends on 
> patches already sent to arm-soc? Next time it might be better to use 
> immutable branches right away to keep the clk changes in the clk 
> maintainer's tree.

At that time I had only one clk patch so I did not put it on separate
branch.

Anyway, this does not depend on the clkout patches and only minor patch
adjustement is needed. Cherry-pick can solve it (you would need to apply
on next/master and then cherry pick) or I can resend you one rebased on
linus/master.

There should be no conflicts when merging later into next or linus.

I propose you should take it via clk tree.

Best regards,
Krzysztof
Sylwester Nawrocki Nov. 23, 2020, 10:10 a.m. UTC | #4
On 11/22/20 12:34, Krzysztof Kozlowski wrote:
> On Fri, Nov 20, 2020 at 05:36:35PM +0100, Sylwester Nawrocki wrote:
>> On 11/19/20 17:45, Krzysztof Kozlowski wrote:
>>> So far all Exynos, S3C64xx and S5Pv210 clock units were selected by
>>> respective SOC/ARCH Kconfig option.  On a kernel built for selected
>>> SoCs, this allowed to build only limited set of matching clock drivers.
>>> However compile testing was not possible in such case as Makefile object
>>> depent on SOC/ARCH option.
>>
>> "objects depend" or "object depends" ?
> 
> "object depends"
> 
>>> Add separate Kconfig options for each of them to be able to compile
>>> test.
>>>
>>> Signed-off-by: Krzysztof Kozlowski<krzk@kernel.org>
>>
>> The patch look good to me, thanks.
>> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>
>> I guess it's best now to merge it through your tree as it depends on
>> patches already sent to arm-soc? Next time it might be better to use
>> immutable branches right away to keep the clk changes in the clk
>> maintainer's tree.
> 
> At that time I had only one clk patch so I did not put it on separate
> branch.
> 
> Anyway, this does not depend on the clkout patches and only minor patch
> adjustement is needed. Cherry-pick can solve it (you would need to apply
> on next/master and then cherry pick) or I can resend you one rebased on
> linus/master.
> 
> There should be no conflicts when merging later into next or linus.
> 
> I propose you should take it via clk tree.

Indeed, the conflict is minimal, I should have checked with git cherry-pick
once I found a branch where the patch applied cleanly. I have corrected
the typo an applied, thank you!

--
Regards,
Sylwester
diff mbox series

Patch

diff --git a/drivers/clk/samsung/Kconfig b/drivers/clk/samsung/Kconfig
index 7e9c186e57ef..0441c4f73ac9 100644
--- a/drivers/clk/samsung/Kconfig
+++ b/drivers/clk/samsung/Kconfig
@@ -2,10 +2,73 @@ 
 # Recent Exynos platforms should just select COMMON_CLK_SAMSUNG:
 config COMMON_CLK_SAMSUNG
 	bool "Samsung Exynos clock controller support" if COMPILE_TEST
-	# Clocks on ARM64 SoCs (e.g. Exynos5433, Exynos7) are chosen by
-	# EXYNOS_ARM64_COMMON_CLK to avoid building them on ARMv7:
+	select S3C64XX_COMMON_CLK if ARM && ARCH_S3C64XX
+	select S5PV210_COMMON_CLK if ARM && ARCH_S5PV210
+	select EXYNOS_3250_COMMON_CLK if ARM && SOC_EXYNOS3250
+	select EXYNOS_4_COMMON_CLK if ARM && ARCH_EXYNOS4
+	select EXYNOS_5250_COMMON_CLK if ARM && SOC_EXYNOS5250
+	select EXYNOS_5260_COMMON_CLK if ARM && SOC_EXYNOS5260
+	select EXYNOS_5410_COMMON_CLK if ARM && SOC_EXYNOS5410
+	select EXYNOS_5420_COMMON_CLK if ARM && SOC_EXYNOS5420
 	select EXYNOS_ARM64_COMMON_CLK if ARM64 && ARCH_EXYNOS
 
+config S3C64XX_COMMON_CLK
+	bool "Samsung S3C64xx clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung S3C64xx SoCs.
+	  Choose Y here only if you build for this SoC.
+
+config S5PV210_COMMON_CLK
+	bool "Samsung S5Pv210 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung S5Pv210 SoCs.
+	  Choose Y here only if you build for this SoC.
+
+config EXYNOS_3250_COMMON_CLK
+	bool "Samsung Exynos3250 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos3250 SoCs. Choose Y here only if you build for this SoC.
+
+config EXYNOS_4_COMMON_CLK
+	bool "Samsung Exynos4 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos4212 and Exynos4412 SoCs. Choose Y here only if you build for
+	  this SoC.
+
+config EXYNOS_5250_COMMON_CLK
+	bool "Samsung Exynos5250 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos5250 SoCs. Choose Y here only if you build for this SoC.
+
+config EXYNOS_5260_COMMON_CLK
+	bool "Samsung Exynos5260 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos5260 SoCs. Choose Y here only if you build for this SoC.
+
+config EXYNOS_5410_COMMON_CLK
+	bool "Samsung Exynos5410 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos5410 SoCs. Choose Y here only if you build for this SoC.
+
+config EXYNOS_5420_COMMON_CLK
+	bool "Samsung Exynos5420 clock controller support" if COMPILE_TEST
+	depends on COMMON_CLK_SAMSUNG
+	help
+	  Support for the clock controller present on the Samsung
+	  Exynos5420 SoCs. Choose Y here only if you build for this SoC.
+
 config EXYNOS_ARM64_COMMON_CLK
 	bool "Samsung Exynos ARMv8-family clock controller support" if COMPILE_TEST
 	depends on COMMON_CLK_SAMSUNG
diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile
index 6891b087acff..028b2e27a37e 100644
--- a/drivers/clk/samsung/Makefile
+++ b/drivers/clk/samsung/Makefile
@@ -4,15 +4,15 @@ 
 #
 
 obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o clk-cpu.o
-obj-$(CONFIG_SOC_EXYNOS3250)	+= clk-exynos3250.o
-obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
-obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4412-isp.o
-obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5250.o
-obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5-subcmu.o
-obj-$(CONFIG_SOC_EXYNOS5260)	+= clk-exynos5260.o
-obj-$(CONFIG_SOC_EXYNOS5410)	+= clk-exynos5410.o
-obj-$(CONFIG_SOC_EXYNOS5420)	+= clk-exynos5420.o
-obj-$(CONFIG_SOC_EXYNOS5420)	+= clk-exynos5-subcmu.o
+obj-$(CONFIG_EXYNOS_3250_COMMON_CLK)	+= clk-exynos3250.o
+obj-$(CONFIG_EXYNOS_4_COMMON_CLK)	+= clk-exynos4.o
+obj-$(CONFIG_EXYNOS_4_COMMON_CLK)	+= clk-exynos4412-isp.o
+obj-$(CONFIG_EXYNOS_5250_COMMON_CLK)	+= clk-exynos5250.o
+obj-$(CONFIG_EXYNOS_5250_COMMON_CLK)	+= clk-exynos5-subcmu.o
+obj-$(CONFIG_EXYNOS_5260_COMMON_CLK)	+= clk-exynos5260.o
+obj-$(CONFIG_EXYNOS_5410_COMMON_CLK)	+= clk-exynos5410.o
+obj-$(CONFIG_EXYNOS_5420_COMMON_CLK)	+= clk-exynos5420.o
+obj-$(CONFIG_EXYNOS_5420_COMMON_CLK)	+= clk-exynos5-subcmu.o
 obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK)	+= clk-exynos5433.o
 obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o
 obj-$(CONFIG_EXYNOS_CLKOUT)	+= clk-exynos-clkout.o
@@ -21,5 +21,5 @@  obj-$(CONFIG_S3C2410_COMMON_CLK)+= clk-s3c2410.o
 obj-$(CONFIG_S3C2410_COMMON_DCLK)+= clk-s3c2410-dclk.o
 obj-$(CONFIG_S3C2412_COMMON_CLK)+= clk-s3c2412.o
 obj-$(CONFIG_S3C2443_COMMON_CLK)+= clk-s3c2443.o
-obj-$(CONFIG_ARCH_S3C64XX)	+= clk-s3c64xx.o
-obj-$(CONFIG_ARCH_S5PV210)	+= clk-s5pv210.o clk-s5pv210-audss.o
+obj-$(CONFIG_S3C64XX_COMMON_CLK)	+= clk-s3c64xx.o
+obj-$(CONFIG_S5PV210_COMMON_CLK)	+= clk-s5pv210.o clk-s5pv210-audss.o
diff --git a/include/linux/clk/samsung.h b/include/linux/clk/samsung.h
index 79097e365f7f..38b774001712 100644
--- a/include/linux/clk/samsung.h
+++ b/include/linux/clk/samsung.h
@@ -10,7 +10,7 @@ 
 
 struct device_node;
 
-#ifdef CONFIG_ARCH_S3C64XX
+#ifdef CONFIG_S3C64XX_COMMON_CLK
 void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f,
 		      unsigned long xusbxti_f, bool s3c6400,
 		      void __iomem *base);
@@ -19,7 +19,7 @@  static inline void s3c64xx_clk_init(struct device_node *np,
 				    unsigned long xtal_f,
 				    unsigned long xusbxti_f,
 				    bool s3c6400, void __iomem *base) { }
-#endif /* CONFIG_ARCH_S3C64XX */
+#endif /* CONFIG_S3C64XX_COMMON_CLK */
 
 #ifdef CONFIG_S3C2410_COMMON_CLK
 void s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,