Skip to contentSkip to conversation

timer: imx-gpt: Add timer support for i.MX SoCs family

PATCH New Jesse 1 participant 1 message Feb 16, 2021 Arm i.MX and Layerscape

lore
Share & tools
lore

Jesse

author
#0 lore raw

PATCH v5 1/1 timer: imx-gpt: Add timer support for i.MX SoCs family

From: Jesse Taube <[email protected]>

This timer driver is using GPT Timer (General Purpose Timer) available on most i.MX SoCs.
Since this driver is only meant to provide u-boot's timer and counter, and most of the i.MX* SoCs use a 24Mhz crystal,
let's focus on that specific source.

---
V1->V2:
* Fixed indentation
* Fixed capitals
* Made timer work on only 24MHz clock
V2->V3:
* Fixed indentation
* Made implementation imatate the Linux kernel
* Fix wrong definition
V3->V4:
* Fixed indentation
* Made bit manipluation into its own function.
V4->V5:
* Fixed indentation
* Made commit message 75 char
* Moved prescaler code into sub funcions

 drivers/timer/Kconfig         |   7 ++
 drivers/timer/Makefile        |   1 +
 drivers/timer/imx-gpt-timer.c | 160 ++++++++++++++++++++++++++++++++++
 3 files changed, 168 insertions(+)
 create mode 100644 drivers/timer/imx-gpt-timer.c
drivers/timer/Kconfig +7 -0
index 80743a2551..ee81dfa776 100644
@@ -227,4 +227,11 @@ config MCHP_PIT64B_TIMER
 	  Select this to enable support for Microchip 64-bit periodic
 	  interval timer.
 
+config IMX_GPT_TIMER
+	bool "NXP i.MX GPT timer support"
+	depends on TIMER
+	help
+	  Select this to enable support for the timer found on
+	  NXP i.MX devices.
+
 endmenu
drivers/timer/Makefile +1 -0
index eb5c48cc6c..e214ba7268 100644
@@ -25,3 +25,4 @@ obj-$(CONFIG_STM32_TIMER)	+= stm32_timer.o
 obj-$(CONFIG_X86_TSC_TIMER)	+= tsc_timer.o
 obj-$(CONFIG_MTK_TIMER)		+= mtk_timer.o
 obj-$(CONFIG_MCHP_PIT64B_TIMER)	+= mchp-pit64b-timer.o
+obj-$(CONFIG_IMX_GPT_TIMER)	+= imx-gpt-timer.o
drivers/timer/imx-gpt-timer.c new file +160 -0

160 lines not on this page · raw message

Signature · 1 line
2.30.0