From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v8 09/16] clockevents/drivers: Add STM32 Timer driver Date: Tue, 19 May 2015 12:02:59 +0200 Message-ID: References: <1431158038-3813-1-git-send-email-mcoquelin.stm32@gmail.com> <1431158038-3813-10-git-send-email-mcoquelin.stm32@gmail.com> <5559E4B0.70506@linaro.org> <555AF143.2060807@linaro.org> <555AFD18.2070009@linaro.org> <555B098A.8030202@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <555B098A.8030202-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Daniel Lezcano Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Geert Uytterhoeven , Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , Stefan Agner , Peter Meerwald , Paul Bolle , Peter Hurley , Andy Shevchenko , Chanwoo Choi , Russell King , Joe Perches , Vladimir Zapolskiy , Lee Jones , Daniel Thompson , Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell List-Id: linux-gpio@vger.kernel.org 2015-05-19 11:59 GMT+02:00 Daniel Lezcano : > On 05/19/2015 11:44 AM, Maxime Coquelin wrote: >> >> 2015-05-19 11:06 GMT+02:00 Daniel Lezcano : >>> >>> On 05/19/2015 10:55 AM, Maxime Coquelin wrote: >>>> >>>> >>>> 2015-05-19 10:16 GMT+02:00 Daniel Lezcano : >>>>> >>>>> >>>>> On 05/18/2015 04:03 PM, Maxime Coquelin wrote: >>>>>> >>>>>> >>>>>> >>>>>> 2015-05-18 15:10 GMT+02:00 Daniel Lezcano : >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 05/09/2015 09:53 AM, Maxime Coquelin wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> STM32 MCUs feature 16 and 32 bits general purpose timers with >>>>>>>> prescalers. >>>>>>>> The drivers detects whether the time is 16 or 32 bits, and app= lies a >>>>>>>> 1024 prescaler value if it is 16 bits. >>>>>>>> >>>>>>>> Reviewed-by: Linus Walleij >>>>>>>> Tested-by: Chanwoo Choi >>>>>>>> Signed-off-by: Maxime Coquelin >>>>>>>> --- >>>>>>>> drivers/clocksource/Kconfig | 8 ++ >>>>>>>> drivers/clocksource/Makefile | 1 + >>>>>>>> drivers/clocksource/timer-stm32.c | 184 >>>>>>>> ++++++++++++++++++++++++++++++++++++++ >>>>>>>> 3 files changed, 193 insertions(+) >>>>>>>> create mode 100644 drivers/clocksource/timer-stm32.c >>>>>>>> >>>>>>>> diff --git a/drivers/clocksource/Kconfig >>>>>>>> b/drivers/clocksource/Kconfig >>>>>>>> index bf9364c..2443520 100644 >>>>>>>> --- a/drivers/clocksource/Kconfig >>>>>>>> +++ b/drivers/clocksource/Kconfig >>>>>>>> @@ -106,6 +106,14 @@ config CLKSRC_EFM32 >>>>>>>> Support to use the timers of EFM32 SoCs as clock = source >>>>>>>> and >>>>>>>> clock >>>>>>>> event device. >>>>>>>> >>>>>>>> +config CLKSRC_STM32 >>>>>>>> + bool "Clocksource for STM32 SoCs" if !ARCH_STM32 >>>>>>>> + depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Are the interactive bool and the 'COMPILE_TEST' necessary ? >>>>>>> >>>>>> >>>>>> The interactive bool is necessary if we want to be able to >>>>>> select/deselect it in COMPILE_TEST configuration. >>>>>> And personnaly, I think COMPILE_TEST use makes sense. >>>>>> >>>>>> Note that other timer drivers are doing the same thing today >>>>>> (CLKSRC_EFM32, SH_TIMER_CMT, EM_TIMER_STI...). >>>>>> >>>>>> Do you have a specific concern regarding COMPILE_TEST? >>>>> >>>>> >>>>> >>>>> >>>>> Actually, we try to keep the timer selection non-interactive and = let >>>>> the >>>>> platform's Kconfig to select the timer. >>>> >>>> >>>> >>>> Ok. >>>> >>>>> >>>>> I like when the code is consistent. The COMPILE_TEST was introduc= ed and >>>>> created a precedence. I would like to get rid of the interactive = timer >>>>> selection but I did not have time to go through this yet. >>>> >>>> >>>> >>>> Indeed, consistency is important. >>>> On my side, I don't have a strong opinion regarding the COMPILE_TE= ST >>>> thing. >>>> IMHO, it is more a subsystem's maintainer choice. >>>> >>>> So, if as a maintainer you don't use it and prefer not supporting = it, >>>> I'm fine to provide you a new version without COMPILE_TEST. >>>> Doing that, the interactive selection will disappear too. >>>> >>>> I can provide you a new version this evenning. >>> >>> >>> >>> Ok, great. >> >> >> Is the below Kconfig entry fine for you? >> >> config CLKSRC_STM32 >> def_bool y if ARCH_STM32 >> select CLKSRC_MMIO > > > config CLKSRC_STM32 > bool > select CLKSRC_MMIO > > and in the arch/arm/mach-stm32/Kconfig add select CLKSRC_STM32 Ok, I will send a patch for arch/arm/Kconfig, as Arnd already applied the one intruducing ARCH_STM32. Thanks, Maxime > > >> Best regards, >> Maxime >> >> >>> >>> Thanks >>> -- Daniel >>> >>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Linaro.org =E2=94=82 Open source soft= ware for ARM >>>>> SoCs >>>>> >>>>> Follow Linaro: Facebook | >>>>> Twitter | >>>>> Blog >>>>> >>> >>> >>> -- >>> Linaro.org =E2=94=82 Open source softwar= e for ARM SoCs >>> >>> Follow Linaro: Facebook | >>> Twitter | >>> Blog >>> > > > -- > Linaro.org =E2=94=82 Open source software f= or ARM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755501AbbESKDO (ORCPT ); Tue, 19 May 2015 06:03:14 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:38241 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755344AbbESKDB convert rfc822-to-8bit (ORCPT ); Tue, 19 May 2015 06:03:01 -0400 MIME-Version: 1.0 In-Reply-To: <555B098A.8030202@linaro.org> References: <1431158038-3813-1-git-send-email-mcoquelin.stm32@gmail.com> <1431158038-3813-10-git-send-email-mcoquelin.stm32@gmail.com> <5559E4B0.70506@linaro.org> <555AF143.2060807@linaro.org> <555AFD18.2070009@linaro.org> <555B098A.8030202@linaro.org> Date: Tue, 19 May 2015 12:02:59 +0200 Message-ID: Subject: Re: [PATCH v8 09/16] clockevents/drivers: Add STM32 Timer driver From: Maxime Coquelin To: Daniel Lezcano Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Geert Uytterhoeven , Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , Stefan Agner , Peter Meerwald , Paul Bolle , Peter Hurley , Andy Shevchenko , Chanwoo Choi , Russell King , Joe Perches , Vladimir Zapolskiy , Lee Jones , Daniel Thompson , Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , "linux-doc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-serial@vger.kernel.org" , Linux-Arch , "linux-api@vger.kernel.org" , Nicolae Rosia , Kamil Lulko Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2015-05-19 11:59 GMT+02:00 Daniel Lezcano : > On 05/19/2015 11:44 AM, Maxime Coquelin wrote: >> >> 2015-05-19 11:06 GMT+02:00 Daniel Lezcano : >>> >>> On 05/19/2015 10:55 AM, Maxime Coquelin wrote: >>>> >>>> >>>> 2015-05-19 10:16 GMT+02:00 Daniel Lezcano : >>>>> >>>>> >>>>> On 05/18/2015 04:03 PM, Maxime Coquelin wrote: >>>>>> >>>>>> >>>>>> >>>>>> 2015-05-18 15:10 GMT+02:00 Daniel Lezcano : >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 05/09/2015 09:53 AM, Maxime Coquelin wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> STM32 MCUs feature 16 and 32 bits general purpose timers with >>>>>>>> prescalers. >>>>>>>> The drivers detects whether the time is 16 or 32 bits, and applies a >>>>>>>> 1024 prescaler value if it is 16 bits. >>>>>>>> >>>>>>>> Reviewed-by: Linus Walleij >>>>>>>> Tested-by: Chanwoo Choi >>>>>>>> Signed-off-by: Maxime Coquelin >>>>>>>> --- >>>>>>>> drivers/clocksource/Kconfig | 8 ++ >>>>>>>> drivers/clocksource/Makefile | 1 + >>>>>>>> drivers/clocksource/timer-stm32.c | 184 >>>>>>>> ++++++++++++++++++++++++++++++++++++++ >>>>>>>> 3 files changed, 193 insertions(+) >>>>>>>> create mode 100644 drivers/clocksource/timer-stm32.c >>>>>>>> >>>>>>>> diff --git a/drivers/clocksource/Kconfig >>>>>>>> b/drivers/clocksource/Kconfig >>>>>>>> index bf9364c..2443520 100644 >>>>>>>> --- a/drivers/clocksource/Kconfig >>>>>>>> +++ b/drivers/clocksource/Kconfig >>>>>>>> @@ -106,6 +106,14 @@ config CLKSRC_EFM32 >>>>>>>> Support to use the timers of EFM32 SoCs as clock source >>>>>>>> and >>>>>>>> clock >>>>>>>> event device. >>>>>>>> >>>>>>>> +config CLKSRC_STM32 >>>>>>>> + bool "Clocksource for STM32 SoCs" if !ARCH_STM32 >>>>>>>> + depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Are the interactive bool and the 'COMPILE_TEST' necessary ? >>>>>>> >>>>>> >>>>>> The interactive bool is necessary if we want to be able to >>>>>> select/deselect it in COMPILE_TEST configuration. >>>>>> And personnaly, I think COMPILE_TEST use makes sense. >>>>>> >>>>>> Note that other timer drivers are doing the same thing today >>>>>> (CLKSRC_EFM32, SH_TIMER_CMT, EM_TIMER_STI...). >>>>>> >>>>>> Do you have a specific concern regarding COMPILE_TEST? >>>>> >>>>> >>>>> >>>>> >>>>> Actually, we try to keep the timer selection non-interactive and let >>>>> the >>>>> platform's Kconfig to select the timer. >>>> >>>> >>>> >>>> Ok. >>>> >>>>> >>>>> I like when the code is consistent. The COMPILE_TEST was introduced and >>>>> created a precedence. I would like to get rid of the interactive timer >>>>> selection but I did not have time to go through this yet. >>>> >>>> >>>> >>>> Indeed, consistency is important. >>>> On my side, I don't have a strong opinion regarding the COMPILE_TEST >>>> thing. >>>> IMHO, it is more a subsystem's maintainer choice. >>>> >>>> So, if as a maintainer you don't use it and prefer not supporting it, >>>> I'm fine to provide you a new version without COMPILE_TEST. >>>> Doing that, the interactive selection will disappear too. >>>> >>>> I can provide you a new version this evenning. >>> >>> >>> >>> Ok, great. >> >> >> Is the below Kconfig entry fine for you? >> >> config CLKSRC_STM32 >> def_bool y if ARCH_STM32 >> select CLKSRC_MMIO > > > config CLKSRC_STM32 > bool > select CLKSRC_MMIO > > and in the arch/arm/mach-stm32/Kconfig add select CLKSRC_STM32 Ok, I will send a patch for arch/arm/Kconfig, as Arnd already applied the one intruducing ARCH_STM32. Thanks, Maxime > > >> Best regards, >> Maxime >> >> >>> >>> Thanks >>> -- Daniel >>> >>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Linaro.org │ Open source software for ARM >>>>> SoCs >>>>> >>>>> Follow Linaro: Facebook | >>>>> Twitter | >>>>> Blog >>>>> >>> >>> >>> -- >>> Linaro.org │ Open source software for ARM SoCs >>> >>> Follow Linaro: Facebook | >>> Twitter | >>> Blog >>> > > > -- > Linaro.org │ Open source software for ARM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog > From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcoquelin.stm32@gmail.com (Maxime Coquelin) Date: Tue, 19 May 2015 12:02:59 +0200 Subject: [PATCH v8 09/16] clockevents/drivers: Add STM32 Timer driver In-Reply-To: <555B098A.8030202@linaro.org> References: <1431158038-3813-1-git-send-email-mcoquelin.stm32@gmail.com> <1431158038-3813-10-git-send-email-mcoquelin.stm32@gmail.com> <5559E4B0.70506@linaro.org> <555AF143.2060807@linaro.org> <555AFD18.2070009@linaro.org> <555B098A.8030202@linaro.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 2015-05-19 11:59 GMT+02:00 Daniel Lezcano : > On 05/19/2015 11:44 AM, Maxime Coquelin wrote: >> >> 2015-05-19 11:06 GMT+02:00 Daniel Lezcano : >>> >>> On 05/19/2015 10:55 AM, Maxime Coquelin wrote: >>>> >>>> >>>> 2015-05-19 10:16 GMT+02:00 Daniel Lezcano : >>>>> >>>>> >>>>> On 05/18/2015 04:03 PM, Maxime Coquelin wrote: >>>>>> >>>>>> >>>>>> >>>>>> 2015-05-18 15:10 GMT+02:00 Daniel Lezcano : >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 05/09/2015 09:53 AM, Maxime Coquelin wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> STM32 MCUs feature 16 and 32 bits general purpose timers with >>>>>>>> prescalers. >>>>>>>> The drivers detects whether the time is 16 or 32 bits, and applies a >>>>>>>> 1024 prescaler value if it is 16 bits. >>>>>>>> >>>>>>>> Reviewed-by: Linus Walleij >>>>>>>> Tested-by: Chanwoo Choi >>>>>>>> Signed-off-by: Maxime Coquelin >>>>>>>> --- >>>>>>>> drivers/clocksource/Kconfig | 8 ++ >>>>>>>> drivers/clocksource/Makefile | 1 + >>>>>>>> drivers/clocksource/timer-stm32.c | 184 >>>>>>>> ++++++++++++++++++++++++++++++++++++++ >>>>>>>> 3 files changed, 193 insertions(+) >>>>>>>> create mode 100644 drivers/clocksource/timer-stm32.c >>>>>>>> >>>>>>>> diff --git a/drivers/clocksource/Kconfig >>>>>>>> b/drivers/clocksource/Kconfig >>>>>>>> index bf9364c..2443520 100644 >>>>>>>> --- a/drivers/clocksource/Kconfig >>>>>>>> +++ b/drivers/clocksource/Kconfig >>>>>>>> @@ -106,6 +106,14 @@ config CLKSRC_EFM32 >>>>>>>> Support to use the timers of EFM32 SoCs as clock source >>>>>>>> and >>>>>>>> clock >>>>>>>> event device. >>>>>>>> >>>>>>>> +config CLKSRC_STM32 >>>>>>>> + bool "Clocksource for STM32 SoCs" if !ARCH_STM32 >>>>>>>> + depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Are the interactive bool and the 'COMPILE_TEST' necessary ? >>>>>>> >>>>>> >>>>>> The interactive bool is necessary if we want to be able to >>>>>> select/deselect it in COMPILE_TEST configuration. >>>>>> And personnaly, I think COMPILE_TEST use makes sense. >>>>>> >>>>>> Note that other timer drivers are doing the same thing today >>>>>> (CLKSRC_EFM32, SH_TIMER_CMT, EM_TIMER_STI...). >>>>>> >>>>>> Do you have a specific concern regarding COMPILE_TEST? >>>>> >>>>> >>>>> >>>>> >>>>> Actually, we try to keep the timer selection non-interactive and let >>>>> the >>>>> platform's Kconfig to select the timer. >>>> >>>> >>>> >>>> Ok. >>>> >>>>> >>>>> I like when the code is consistent. The COMPILE_TEST was introduced and >>>>> created a precedence. I would like to get rid of the interactive timer >>>>> selection but I did not have time to go through this yet. >>>> >>>> >>>> >>>> Indeed, consistency is important. >>>> On my side, I don't have a strong opinion regarding the COMPILE_TEST >>>> thing. >>>> IMHO, it is more a subsystem's maintainer choice. >>>> >>>> So, if as a maintainer you don't use it and prefer not supporting it, >>>> I'm fine to provide you a new version without COMPILE_TEST. >>>> Doing that, the interactive selection will disappear too. >>>> >>>> I can provide you a new version this evenning. >>> >>> >>> >>> Ok, great. >> >> >> Is the below Kconfig entry fine for you? >> >> config CLKSRC_STM32 >> def_bool y if ARCH_STM32 >> select CLKSRC_MMIO > > > config CLKSRC_STM32 > bool > select CLKSRC_MMIO > > and in the arch/arm/mach-stm32/Kconfig add select CLKSRC_STM32 Ok, I will send a patch for arch/arm/Kconfig, as Arnd already applied the one intruducing ARCH_STM32. Thanks, Maxime > > >> Best regards, >> Maxime >> >> >>> >>> Thanks >>> -- Daniel >>> >>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Linaro.org ? Open source software for ARM >>>>> SoCs >>>>> >>>>> Follow Linaro: Facebook | >>>>> Twitter | >>>>> Blog >>>>> >>> >>> >>> -- >>> Linaro.org ? Open source software for ARM SoCs >>> >>> Follow Linaro: Facebook | >>> Twitter | >>> Blog >>> > > > -- > Linaro.org ? Open source software for ARM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog >