This is V6 of the SH and ARM mach-shmobile clocksource Kconfig consolidation
series. It is a rebased version of V5 (which did not get any comments) on top
of the latest renesas/devel tag. This series is not just an optimization, it
also makes it possible to enable the clocksource for the r7s72100 platform.
Without it, the current kernel is hardly usable for these devices at the moment
(broken userland). So, it would be nice to have the series in 3.15. For more
details, I quote the cover-letter from Magnus for V5 at the end. I successfully
tested the patches on r7s72100 and r8a7791 platforms. The branch can be found
here:
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/rework-clock-configs
Changes since V5:
- rebased on top of renesas-devel-v3.14-rc3-20140217
Signed-off-by: Wolfram Sang <[email protected]>
=== original cover letter
By sharing Kconfig entires in drivers/clocksource/Kconfig we
can get rid of duplicated bits that do not belong under arch/.
With this series applied it is possible to build the timer
drivers for CMT, MTU2, TMU and STI in case of SH or ARM. The timer
drivers are automatically selected by default. It is also possible
to select and/or deselect freely when COMPILE_TEST has been selected.
Many thanks to Olof, John, Daniel and Arnd for feedback!
Changes since V4:
- Use SYS_SUPPORTS_SH/EM to avoid name space pollution, thanks Olof!
- Remove old SH entries for SYS_SUPPORTS_xxx, use above SH prefix instead
Changes since V3:
- Updated patch 1/3 with more detailed help texts
- Updated patch 2/3 to fit latest renesas-devel tag, see below
- Included acks from John Stultz for patch 2/3 and 3/3
Signed-off-by: Magnus Damm <[email protected]>
---
Magnus Damm (3):
clocksource: Add Kconfig entries for CMT, MTU2, TMU and STI
ARM: shmobile: Remove CMT, TMU and STI Kconfig entries
sh: Remove Kconfig entries for TMU, CMT and MTU2
arch/arm/mach-shmobile/Kconfig | 35 ++++++++++---------
arch/sh/Kconfig | 76 +++++++++++++-----------------------------
drivers/clocksource/Kconfig | 44 ++++++++++++++++++++++++
3 files changed, 84 insertions(+), 71 deletions(-)
--
1.8.5.1
From: Magnus Damm <[email protected]>
Now when drivers/clocksource/Kconfig has been
updated with entires for CMT, TMU and STI
it is safe to remove these from mach-shmobile.
Also select timers per SoC via SYS_SUPPORTS_xxx.
Signed-off-by: Magnus Damm <[email protected]>
Acked-by: John Stultz <[email protected]>
[wsa: rebased to renesas-devel-v3.14-rc3-20140217]
Signed-off-by: Wolfram Sang <[email protected]>
---
arch/arm/mach-shmobile/Kconfig | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4b89116..d80df50 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -25,17 +25,21 @@ comment "Renesas ARM SoCs System Type"
config ARCH_EMEV2
bool "Emma Mobile EV2"
+ select SYS_SUPPORTS_EM_STI
config ARCH_R7S72100
bool "RZ/A1H (R7S72100)"
+ select SYS_SUPPORTS_SH_MTU2
config ARCH_R8A7790
bool "R-Car H2 (R8A77900)"
select RENESAS_IRQC
+ select SYS_SUPPORTS_SH_CMT
config ARCH_R8A7791
bool "R-Car M2 (R8A77910)"
select RENESAS_IRQC
+ select SYS_SUPPORTS_SH_CMT
comment "Renesas ARM SoCs Board Type"
@@ -72,6 +76,8 @@ config ARCH_SH7372
select ARM_CPU_SUSPEND if PM || CPU_IDLE
select CPU_V7
select SH_CLK_CPG
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_TMU
config ARCH_SH73A0
bool "SH-Mobile AG5 (R8A73A00)"
@@ -81,6 +87,8 @@ config ARCH_SH73A0
select I2C
select SH_CLK_CPG
select RENESAS_INTC_IRQPIN
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_TMU
config ARCH_R8A73A4
bool "R-Mobile APE6 (R8A73A40)"
@@ -91,6 +99,8 @@ config ARCH_R8A73A4
select RENESAS_IRQC
select ARCH_HAS_CPUFREQ
select ARCH_HAS_OPP
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_TMU
config ARCH_R8A7740
bool "R-Mobile A1 (R8A77400)"
@@ -99,6 +109,8 @@ config ARCH_R8A7740
select CPU_V7
select SH_CLK_CPG
select RENESAS_INTC_IRQPIN
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_TMU
config ARCH_R8A7778
bool "R-Car M1A (R8A77781)"
@@ -108,6 +120,7 @@ config ARCH_R8A7778
select ARM_GIC
select USB_ARCH_HAS_EHCI
select USB_ARCH_HAS_OHCI
+ select SYS_SUPPORTS_SH_TMU
config ARCH_R8A7779
bool "R-Car H1 (R8A77790)"
@@ -118,6 +131,7 @@ config ARCH_R8A7779
select USB_ARCH_HAS_EHCI
select USB_ARCH_HAS_OHCI
select RENESAS_INTC_IRQPIN
+ select SYS_SUPPORTS_SH_TMU
config ARCH_R8A7790
bool "R-Car H2 (R8A77900)"
@@ -128,6 +142,7 @@ config ARCH_R8A7790
select SH_CLK_CPG
select RENESAS_IRQC
select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+ select SYS_SUPPORTS_SH_CMT
config ARCH_R8A7791
bool "R-Car M2 (R8A77910)"
@@ -138,6 +153,7 @@ config ARCH_R8A7791
select SH_CLK_CPG
select RENESAS_IRQC
select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+ select SYS_SUPPORTS_SH_CMT
config ARCH_R7S72100
bool "RZ/A1H (R7S72100)"
@@ -145,6 +161,7 @@ config ARCH_R7S72100
select ARM_GIC
select CPU_V7
select SH_CLK_CPG
+ select SYS_SUPPORTS_SH_MTU2
comment "Renesas ARM SoCs Board Type"
@@ -325,24 +342,6 @@ config SHMOBILE_TIMER_HZ
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
--
1.8.5.1
From: Magnus Damm <[email protected]>
Add Kconfig entries for CMT, MTU2, TMU and STI to
drivers/clocksource/Kconfig. This will allow us to
get rid of duplicated entires in architecture code
such as arch/sh and arch/arm/mach-shmobile.
Signed-off-by: Magnus Damm <[email protected]>
[wsa: rebased to renesas-devel-v3.14-rc3-20140217]
Signed-off-by: Wolfram Sang <[email protected]>
---
drivers/clocksource/Kconfig | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index cd6950f..4f754a9 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -140,3 +140,47 @@ config VF_PIT_TIMER
bool
help
Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
+
+config SYS_SUPPORTS_SH_CMT
+ bool
+
+config SYS_SUPPORTS_SH_MTU2
+ bool
+
+config SYS_SUPPORTS_SH_TMU
+ bool
+
+config SYS_SUPPORTS_EM_STI
+ bool
+
+config SH_TIMER_CMT
+ bool "Renesas CMT timer driver" if COMPILE_TEST
+ default SYS_SUPPORTS_SH_CMT
+ help
+ This enables build of a clocksource and clockevent driver for
+ the Compare Match Timer (CMT) hardware available in 16/32/48-bit
+ variants on a wide range of Mobile and Automotive SoCs from Renesas.
+
+config SH_TIMER_MTU2
+ bool "Renesas MTU2 timer driver" if COMPILE_TEST
+ default SYS_SUPPORTS_SH_MTU2
+ help
+ This enables build of a clockevent driver for the Multi-Function
+ Timer Pulse Unit 2 (TMU2) hardware available on SoCs from Renesas.
+ This hardware comes with 16 bit-timer registers.
+
+config SH_TIMER_TMU
+ bool "Renesas TMU timer driver" if COMPILE_TEST
+ default SYS_SUPPORTS_SH_TMU
+ help
+ This enables build of a clocksource and clockevent driver for
+ the 32-bit Timer Unit (TMU) hardware available on a wide range
+ SoCs from Renesas.
+
+config EM_TIMER_STI
+ bool "Renesas STI timer driver" if COMPILE_TEST
+ default SYS_SUPPORTS_EM_STI
+ help
+ This enables build of a clocksource and clockevent driver for
+ the 48-bit System Timer (STI) hardware available on a SoCs
+ such as EMEV2 from former NEC Electronics.
--
1.8.5.1
From: Magnus Damm <[email protected]>
Now when drivers/clocksource/Kconfig has been
updated with entires for CMT, TMU and MTU2
it is safe to remove these from SH.
Signed-off-by: Magnus Damm <[email protected]>
Acked-by: John Stultz <[email protected]>
[wsa: rebased to renesas-devel-v3.14-rc3-20140217]
Signed-off-by: Wolfram Sang <[email protected]>
---
arch/sh/Kconfig | 76 +++++++++++++++++----------------------------------------
1 file changed, 23 insertions(+), 53 deletions(-)
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6357710..364d204 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -123,15 +123,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
@@ -191,14 +182,14 @@ config CPU_SH3
bool
select CPU_HAS_INTEVT
select CPU_HAS_SR_RB
- select SYS_SUPPORTS_TMU
+ select SYS_SUPPORTS_SH_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_SH_TMU
select SYS_SUPPORTS_HUGETLBFS if MMU
config CPU_SH4A
@@ -213,7 +204,7 @@ config CPU_SH4AL_DSP
config CPU_SH5
bool
select CPU_HAS_FPU
- select SYS_SUPPORTS_TMU
+ select SYS_SUPPORTS_SH_TMU
select SYS_SUPPORTS_HUGETLBFS if MMU
config CPU_SHX2
@@ -250,7 +241,7 @@ choice
config CPU_SUBTYPE_SH7619
bool "Support SH7619 processor"
select CPU_SH2
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
# SH-2A Processor Support
@@ -258,50 +249,50 @@ config CPU_SUBTYPE_SH7201
bool "Support SH7201 processor"
select CPU_SH2A
select CPU_HAS_FPU
- select SYS_SUPPORTS_MTU2
+ select SYS_SUPPORTS_SH_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 SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_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
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_MTU2
config CPU_SUBTYPE_SH7263
bool "Support SH7263 processor"
select CPU_SH2A
select CPU_HAS_FPU
- select SYS_SUPPORTS_CMT
- select SYS_SUPPORTS_MTU2
+ select SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_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 SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_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 SYS_SUPPORTS_SH_CMT
+ select SYS_SUPPORTS_SH_MTU2
select PINCTRL
config CPU_SUBTYPE_MXG
bool "Support MX-G processor"
select CPU_SH2A
- select SYS_SUPPORTS_MTU2
+ select SYS_SUPPORTS_SH_MTU2
help
Select MX-G if running on an R8A03022BG part.
@@ -354,7 +345,7 @@ config CPU_SUBTYPE_SH7720
bool "Support SH7720 processor"
select CPU_SH3
select CPU_HAS_DSP
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
select ARCH_WANT_OPTIONAL_GPIOLIB
select USB_ARCH_HAS_OHCI
select USB_OHCI_SH if USB_OHCI_HCD
@@ -366,7 +357,7 @@ config CPU_SUBTYPE_SH7721
bool "Support SH7721 processor"
select CPU_SH3
select CPU_HAS_DSP
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
select USB_ARCH_HAS_OHCI
select USB_OHCI_SH if USB_OHCI_HCD
help
@@ -422,7 +413,7 @@ config CPU_SUBTYPE_SH7723
select CPU_SHX2
select ARCH_SHMOBILE
select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
select ARCH_WANT_OPTIONAL_GPIOLIB
select PINCTRL
help
@@ -434,7 +425,7 @@ config CPU_SUBTYPE_SH7724
select CPU_SHX2
select ARCH_SHMOBILE
select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
select ARCH_WANT_OPTIONAL_GPIOLIB
select PINCTRL
help
@@ -514,7 +505,7 @@ config CPU_SUBTYPE_SH7343
bool "Support SH7343 processor"
select CPU_SH4AL_DSP
select ARCH_SHMOBILE
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
config CPU_SUBTYPE_SH7722
bool "Support SH7722 processor"
@@ -523,7 +514,7 @@ config CPU_SUBTYPE_SH7722
select ARCH_SHMOBILE
select ARCH_SPARSEMEM_ENABLE
select SYS_SUPPORTS_NUMA
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
select ARCH_WANT_OPTIONAL_GPIOLIB
select PINCTRL
@@ -534,7 +525,7 @@ config CPU_SUBTYPE_SH7366
select ARCH_SHMOBILE
select ARCH_SPARSEMEM_ENABLE
select SYS_SUPPORTS_NUMA
- select SYS_SUPPORTS_CMT
+ select SYS_SUPPORTS_SH_CMT
endchoice
@@ -567,27 +558,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
--
1.8.5.1
On 02/17/2014 09:55 PM, Wolfram Sang wrote:
> This is V6 of the SH and ARM mach-shmobile clocksource Kconfig consolidation
> series. It is a rebased version of V5 (which did not get any comments) on top
> of the latest renesas/devel tag. This series is not just an optimization, it
> also makes it possible to enable the clocksource for the r7s72100 platform.
> Without it, the current kernel is hardly usable for these devices at the moment
> (broken userland). So, it would be nice to have the series in 3.15. For more
> details, I quote the cover-letter from Magnus for V5 at the end. I successfully
> tested the patches on r7s72100 and r8a7791 platforms. The branch can be found
> here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/rework-clock-configs
Hi Wolfram,
actually I was waiting for Magnus to send me the patchset respinned
against timers/core [1].
So if you mind, please refresh the series against timers/core as this
series does not apply for my tree.
Thanks
-- Daniel
[1] https://lkml.org/lkml/2013/12/18/911
> Changes since V5:
>
> - rebased on top of renesas-devel-v3.14-rc3-20140217
>
> Signed-off-by: Wolfram Sang <[email protected]>
>
>
> === original cover letter
>
> By sharing Kconfig entires in drivers/clocksource/Kconfig we
> can get rid of duplicated bits that do not belong under arch/.
>
> With this series applied it is possible to build the timer
> drivers for CMT, MTU2, TMU and STI in case of SH or ARM. The timer
> drivers are automatically selected by default. It is also possible
> to select and/or deselect freely when COMPILE_TEST has been selected.
>
> Many thanks to Olof, John, Daniel and Arnd for feedback!
>
> Changes since V4:
> - Use SYS_SUPPORTS_SH/EM to avoid name space pollution, thanks Olof!
> - Remove old SH entries for SYS_SUPPORTS_xxx, use above SH prefix instead
>
> Changes since V3:
> - Updated patch 1/3 with more detailed help texts
> - Updated patch 2/3 to fit latest renesas-devel tag, see below
> - Included acks from John Stultz for patch 2/3 and 3/3
>
> Signed-off-by: Magnus Damm <[email protected]>
> ---
>
> Magnus Damm (3):
> clocksource: Add Kconfig entries for CMT, MTU2, TMU and STI
> ARM: shmobile: Remove CMT, TMU and STI Kconfig entries
> sh: Remove Kconfig entries for TMU, CMT and MTU2
>
> arch/arm/mach-shmobile/Kconfig | 35 ++++++++++---------
> arch/sh/Kconfig | 76 +++++++++++++-----------------------------
> drivers/clocksource/Kconfig | 44 ++++++++++++++++++++++++
> 3 files changed, 84 insertions(+), 71 deletions(-)
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
> actually I was waiting for Magnus to send me the patchset respinned
> against timers/core [1].
Ehrm, how did I manage to miss that reply? :) Thanks for the pointer,
will send V7 in a minute.
On Thu, Feb 20, 2014 at 5:47 PM, Daniel Lezcano
<[email protected]> wrote:
> On 02/17/2014 09:55 PM, Wolfram Sang wrote:
>>
>> This is V6 of the SH and ARM mach-shmobile clocksource Kconfig
>> consolidation
>> series. It is a rebased version of V5 (which did not get any comments) on
>> top
>> of the latest renesas/devel tag. This series is not just an optimization,
>> it
>> also makes it possible to enable the clocksource for the r7s72100
>> platform.
>> Without it, the current kernel is hardly usable for these devices at the
>> moment
>> (broken userland). So, it would be nice to have the series in 3.15. For
>> more
>> details, I quote the cover-letter from Magnus for V5 at the end. I
>> successfully
>> tested the patches on r7s72100 and r8a7791 platforms. The branch can be
>> found
>> here:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
>> renesas/rework-clock-configs
>
>
> Hi Wolfram,
>
> actually I was waiting for Magnus to send me the patchset respinned against
> timers/core [1].
Hi Daniel,
Thanks for your help and my apologies for this confusion. I moved
house during December and a couple of things got dropped including
this one.
> So if you mind, please refresh the series against timers/core as this series
> does not apply for my tree.
I noticed that Wolfram picked it up, thanks to both of you - I
appreciate your help!
Cheers,
/ magnus
On 02/24/2014 11:48 PM, Magnus Damm wrote:
> On Thu, Feb 20, 2014 at 5:47 PM, Daniel Lezcano
> <[email protected]> wrote:
>> On 02/17/2014 09:55 PM, Wolfram Sang wrote:
>>>
>>> This is V6 of the SH and ARM mach-shmobile clocksource Kconfig
>>> consolidation
>>> series. It is a rebased version of V5 (which did not get any comments) on
>>> top
>>> of the latest renesas/devel tag. This series is not just an optimization,
>>> it
>>> also makes it possible to enable the clocksource for the r7s72100
>>> platform.
>>> Without it, the current kernel is hardly usable for these devices at the
>>> moment
>>> (broken userland). So, it would be nice to have the series in 3.15. For
>>> more
>>> details, I quote the cover-letter from Magnus for V5 at the end. I
>>> successfully
>>> tested the patches on r7s72100 and r8a7791 platforms. The branch can be
>>> found
>>> here:
>>>
>>> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
>>> renesas/rework-clock-configs
>>
>>
>> Hi Wolfram,
>>
>> actually I was waiting for Magnus to send me the patchset respinned against
>> timers/core [1].
>
> Hi Daniel,
>
> Thanks for your help and my apologies for this confusion. I moved
> house during December and a couple of things got dropped including
> this one.
No problem, that happens ;)
>> So if you mind, please refresh the series against timers/core as this series
>> does not apply for my tree.
>
> I noticed that Wolfram picked it up, thanks to both of you - I
> appreciate your help!
Thanks to Wolfram.
-- Daniel
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog