2020-06-03 12:59:20

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [RESEND v7 0/6] clockevent: add low power STM32 timer

This series add low power timer as boadcast clockevent device.
Low power timer could runs even when CPUs are in idle mode and
could wakeup them.

Lee has acked the MFD part.
Clocksource driver still need to be reviewed by maintainers.
Add missing part of the bindings to describe interrupt.

version 7 resend:
- with Daniel ack for driver patch
- with Rob review for bindings patch

version 7:
- rebased on top of v5.7-rc2

version 6:
- simplify binding, DT and code to use only one interrupt

version 5:
- document interrupts and interrupt-names bindings
- use a different wake up interrupt
- add device-tree patch
- make STM32MP157 select low power timer configuration flag
- enable fast_io in regmap configuration

version 4:
- move defines in mfd/stm32-lptimer.h
- change compatible and subnode names
- document wakeup-source property
- reword commit message
- make driver Kconfig depends of MFD_STM32_LPTIMER
- remove useless include
- remove rate and clk fields from the private structure
- to add comments about the registers sequence in stm32_clkevent_lp_set_timer
- rework probe function and use devm_request_irq()
- do not allow module to be removed

version 3:
- fix timer set sequence
- don't forget to free irq on remove function
- use devm_kzalloc to simplify errors handling in probe function

version 2:
- stm32 clkevent driver is now a child of the stm32 lp timer node
- add a probe function and adpat the driver to use regmap provide
by it parent
- stop using timer_of helpers


Benjamin Gaignard (6):
dt-bindings: mfd: Document STM32 low power timer bindings
ARM: dts: stm32: Add timer subnodes on stm32mp15 SoCs
mfd: stm32: Add defines to be used for clkevent purpose
mfd: stm32: enable regmap fast_io for stm32-lptimer
clocksource: Add Low Power STM32 timers driver
ARM: mach-stm32: select low power timer for STM32MP157

.../devicetree/bindings/mfd/st,stm32-lptimer.yaml | 5 +
arch/arm/boot/dts/stm32mp151.dtsi | 35 ++++
arch/arm/mach-stm32/Kconfig | 1 +
drivers/clocksource/Kconfig | 4 +
drivers/clocksource/Makefile | 1 +
drivers/clocksource/timer-stm32-lp.c | 221 +++++++++++++++++++++
drivers/mfd/stm32-lptimer.c | 1 +
include/linux/mfd/stm32-lptimer.h | 5 +
8 files changed, 273 insertions(+)
create mode 100644 drivers/clocksource/timer-stm32-lp.c

--
2.15.0


2020-06-03 13:01:53

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [RESEND v7 6/6] ARM: mach-stm32: select low power timer for STM32MP157

Make MACH_STM32MP157 select CLKSRC_STM32_LP to get a broadcast timer.

Signed-off-by: Benjamin Gaignard <[email protected]>
---
arch/arm/mach-stm32/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 57699bd8f107..d78f55b7b1d0 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -46,6 +46,7 @@ if ARCH_MULTI_V7
config MACH_STM32MP157
bool "STMicroelectronics STM32MP157"
select ARM_ERRATA_814220
+ select CLKSRC_STM32_LP
default y

endif # ARMv7-A
--
2.15.0

2020-06-03 13:01:58

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [RESEND v7 4/6] mfd: stm32: enable regmap fast_io for stm32-lptimer

Because stm32-lptimer need to write in registers in interrupt context
enable regmap fast_io to use a spin_lock to protect registers access
rather than a mutex.

Signed-off-by: Benjamin Gaignard <[email protected]>
Acked-by: Lee Jones <[email protected]>
---
drivers/mfd/stm32-lptimer.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/stm32-lptimer.c b/drivers/mfd/stm32-lptimer.c
index a00f99f36559..746e51a17cc8 100644
--- a/drivers/mfd/stm32-lptimer.c
+++ b/drivers/mfd/stm32-lptimer.c
@@ -17,6 +17,7 @@ static const struct regmap_config stm32_lptimer_regmap_cfg = {
.val_bits = 32,
.reg_stride = sizeof(u32),
.max_register = STM32_LPTIM_MAX_REGISTER,
+ .fast_io = true,
};

static int stm32_lptimer_detect_encoder(struct stm32_lptimer *ddata)
--
2.15.0

2020-06-16 11:46:44

by Benjamin GAIGNARD

[permalink] [raw]
Subject: Re: [RESEND v7 0/6] clockevent: add low power STM32 timer



On 6/3/20 2:54 PM, Benjamin Gaignard wrote:
> This series add low power timer as boadcast clockevent device.
> Low power timer could runs even when CPUs are in idle mode and
> could wakeup them.
>
> Lee has acked the MFD part.
> Clocksource driver still need to be reviewed by maintainers.
> Add missing part of the bindings to describe interrupt.

Hi Lee,

I think everything has been reviewed and acked in this series.
May I have forgot something that prevent it to be merge ?

Benjamin

>
> version 7 resend:
> - with Daniel ack for driver patch
> - with Rob review for bindings patch
>
> version 7:
> - rebased on top of v5.7-rc2
>
> version 6:
> - simplify binding, DT and code to use only one interrupt
>
> version 5:
> - document interrupts and interrupt-names bindings
> - use a different wake up interrupt
> - add device-tree patch
> - make STM32MP157 select low power timer configuration flag
> - enable fast_io in regmap configuration
>
> version 4:
> - move defines in mfd/stm32-lptimer.h
> - change compatible and subnode names
> - document wakeup-source property
> - reword commit message
> - make driver Kconfig depends of MFD_STM32_LPTIMER
> - remove useless include
> - remove rate and clk fields from the private structure
> - to add comments about the registers sequence in stm32_clkevent_lp_set_timer
> - rework probe function and use devm_request_irq()
> - do not allow module to be removed
>
> version 3:
> - fix timer set sequence
> - don't forget to free irq on remove function
> - use devm_kzalloc to simplify errors handling in probe function
>
> version 2:
> - stm32 clkevent driver is now a child of the stm32 lp timer node
> - add a probe function and adpat the driver to use regmap provide
> by it parent
> - stop using timer_of helpers
>
>
> Benjamin Gaignard (6):
> dt-bindings: mfd: Document STM32 low power timer bindings
> ARM: dts: stm32: Add timer subnodes on stm32mp15 SoCs
> mfd: stm32: Add defines to be used for clkevent purpose
> mfd: stm32: enable regmap fast_io for stm32-lptimer
> clocksource: Add Low Power STM32 timers driver
> ARM: mach-stm32: select low power timer for STM32MP157
>
> .../devicetree/bindings/mfd/st,stm32-lptimer.yaml | 5 +
> arch/arm/boot/dts/stm32mp151.dtsi | 35 ++++
> arch/arm/mach-stm32/Kconfig | 1 +
> drivers/clocksource/Kconfig | 4 +
> drivers/clocksource/Makefile | 1 +
> drivers/clocksource/timer-stm32-lp.c | 221 +++++++++++++++++++++
> drivers/mfd/stm32-lptimer.c | 1 +
> include/linux/mfd/stm32-lptimer.h | 5 +
> 8 files changed, 273 insertions(+)
> create mode 100644 drivers/clocksource/timer-stm32-lp.c
>

2020-06-18 10:26:16

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL] Immutable branch between MFD and Clocksource due for the v5.9 merge window

All but the ARM patches, which should be routed via Arm-SoC.

Enjoy!

The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407:

Linux 5.8-rc1 (2020-06-14 12:45:04 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-clocksource-v5.9

for you to fetch changes up to 48b41c5e2de6c52c90efa99cfa122a5da7a7f0cd:

clocksource: Add Low Power STM32 timers driver (2020-06-18 11:19:58 +0100)

----------------------------------------------------------------
Immutable branch between MFD and Clocksource due for the v5.9 merge window

----------------------------------------------------------------
Benjamin Gaignard (4):
dt-bindings: mfd: Document STM32 low power timer bindings
mfd: stm32: Add defines to be used for clkevent purpose
mfd: stm32: Enable regmap fast_io for stm32-lptimer
clocksource: Add Low Power STM32 timers driver

.../devicetree/bindings/mfd/st,stm32-lptimer.yaml | 5 +
drivers/clocksource/Kconfig | 4 +
drivers/clocksource/Makefile | 1 +
drivers/clocksource/timer-stm32-lp.c | 221 +++++++++++++++++++++
drivers/mfd/stm32-lptimer.c | 1 +
include/linux/mfd/stm32-lptimer.h | 5 +
6 files changed, 237 insertions(+)
create mode 100644 drivers/clocksource/timer-stm32-lp.c

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog