Skip to contentSkip to conversation

Clocksource/clockevents driver updates for v5.2

GIT PULL Ingo Molnar 1 participant 1 message May 18, 2019

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest timers-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus

# HEAD: ea7a5f90f103591f1f38dede52e731ec95ef3c55 Merge tag 'timers-v5.2' of http://git.linaro.org/people/daniel.lezcano/linux into timers/core

Misc clocksource/clockevent driver updates that came in a bit late but are ready for v5.2.

Marked it RFC due to the late date.

Thanks,

Ingo

------------------>
Alexandre Belloni (8):
ARM: at91: move SoC specific definitions to SoC folder clocksource/drivers/tcb_clksrc: Stop depending on atmel_tclib clocksource/drivers/tcb_clksrc: Use tcb as sched_clock
ARM: at91: Implement clocksource selection clocksource/drivers/tcb_clksrc: Move Kconfig option clocksource/drivers/timer-atmel-pit: Rework Kconfig option clocksource/drivers/tcb_clksrc: Rename the file for consistency
misc: atmel_tclib: Do not probe already used TCBs

David Abdurachmanov (1):
clocksource/drivers/sp804: Add COMPILE_TEST to CONFIG_ARM_TIMER_SP804

Joseph Lo (1):
clocksource/drivers/tegra: Rework for compensation of suspend time

Mesih Kilinc (2):
dt-bindings: timer: Add Allwinner suniv timer clocksource/drivers/sun4i: Add a compatible for suniv

Sugaya Taichi (3):
clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer clocksource/drivers/timer-milbeaut: Add shutdown function clocksource/drivers/timer-milbeaut: Cleanup common register accesses

kbuild test robot (1):
clocksource/drivers/timer-atmel-tcb: Convert tc_clksrc_suspend|resume() to static

 .../bindings/timer/allwinner,sun4i-timer.txt       |   4 +-
 arch/arm/mach-at91/Kconfig                         |  23 ++++
 drivers/clocksource/Kconfig                        |  14 ++-
 drivers/clocksource/Makefile                       |   2 +-
 .../{tcb_clksrc.c => timer-atmel-tcb.c}            | 130 ++++++++++++++-------
 drivers/clocksource/timer-milbeaut.c               |  66 ++++++++---
 drivers/clocksource/timer-sun4i.c                  |   5 +-
 drivers/clocksource/timer-tegra20.c                |  63 ++++------
 drivers/misc/Kconfig                               |  24 ----
 drivers/misc/atmel_tclib.c                         |   5 +-
 drivers/pwm/pwm-atmel-tcb.c                        |   2 +-
 include/{linux/atmel_tc.h => soc/at91/atmel_tcb.h} |   4 +-
 12 files changed, 204 insertions(+), 138 deletions(-)
 rename drivers/clocksource/{tcb_clksrc.c => timer-atmel-tcb.c} (79%)
 rename include/{linux/atmel_tc.h => soc/at91/atmel_tcb.h} (99%)
Documentation/devicetree/bindings/timer/allwinner,sun4i-timer.txt +3 -1
index 5c2e23574ca0..3da9d515c03a 100644
@@ -2,7 +2,9 @@ Allwinner A1X SoCs Timer Controller
 
 Required properties:
 
-- compatible : should be "allwinner,sun4i-a10-timer"
+- compatible : should be one of the following:
+              "allwinner,sun4i-a10-timer"
+              "allwinner,suniv-f1c100s-timer"
 - reg : Specifies base physical address and size of the registers.
 - interrupts : The interrupt of the first timer
 - clocks: phandle to the source clock (usually a 24 MHz fixed clock)
arch/arm/mach-at91/Kconfig +23 -0
index 903f23c309df..da1d97a06c53 100644
@@ -107,6 +107,29 @@ config SOC_AT91SAM9
 	    AT91SAM9X35
 	    AT91SAM9XE
 
+comment "Clocksource driver selection"
+
+config ATMEL_CLOCKSOURCE_PIT
+	bool "Periodic Interval Timer (PIT) support"
+	depends on SOC_AT91SAM9 || SOC_SAMA5
+	default SOC_AT91SAM9 || SOC_SAMA5
+	select ATMEL_PIT
+	help
+	  Select this to get a clocksource based on the Atmel Periodic Interval
+	  Timer. It has a relatively low resolution and the TC Block clocksource
+	  should be preferred.
+
+config ATMEL_CLOCKSOURCE_TCB
+	bool "Timer Counter Blocks (TCB) support"
+	default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAMA5
+	select ATMEL_TCB_CLKSRC
+	help
+	  Select this to get a high precision clocksource based on a
+	  TC block with a 5+ MHz base clock rate.
+	  On platforms with 16-bit counters, two timer channels are combined
+	  to make a single 32-bit timer.
+	  It can also be used as a clock event device supporting oneshot mode.
+
 config HAVE_AT91_UTMI
 	bool
 
drivers/clocksource/Kconfig +12 -2
index 171502a356aa..2137f672a12f 100644
@@ -379,7 +379,7 @@ config ARM_GLOBAL_TIMER
 	  This options enables support for the ARM global timer unit
 
 config ARM_TIMER_SP804
-	bool "Support for Dual Timer SP804 module"
+	bool "Support for Dual Timer SP804 module" if COMPILE_TEST
 	depends on GENERIC_SCHED_CLOCK && CLKDEV_LOOKUP
 	select CLKSRC_MMIO
 	select TIMER_OF if OF
@@ -399,8 +399,11 @@ config ARMV7M_SYSTICK
 	  This options enables support for the ARMv7M system timer unit
 
 config ATMEL_PIT
+	bool "Atmel PIT support" if COMPILE_TEST
+	depends on HAS_IOMEM
 	select TIMER_OF if OF
-	def_bool SOC_AT91SAM9 || SOC_SAMA5
+	help
+	  Support for the Periodic Interval Timer found on Atmel SoCs.
 
 config ATMEL_ST
 	bool "Atmel ST timer support" if COMPILE_TEST
@@ -410,6 +413,13 @@ config ATMEL_ST
 	help
 	  Support for the Atmel ST timer.
 
+config ATMEL_TCB_CLKSRC
+	bool "Atmel TC Block timer driver" if COMPILE_TEST
+	depends on HAS_IOMEM
+	select TIMER_OF if OF
+	help
+	  Support for Timer Counter Blocks on Atmel SoCs.
+
 config CLKSRC_EXYNOS_MCT
 	bool "Exynos multi core timer driver" if COMPILE_TEST
 	depends on ARM || ARM64
drivers/clocksource/Makefile +1 -1
index be6e0fbc7489..923b9b60c909 100644
@@ -3,7 +3,7 @@ obj-$(CONFIG_TIMER_OF)		+= timer-of.o
 obj-$(CONFIG_TIMER_PROBE)	+= timer-probe.o
 obj-$(CONFIG_ATMEL_PIT)		+= timer-atmel-pit.o
 obj-$(CONFIG_ATMEL_ST)		+= timer-atmel-st.o
-obj-$(CONFIG_ATMEL_TCB_CLKSRC)	+= tcb_clksrc.o
+obj-$(CONFIG_ATMEL_TCB_CLKSRC)	+= timer-atmel-tcb.o
 obj-$(CONFIG_X86_PM_TIMER)	+= acpi_pm.o
 obj-$(CONFIG_SCx200HR_TIMER)	+= scx200_hrt.o
 obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+= timer-cs5535.o
drivers/clocksource/timer-atmel-tcb.c renamed from drivers/clocksource/tcb_clksrc.c +87 -43

233 lines not on this page · raw message

drivers/clocksource/timer-milbeaut.c +47 -19

116 lines not on this page · raw message

drivers/clocksource/timer-sun4i.c +4 -1
index 6e0180aaf784..65f38f6ca714 100644
@@ -186,7 +186,8 @@ static int __init sun4i_timer_init(struct device_node *node)
 	 */
 	if (of_machine_is_compatible("allwinner,sun4i-a10") ||
 	    of_machine_is_compatible("allwinner,sun5i-a13") ||
-	    of_machine_is_compatible("allwinner,sun5i-a10s"))
+	    of_machine_is_compatible("allwinner,sun5i-a10s") ||
+	    of_machine_is_compatible("allwinner,suniv-f1c100s"))
 		sched_clock_register(sun4i_timer_sched_read, 32,
 				     timer_of_rate(&to));
 
@@ -218,3 +219,5 @@ static int __init sun4i_timer_init(struct device_node *node)
 }
 TIMER_OF_DECLARE(sun4i, "allwinner,sun4i-a10-timer",
 		       sun4i_timer_init);
+TIMER_OF_DECLARE(suniv, "allwinner,suniv-f1c100s-timer",
+		       sun4i_timer_init);
drivers/clocksource/timer-tegra20.c +20 -43

94 lines not on this page · raw message

drivers/misc/Kconfig +0 -24
index 42ab8ec92a04..c84033909395 100644
@@ -59,30 +59,6 @@ config ATMEL_TCLIB
 	  blocks found on many Atmel processors.  This facilitates using
 	  these blocks by different drivers despite processor differences.
 
-config ATMEL_TCB_CLKSRC
-	bool "TC Block Clocksource"
-	depends on ATMEL_TCLIB
-	default y
-	help
-	  Select this to get a high precision clocksource based on a
-	  TC block with a 5+ MHz base clock rate.  Two timer channels
-	  are combined to make a single 32-bit timer.
-
-	  When GENERIC_CLOCKEVENTS is defined, the third timer channel
-	  may be used as a clock event device supporting oneshot mode
-	  (delays of up to two seconds) based on the 32 KiHz clock.
-
-config ATMEL_TCB_CLKSRC_BLOCK
-	int
-	depends on ATMEL_TCB_CLKSRC
-	default 0
-	range 0 1
-	help
-	  Some chips provide more than one TC block, so you have the
-	  choice of which one to use for the clock framework.  The other
-	  TC can be used for other purposes, such as PWM generation and
-	  interval timing.
-
 config DUMMY_IRQ
 	tristate "Dummy IRQ handler"
 	default n
drivers/misc/atmel_tclib.c +4 -1
index ac24a4bd63f7..2c6850ef0e9c 100644
@@ -1,4 +1,3 @@
-#include <linux/atmel_tc.h>
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/init.h>
@@ -10,6 +9,7 @@
 #include <linux/slab.h>
 #include <linux/export.h>
 #include <linux/of.h>
+#include <soc/at91/atmel_tcb.h>
 
 /*
  * This is a thin library to solve the problem of how to portably allocate
@@ -111,6 +111,9 @@ static int __init tc_probe(struct platform_device *pdev)
 	struct resource	*r;
 	unsigned int	i;
 
+	if (of_get_child_count(pdev->dev.of_node))
+		return -EBUSY;
+
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return -EINVAL;
drivers/pwm/pwm-atmel-tcb.c +1 -1
index 0d0f8376bc35..7da1fdb4d269 100644
@@ -17,10 +17,10 @@
 #include <linux/ioport.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
-#include <linux/atmel_tc.h>
 #include <linux/pwm.h>
 #include <linux/of_device.h>
 #include <linux/slab.h>
+#include <soc/at91/atmel_tcb.h>
 
 #define NPWM	6
 
include/soc/at91/atmel_tcb.h renamed from include/linux/atmel_tc.h +2 -2
similarity index 99%
rename from include/linux/atmel_tc.h
rename to include/soc/at91/atmel_tcb.h
index 468fdfa643f0..c3c7200ce151 100644
@@ -7,8 +7,8 @@
  * (at your option) any later version.
  */
 
-#ifndef ATMEL_TC_H
-#define ATMEL_TC_H
+#ifndef __SOC_ATMEL_TCB_H
+#define __SOC_ATMEL_TCB_H
 
 #include <linux/compiler.h>
 #include <linux/list.h>