timer: npcm: Add driver for Nuvoton NPCM SoCs
PATCH v3 1/1 timer: npcm: Add driver for Nuvoton NPCM SoCs
Enable a periodic timer on NPCM SoCs and implement the get_count timer ops.
Signed-off-by Stanley Chu <[email protected]>
---
v3:
- use driver data for clock setting on different chips
- remove unnecessary code of zeroing priv variables
- more help description in Kconfig
v2:
- calculate the prescale value, not hardcode
--- drivers/timer/Kconfig | 9 +++ drivers/timer/Makefile | 1 + drivers/timer/npcm-timer.c | 115 +++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 drivers/timer/npcm-timer.c
drivers/timer/Kconfig +9 -0
@@ -143,6 +143,15 @@ config NOMADIK_MTU_TIMER The MTU provides 4 decrementing free-running timers. At the moment, only the first timer is used by the driver. +config NPCM_TIMER + bool "Nuvoton NPCM timer support" + depends on TIMER + help + Select this to enable a timer on Nuvoton NPCM SoCs. + NPCM timer module has 5 down-counting timers, only the first timer + is used to implement timer ops. No support for early timer and + boot timer. + config OMAP_TIMER bool "Omap timer support" depends on TIMER
drivers/timer/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_CADENCE_TTC_TIMER) += cadence-ttc.o obj-$(CONFIG_DESIGNWARE_APB_TIMER) += dw-apb-timer.o obj-$(CONFIG_MPC83XX_TIMER) += mpc83xx_timer.o obj-$(CONFIG_NOMADIK_MTU_TIMER) += nomadik-mtu-timer.o +obj-$(CONFIG_NPCM_TIMER) += npcm-timer.o obj-$(CONFIG_OMAP_TIMER) += omap-timer.o obj-$(CONFIG_RENESAS_OSTM_TIMER) += ostm_timer.o obj-$(CONFIG_RISCV_TIMER) += riscv_timer.o
drivers/timer/npcm-timer.c new file +115 -0
115 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 12 lines · Stanley Chu
Enable a periodic timer on NPCM SoCs and implement the
get_counttimer ops.Signed-off-by Stanley Chu <[email protected]>---
v3:
- use driver data for clock setting on different chips
- remove unnecessary code of zeroing priv variables
- more help description inKconfig
v2:
- calculate the prescale value, not hardcode
Quoted 6 lines
--- drivers/timer/Kconfig | 9 +++ drivers/timer/Makefile | 1 + drivers/timer/npcm-timer.c | 115 +++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 drivers/timer/npcm-timer.c
Reviewed-by Simon Glass <[email protected]>