Skip to contentSkip to conversation

clocksource: Add driver for the Ingenic JZ47xx OST

PATCH Applied Paul Cercueil 3 participants 3 messages Feb 12, 2020 – Mar 19, 2020 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 clocksource: Add driver for the Ingenic JZ47xx OST

From: Maarten ter Huurne <[email protected]>

OST is the OS Timer, a 64-bit timer/counter with buffered reading.

SoCs before the JZ4770 had (if any) a 32-bit OST; the JZ4770 and JZ4780 have a 64-bit OST.

This driver will register both a clocksource and a sched_clock to the system.

---

Notes:
v2: local_irq_save/restore were moved within sched_clock_register
v3: Only register as 32-bit clocksource to simplify things
v4: - Bypass regmap to read counters.
- Use sched_clock_register_new() to avoid having a global pointer to the ingenic_ost.
- Don't print error codes in probe, since they will be printed anyway if the probe function fails.
- Rebased on 5.6-rc1.
v5: Restored global pointer to the ingenic_ost

 drivers/clocksource/Kconfig       |   8 ++
 drivers/clocksource/Makefile      |   1 +
 drivers/clocksource/ingenic-ost.c | 189 ++++++++++++++++++++++++++++++
 3 files changed, 198 insertions(+)
 create mode 100644 drivers/clocksource/ingenic-ost.c
drivers/clocksource/Kconfig +8 -0
index cc909e465823..f2142e6bbea3 100644
@@ -697,6 +697,14 @@ config INGENIC_TIMER
 	help
 	  Support for the timer/counter unit of the Ingenic JZ SoCs.
 
+config INGENIC_OST
+	bool "Clocksource for Ingenic OS Timer"
+	depends on MIPS || COMPILE_TEST
+	depends on COMMON_CLK
+	select MFD_SYSCON
+	help
+	  Support for the Operating System Timer of the Ingenic JZ SoCs.
+
 config MICROCHIP_PIT64B
 	bool "Microchip PIT64B support"
 	depends on OF || COMPILE_TEST
drivers/clocksource/Makefile +1 -0
index 713686faa549..641ba5383ab5 100644
@@ -80,6 +80,7 @@ obj-$(CONFIG_ASM9260_TIMER)		+= asm9260_timer.o
 obj-$(CONFIG_H8300_TMR8)		+= h8300_timer8.o
 obj-$(CONFIG_H8300_TMR16)		+= h8300_timer16.o
 obj-$(CONFIG_H8300_TPU)			+= h8300_tpu.o
+obj-$(CONFIG_INGENIC_OST)		+= ingenic-ost.o
 obj-$(CONFIG_INGENIC_TIMER)		+= ingenic-timer.o
 obj-$(CONFIG_CLKSRC_ST_LPC)		+= clksrc_st_lpc.o
 obj-$(CONFIG_X86_NUMACHIP)		+= numachip.o
drivers/clocksource/ingenic-ost.c new file +189 -0

189 lines not on this page · raw message

Signature · 1 line
2.25.0
#1 lore raw
Quoted 7 lines · Paul Cercueil

From: Maarten ter Huurne <[email protected]>

OST is the OS Timer, a 64-bit timer/counter with buffered reading.

SoCs before the JZ4770 had (if any) a 32-bit OST; the JZ4770 and JZ4780 have a 64-bit OST.

Quoted 8 lines

This driver will register both a clocksource and a sched_clock to the system.

---

Applied, thanks

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#2 lore raw
In reply to Paul Cercueil
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     ca7b72b5a5f248b72c88441a93bdcee22f42b9b3
Gitweb:        https://git.kernel.org/tip/ca7b72b5a5f248b72c88441a93bdcee22f42b9b3
Author:        Maarten ter Huurne <[email protected]>
AuthorDate:    Wed, 12 Feb 2020 15:04:08 -03:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Thu, 27 Feb 2020 09:37:29 +01:00

clocksource: Add driver for the Ingenic JZ47xx OST

OST is the OS Timer, a 64-bit timer/counter with buffered reading.

SoCs before the JZ4770 had (if any) a 32-bit OST; the JZ4770 and JZ4780 have a 64-bit OST.

This driver will register both a clocksource and a sched_clock to the system.

---
 drivers/clocksource/Kconfig       |   8 +-
 drivers/clocksource/Makefile      |   1 +-
 drivers/clocksource/ingenic-ost.c | 189 +++++++++++++++++++++++++++++-
 3 files changed, 198 insertions(+)
 create mode 100644 drivers/clocksource/ingenic-ost.c
drivers/clocksource/Kconfig +8 -0
index cc909e4..f2142e6 100644
@@ -697,6 +697,14 @@ config INGENIC_TIMER
 	help
 	  Support for the timer/counter unit of the Ingenic JZ SoCs.
 
+config INGENIC_OST
+	bool "Clocksource for Ingenic OS Timer"
+	depends on MIPS || COMPILE_TEST
+	depends on COMMON_CLK
+	select MFD_SYSCON
+	help
+	  Support for the Operating System Timer of the Ingenic JZ SoCs.
+
 config MICROCHIP_PIT64B
 	bool "Microchip PIT64B support"
 	depends on OF || COMPILE_TEST
drivers/clocksource/Makefile +1 -0
index 713686f..641ba53 100644
@@ -80,6 +80,7 @@ obj-$(CONFIG_ASM9260_TIMER)		+= asm9260_timer.o
 obj-$(CONFIG_H8300_TMR8)		+= h8300_timer8.o
 obj-$(CONFIG_H8300_TMR16)		+= h8300_timer16.o
 obj-$(CONFIG_H8300_TPU)			+= h8300_tpu.o
+obj-$(CONFIG_INGENIC_OST)		+= ingenic-ost.o
 obj-$(CONFIG_INGENIC_TIMER)		+= ingenic-timer.o
 obj-$(CONFIG_CLKSRC_ST_LPC)		+= clksrc_st_lpc.o
 obj-$(CONFIG_X86_NUMACHIP)		+= numachip.o
drivers/clocksource/ingenic-ost.c new file +189 -0

189 lines not on this page · raw message