dt-bindings: timer: Add binding doc for nxp system counter timer
PATCH v5 1/2 dt-bindings: timer: Add binding doc for nxp system counter timer
From: Bai Ping <[email protected]>
Add the binding doc for nxp system counter timer module.
---
change v1->v2
- remove the blank line at EOF
change v2->v3
- update the binding example based on the driver change
change v3->v4
- no change
change v4->v5
- no change
--- .../bindings/timer/nxp,sysctr-timer.txt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt
Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt new file +25 -0
@@ -0,0 +1,25 @@ +NXP System Counter Module(sys_ctr) + +The system counter(sys_ctr) is a programmable system counter which provides +a shared time base to Cortex A15, A7, A53, A73, etc. it is intended for use in +applications where the counter is always powered and support multiple, +unrelated clocks. The compare frame inside can be used for timer purpose. + +Required properties: + +- compatible : should be "nxp,sysctr-timer" +- reg : Specifies the base physical address and size of the comapre + frame and the counter control, read & compare. +- interrupts : should be the first compare frames' interrupt +- clocks : Specifies the counter clock. +- clock-names: Specifies the clock's name of this module + +Example: + + system_counter: timer@306a0000 { + compatible = "nxp,sysctr-timer"; + reg = <0x306a0000 0x20000>;/* system-counter-rd & compare */ + clocks = <&clk_8m>; + clock-names = "per"; + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.21.0
PATCH v5 2/2 driver: clocksource: Add nxp system counter timer driver support
From: Bai Ping <[email protected]>
The system counter (sys_ctr) is a programmable system counter which provides a shared time base to the Cortex A15, A7, A53 etc cores. It is intended for use in applications where the counter is always powered on and supports multiple, unrelated clocks. The sys_ctr hardware supports:
- 56-bit counter width (roll-over time greater than 40 years)
- compare frame(64-bit compare value) contains programmable interrupt generation when compare value <= counter value.
---
change v1->v2:
- no change
change v2->v3:
- remove the clocksource, we only need to use this module for timer purpose, so register it as clockevent is enough.
- use the timer_of_init to init the irq, clock, etc.
- remove some unnecessary comments.
change v3->v4:
- use cached value for CMPCR,
- remove unnecessary timer enabe from set_state_oneshot function.
change v4->v5:
- remove the unnecessary config dependency
- simplify the timer enable
--- drivers/clocksource/Kconfig | 6 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-imx-sysctr.c | 143 +++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 drivers/clocksource/timer-imx-sysctr.c
drivers/clocksource/Kconfig +6 -0
@@ -617,6 +617,12 @@ config CLKSRC_IMX_TPM Enable this option to use IMX Timer/PWM Module (TPM) timer as clocksource. +config TIMER_IMX_SYS_CTR + bool "i.MX system counter timer" if COMPILE_TEST + select TIMER_OF + help + Enable this option to use i.MX system counter timer for clockevent. + config CLKSRC_ST_LPC bool "Low power clocksource found in the LPC" if COMPILE_TEST select TIMER_OF if OF
drivers/clocksource/Makefile +1 -0
@@ -74,6 +74,7 @@ obj-$(CONFIG_CLKSRC_MIPS_GIC) += mips-gic-timer.o obj-$(CONFIG_CLKSRC_TANGO_XTAL) += timer-tango-xtal.o obj-$(CONFIG_CLKSRC_IMX_GPT) += timer-imx-gpt.o obj-$(CONFIG_CLKSRC_IMX_TPM) += timer-imx-tpm.o +obj-$(CONFIG_TIMER_IMX_SYS_CTR) += timer-imx-sysctr.o obj-$(CONFIG_ASM9260_TIMER) += asm9260_timer.o obj-$(CONFIG_H8300_TMR8) += h8300_timer8.o obj-$(CONFIG_H8300_TMR16) += h8300_timer16.o
drivers/clocksource/timer-imx-sysctr.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
2.21.0