Skip to content

Commit 625022a

Browse files
claudiubezneadlezcano
authored andcommitted
clocksource/drivers/timer-microchip-pit64b: Add Microchip PIT64B support
Add driver for Microchip PIT64B timer. Timer could be used in continuous mode or oneshot mode. The hardware has 2x32 bit registers for period emulating a 64 bit timer. The LSB_PR and MSB_PR registers are used to set the period value (compare value). TLSB and TMSB keeps the current value of the counter. After a compare the TLSB and TMSB register resets. The driver uses PIT64B timer for clocksource or clockevent. First requested timer would be registered as clockevent, second one would be registered as clocksource. Individual PIT64B hardware resources were used for clocksource and clockevent to be able to support high resolution timers with this hardware implementation. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1576235962-30123-3-git-send-email-claudiu.beznea@microchip.com
1 parent ddc61bb commit 625022a

File tree

4 files changed

+466
-0
lines changed

4 files changed

+466
-0
lines changed

Documentation/devicetree/bindings/arm/atmel-sysregs.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ PIT Timer required properties:
1010
- interrupts: Should contain interrupt for the PIT which is the IRQ line
1111
shared across all System Controller members.
1212

13+
PIT64B Timer required properties:
14+
- compatible: Should be "microchip,sam9x60-pit64b"
15+
- reg: Should contain registers location and length
16+
- interrupts: Should contain interrupt for PIT64B timer
17+
- clocks: Should contain the available clock sources for PIT64B timer.
18+
1319
System Timer (ST) required properties:
1420
- compatible: Should be "atmel,at91rm9200-st", "syscon", "simple-mfd"
1521
- reg: Should contain registers location and length

drivers/clocksource/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,4 +697,14 @@ config INGENIC_TIMER
697697
help
698698
Support for the timer/counter unit of the Ingenic JZ SoCs.
699699

700+
config MICROCHIP_PIT64B
701+
bool "Microchip PIT64B support"
702+
depends on OF || COMPILE_TEST
703+
select CLKSRC_MMIO
704+
help
705+
This option enables Microchip PIT64B timer for Atmel
706+
based system. It supports the oneshot, the periodic
707+
modes and high resolution. It is used as a clocksource
708+
and a clockevent.
709+
700710
endmenu

drivers/clocksource/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,4 @@ obj-$(CONFIG_RISCV_TIMER) += timer-riscv.o
8888
obj-$(CONFIG_CSKY_MP_TIMER) += timer-mp-csky.o
8989
obj-$(CONFIG_GX6605S_TIMER) += timer-gx6605s.o
9090
obj-$(CONFIG_HYPERV_TIMER) += hyperv_timer.o
91+
obj-$(CONFIG_MICROCHIP_PIT64B) += timer-microchip-pit64b.o

0 commit comments

Comments
 (0)