Skip to contentSkip to conversation

clocksource: Consolidate SH and ARM mach-shmobile Kconfig bits

PATCH/RFC Magnus Damm 3 participants 3 messages Sep 25, 2013 – Oct 7, 2013

Subsystems (5)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

From: Magnus Damm <[email protected]>

Based on request from Olof Johansson, move ARM mach-shmobile clocksource entries to drivers/clocksource/Kconfig, and at the same time make the SH architecture use these entries.

Kconfig entries for CMT, MTU2, TMU and STI are with this patch now kept in one place. The SH SYS_SUPPORTS_nnn bits are dropped to simplye let the user select the appropriate ones using Kconfig instead of trying to filter available timers based on SoC.

Known issues:
1) Not yet wrappend in menu/endmenu, populates the root driver menu -> proposal: Create separate patch to wrap all the clocksource entries?

2) Should the entries be sorted?
-> proposal: Ignore cosmetic bits

3) What is correct dependency for multiplatform and single platform? -> proposal: Perhaps we should simply default to no?

4) Is single patch across 2 architectures and drivers/clocksource OK? -> proposal: Keep it like this if possible

Not-yet-signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/mach-shmobile/Kconfig |   19 --------------
 arch/sh/Kconfig                |   53 ----------------------------------------
 drivers/clocksource/Kconfig    |   25 ++++++++++++++++++
 3 files changed, 25 insertions(+), 72 deletions(-)
arch/arm/mach-shmobile/Kconfig +0 -19
@@ -307,25 +307,6 @@ config SHMOBILE_TIMER_HZ
 	  SH-Mobile systems using a 32768 Hz RCLK for clock events may want
 	  to select a HZ value such as 128 that can evenly divide RCLK.
 	  A HZ value that does not divide evenly may cause timer drift.
-
-config SH_TIMER_CMT
-	bool "CMT timer driver"
-	default y
-	help
-	  This enables build of the CMT timer driver.
-
-config SH_TIMER_TMU
-	bool "TMU timer driver"
-	default y
-	help
-	  This enables build of the TMU timer driver.
-
-config EM_TIMER_STI
-	bool "STI timer driver"
-	default y
-	help
-	  This enables build of the STI timer driver.
-
 endmenu
 
 endif
arch/sh/Kconfig +0 -53

169 lines not on this page · raw message

drivers/clocksource/Kconfig +25 -0
@@ -109,3 +109,28 @@ config VF_PIT_TIMER
 	bool
 	help
 	  Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
+
+config SH_TIMER_CMT
+	bool "CMT timer driver"
+	default y
+	help
+	  This enables build of the CMT timer driver.
+
+config SH_TIMER_MTU2
+	bool "MTU2 timer driver"
+	default y
+	help
+	  This enables build of the MTU2 timer driver.
+
+config SH_TIMER_TMU
+	bool "TMU timer driver"
+	default y
+	help
+	  This enables build of the TMU timer driver.
+
+config EM_TIMER_STI
+	bool "STI timer driver"
+	default y
+	help
+	  This enables build of the STI timer driver.
+
#1 lore raw
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Based on request from Olof Johansson, move ARM mach-shmobile clocksource entries to drivers/clocksource/Kconfig, and at the same time make the SH architecture use these entries.

Quoted 8 lines

Kconfig entries for CMT, MTU2, TMU and STI are with this patch now kept in one place. The SH SYS_SUPPORTS_nnn bits are dropped to simplye let the user select the appropriate ones using Kconfig instead of trying to filter available timers based on SoC.

Known issues:
1) Not yet wrappend in menu/endmenu, populates the root driver menu -> proposal: Create separate patch to wrap all the clocksource entries?

That seems reasonable to me.

Quoted 2 lines

2) Should the entries be sorted?
-> proposal: Ignore cosmetic bits

I propose that you sort the entries are adding
but leave the rest of the entries as is.

Quoted 2 lines

3) What is correct dependency for multiplatform and single platform? -> proposal: Perhaps we should simply default to no?

I'm not sure that I understand the issue here.

Quoted 2 lines

4) Is single patch across 2 architectures and drivers/clocksource OK? -> proposal: Keep it like this if possible

Olof, I would like your opinion on this but from my pov this seems reasonable. Especially as one of the architectures (sh) is seeing very little change at this time.

Quoted 252 lines
Not-yet-signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/mach-shmobile/Kconfig |   19 --------------
 arch/sh/Kconfig                |   53 ----------------------------------------
 drivers/clocksource/Kconfig    |   25 ++++++++++++++++++
 3 files changed, 25 insertions(+), 72 deletions(-)
arch/arm/mach-shmobile/Kconfig +0 -19
@@ -307,25 +307,6 @@ config SHMOBILE_TIMER_HZ
 	  SH-Mobile systems using a 32768 Hz RCLK for clock events may want
 	  to select a HZ value such as 128 that can evenly divide RCLK.
 	  A HZ value that does not divide evenly may cause timer drift.
-
-config SH_TIMER_CMT
-	bool "CMT timer driver"
-	default y
-	help
-	  This enables build of the CMT timer driver.
-
-config SH_TIMER_TMU
-	bool "TMU timer driver"
-	default y
-	help
-	  This enables build of the TMU timer driver.
-
-config EM_TIMER_STI
-	bool "STI timer driver"
-	default y
-	help
-	  This enables build of the STI timer driver.
-
 endmenu
 
 endif
arch/sh/Kconfig +0 -53
@@ -121,15 +121,6 @@ config SYS_SUPPORTS_NUMA
 config SYS_SUPPORTS_PCI
 	bool
 
-config SYS_SUPPORTS_CMT
-	bool
-
-config SYS_SUPPORTS_MTU2
-	bool
-
-config SYS_SUPPORTS_TMU
-	bool
-
 config STACKTRACE_SUPPORT
 	def_bool y
 
@@ -189,14 +180,12 @@ config CPU_SH3
 	bool
 	select CPU_HAS_INTEVT
 	select CPU_HAS_SR_RB
-	select SYS_SUPPORTS_TMU
 
 config CPU_SH4
 	bool
 	select CPU_HAS_INTEVT
 	select CPU_HAS_SR_RB
 	select CPU_HAS_FPU if !CPU_SH4AL_DSP
-	select SYS_SUPPORTS_TMU
 	select SYS_SUPPORTS_HUGETLBFS if MMU
 
 config CPU_SH4A
@@ -211,7 +200,6 @@ config CPU_SH4AL_DSP
 config CPU_SH5
 	bool
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_TMU
 	select SYS_SUPPORTS_HUGETLBFS if MMU
 
 config CPU_SHX2
@@ -248,7 +236,6 @@ choice
 config CPU_SUBTYPE_SH7619
 	bool "Support SH7619 processor"
 	select CPU_SH2
-	select SYS_SUPPORTS_CMT
 
 # SH-2A Processor Support
 
@@ -256,50 +243,38 @@ config CPU_SUBTYPE_SH7201
 	bool "Support SH7201 processor"
 	select CPU_SH2A
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_MTU2
 
 config CPU_SUBTYPE_SH7203
 	bool "Support SH7203 processor"
 	select CPU_SH2A
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_CMT
-	select SYS_SUPPORTS_MTU2
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PINCTRL
 
 config CPU_SUBTYPE_SH7206
 	bool "Support SH7206 processor"
 	select CPU_SH2A
-	select SYS_SUPPORTS_CMT
-	select SYS_SUPPORTS_MTU2
 
 config CPU_SUBTYPE_SH7263
 	bool "Support SH7263 processor"
 	select CPU_SH2A
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_CMT
-	select SYS_SUPPORTS_MTU2
 
 config CPU_SUBTYPE_SH7264
 	bool "Support SH7264 processor"
 	select CPU_SH2A
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_CMT
-	select SYS_SUPPORTS_MTU2
 	select PINCTRL
 
 config CPU_SUBTYPE_SH7269
 	bool "Support SH7269 processor"
 	select CPU_SH2A
 	select CPU_HAS_FPU
-	select SYS_SUPPORTS_CMT
-	select SYS_SUPPORTS_MTU2
 	select PINCTRL
 
 config CPU_SUBTYPE_MXG
 	bool "Support MX-G processor"
 	select CPU_SH2A
-	select SYS_SUPPORTS_MTU2
 	help
 	  Select MX-G if running on an R8A03022BG part.
 
@@ -352,7 +327,6 @@ config CPU_SUBTYPE_SH7720
 	bool "Support SH7720 processor"
 	select CPU_SH3
 	select CPU_HAS_DSP
-	select SYS_SUPPORTS_CMT
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select USB_ARCH_HAS_OHCI
 	select USB_OHCI_SH if USB_OHCI_HCD
@@ -364,7 +338,6 @@ config CPU_SUBTYPE_SH7721
 	bool "Support SH7721 processor"
 	select CPU_SH3
 	select CPU_HAS_DSP
-	select SYS_SUPPORTS_CMT
 	select USB_ARCH_HAS_OHCI
 	select USB_OHCI_SH if USB_OHCI_HCD
 	help
@@ -420,7 +393,6 @@ config CPU_SUBTYPE_SH7723
 	select CPU_SHX2
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
-	select SYS_SUPPORTS_CMT
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PINCTRL
 	help
@@ -432,7 +404,6 @@ config CPU_SUBTYPE_SH7724
 	select CPU_SHX2
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
-	select SYS_SUPPORTS_CMT
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PINCTRL
 	help
@@ -512,7 +483,6 @@ config CPU_SUBTYPE_SH7343
 	bool "Support SH7343 processor"
 	select CPU_SH4AL_DSP
 	select ARCH_SHMOBILE
-	select SYS_SUPPORTS_CMT
 
 config CPU_SUBTYPE_SH7722
 	bool "Support SH7722 processor"
@@ -521,7 +491,6 @@ config CPU_SUBTYPE_SH7722
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
 	select SYS_SUPPORTS_NUMA
-	select SYS_SUPPORTS_CMT
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PINCTRL
 
@@ -532,7 +501,6 @@ config CPU_SUBTYPE_SH7366
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
 	select SYS_SUPPORTS_NUMA
-	select SYS_SUPPORTS_CMT
 
 endchoice
 
@@ -565,27 +533,6 @@ source "arch/sh/boards/Kconfig"
 
 menu "Timer and clock configuration"
 
-config SH_TIMER_TMU
-	bool "TMU timer driver"
-	depends on SYS_SUPPORTS_TMU
-	default y
-	help
-	  This enables the build of the TMU timer driver.
-
-config SH_TIMER_CMT
-	bool "CMT timer driver"
-	depends on SYS_SUPPORTS_CMT
-	default y
-	help
-	  This enables build of the CMT timer driver.
-
-config SH_TIMER_MTU2
-	bool "MTU2 timer driver"
-	depends on SYS_SUPPORTS_MTU2
-	default y
-	help
-	  This enables build of the MTU2 timer driver.
-
 config SH_PCLK_FREQ
 	int "Peripheral clock frequency (in Hz)"
 	depends on SH_CLK_CPG_LEGACY
drivers/clocksource/Kconfig +25 -0
@@ -109,3 +109,28 @@ config VF_PIT_TIMER
 	bool
 	help
 	  Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
+
+config SH_TIMER_CMT
+	bool "CMT timer driver"
+	default y
+	help
+	  This enables build of the CMT timer driver.
+
+config SH_TIMER_MTU2
+	bool "MTU2 timer driver"
+	default y
+	help
+	  This enables build of the MTU2 timer driver.
+
+config SH_TIMER_TMU
+	bool "TMU timer driver"
+	default y
+	help
+	  This enables build of the TMU timer driver.
+
+config EM_TIMER_STI
+	bool "STI timer driver"
+	default y
+	help
+	  This enables build of the STI timer driver.
+
#2 lore raw
Quoted 27 lines · Simon Horman
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Based on request from Olof Johansson, move ARM mach-shmobile clocksource entries to drivers/clocksource/Kconfig, and at the same time make the SH architecture use these entries.

Quoted 8 lines

Kconfig entries for CMT, MTU2, TMU and STI are with this patch now kept in one place. The SH SYS_SUPPORTS_nnn bits are dropped to simplye let the user select the appropriate ones using Kconfig instead of trying to filter available timers based on SoC.

Known issues:
1) Not yet wrappend in menu/endmenu, populates the root driver menu -> proposal: Create separate patch to wrap all the clocksource entries?

That seems reasonable to me.

Quoted 2 lines

2) Should the entries be sorted?
-> proposal: Ignore cosmetic bits

I propose that you sort the entries are adding
but leave the rest of the entries as is.

Quoted 2 lines

3) What is correct dependency for multiplatform and single platform? -> proposal: Perhaps we should simply default to no?

Quoted 8 lines

I'm not sure that I understand the issue here.

Quoted 2 lines

4) Is single patch across 2 architectures and drivers/clocksource OK? -> proposal: Keep it like this if possible

Olof, I would like your opinion on this but from my pov this seems reasonable. Especially as one of the architectures (sh) is seeing very little change at this time.

(Sorry for the delayed response, the renesas volume email can be large and I don't always read it when it comes in).

Yeah, as long as you have appropriate acks and don't expect conflicts.

-Olof