Skip to contentSkip to conversation

timer for tip/urgent

GIT PULL New Daniel Lezcano 2 participants 7 messages Nov 2, 2018

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

Hi Thomas,

this is a late pull request for the c-sky clocksource and clockevent. These are new drivers, they passed the review process several times for the c-sky architecture.

- Add the per cpu timer for the c-sky architecture (Guo Ren)

- Add the global timer for the c-sky architecture (Guo Ren)

Thanks!

-- Daniel

The following changes since commit 291d0e5d81e101392379217b06251fe8c27f1f80:

Merge tag 'for-linus-20180929' of git://git.kernel.dk/linux-block
(2018-09-29 14:52:14 -0700)

are available in the git repository at:

https://git.linaro.org/people/daniel.lezcano/linux.git
clockevents/4.20-rc1

for you to fetch changes up to ab1e77c3f590536b2659c097980efe6e8f713921:

dt-bindings: timer: gx6605s SOC timer (2018-11-02 19:41:50 +0100)

----------------------------------------------------------------
Guo Ren (4):
clocksource/drivers/c-sky: Add C-SKY SMP timer
dt-bindings: timer: C-SKY Multi-processor timer clocksource/drivers/c-sky: Add gx6605s SOC system timer
dt-bindings: timer: gx6605s SOC timer

 Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt |  42
++++++++++++++++++++++++++++++++++++++++++
 Documentation/devicetree/bindings/timer/csky,mptimer.txt       |  42
++++++++++++++++++++++++++++++++++++++++++
 drivers/clocksource/Kconfig                                    |  18
++++++++++++++++++
 drivers/clocksource/Makefile                                   |   2 ++
 drivers/clocksource/timer-gx6605s.c                            | 154
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/clocksource/timer-mp-csky.c                            | 173
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/cpuhotplug.h                                     |   1 +
 7 files changed, 432 insertions(+)
 create mode 100644
Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/csky,mptimer.txt
 create mode 100644 drivers/clocksource/timer-gx6605s.c
 create mode 100644 drivers/clocksource/timer-mp-csky.c
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
#1 lore raw

PATCH 1/4 clocksource/drivers/c-sky: Add C-SKY SMP timer

From: Guo Ren <[email protected]>

The driver is for C-SKY SMP timer. It only supports oneshot event and 32bit overflow for clocksource. Per cpu core has one timer and all timers share one clock-counter-input from the same clocksource.

This use mfcr&mtcr instructions to access the regs.

Cc Daniel Lezcano <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 drivers/clocksource/Kconfig         |  10 +++
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-mp-csky.c | 173 ++++++++++++++++++++++++++++++++++++
 include/linux/cpuhotplug.h          |   1 +
 4 files changed, 185 insertions(+)
 create mode 100644 drivers/clocksource/timer-mp-csky.c
drivers/clocksource/Kconfig +10 -0
index a11f4ba..591c9a8 100644
@@ -620,4 +620,14 @@ config RISCV_TIMER
 	  is accessed via both the SBI and the rdcycle instruction.  This is
 	  required for all RISC-V systems.
 
+config CSKY_MP_TIMER
+	bool "SMP Timer for the C-SKY platform" if COMPILE_TEST
+	depends on CSKY
+	select TIMER_OF
+	help
+	  Say yes here to enable C-SKY SMP timer driver used for C-SKY SMP
+	  system.
+	  csky,mptimer is not only used in SMP system, it also could be used
+	  single core system. It's not a mmio reg and it use mtcr/mfcr instruction.
+
 endmenu
drivers/clocksource/Makefile +1 -0
index db51b24..5ce82d3 100644
@@ -79,3 +79,4 @@ obj-$(CONFIG_CLKSRC_ST_LPC)		+= clksrc_st_lpc.o
 obj-$(CONFIG_X86_NUMACHIP)		+= numachip.o
 obj-$(CONFIG_ATCPIT100_TIMER)		+= timer-atcpit100.o
 obj-$(CONFIG_RISCV_TIMER)		+= riscv_timer.o
+obj-$(CONFIG_CSKY_MP_TIMER)		+= timer-mp-csky.o
drivers/clocksource/timer-mp-csky.c new file +173 -0

173 lines not on this page · raw message

include/linux/cpuhotplug.h +1 -0
index caf40ad..e0cd2ba 100644
@@ -126,6 +126,7 @@ enum cpuhp_state {
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_ARC_TIMER_STARTING,
 	CPUHP_AP_RISCV_TIMER_STARTING,
+	CPUHP_AP_CSKY_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
 	CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
 	CPUHP_AP_KVM_ARM_VGIC_STARTING,
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/4 dt-bindings: timer: C-SKY Multi-processor timer

From: Guo Ren <[email protected]>

Dt-bingdings doc for C-SKY SMP system setting.

---
 .../devicetree/bindings/timer/csky,mptimer.txt     | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/csky,mptimer.txt
Documentation/devicetree/bindings/timer/csky,mptimer.txt new file +42 -0
new file mode 100644
index 0000000..15cfec0
@@ -0,0 +1,42 @@
+============================
+C-SKY Multi-processors Timer
+============================
+
+C-SKY multi-processors timer is designed for C-SKY SMP system and the
+regs is accessed by cpu co-processor 4 registers with mtcr/mfcr.
+
+ - PTIM_CTLR "cr<0, 14>" Control reg to start reset timer.
+ - PTIM_TSR  "cr<1, 14>" Interrupt cleanup status reg.
+ - PTIM_CCVR "cr<3, 14>" Current counter value reg.
+ - PTIM_LVR  "cr<6, 14>" Window value reg to triger next event.
+
+==============================
+timer node bindings definition
+==============================
+
+	Description: Describes SMP timer
+
+	PROPERTIES
+
+	- compatible
+		Usage: required
+		Value type: <string>
+		Definition: must be "csky,mptimer"
+	- clocks
+		Usage: required
+		Value type: <node>
+		Definition: must be input clk node
+	- interrupts
+		Usage: required
+		Value type: <u32>
+		Definition: must be timer irq num defined by soc
+
+Examples:
+---------
+
+	timer: timer {
+		compatible = "csky,mptimer";
+		clocks = <&dummy_apb_clk>;
+		interrupts = <16>;
+		interrupt-parent = <&intc>;
+	};
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/4 clocksource/drivers/c-sky: Add gx6605s SOC system timer

In reply to Daniel Lezcano

From: Guo Ren <[email protected]>

The driver is for gx6605s SOC system timer and there are two same timers in gx6605s. We use one for clkevt and another one for clksrc.

The timer is mmio map to access, so we need give mmio address in dts.

The counter at 0x0 offset is clock event.
The counter at 0x40 offset is clock source.

Cc Daniel Lezcano <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 drivers/clocksource/Kconfig         |   8 ++
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-gx6605s.c | 154 ++++++++++++++++++++++++++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 drivers/clocksource/timer-gx6605s.c
drivers/clocksource/Kconfig +8 -0
index 591c9a8..55c77e4 100644
@@ -630,4 +630,12 @@ config CSKY_MP_TIMER
 	  csky,mptimer is not only used in SMP system, it also could be used
 	  single core system. It's not a mmio reg and it use mtcr/mfcr instruction.
 
+config GX6605S_TIMER
+	bool "Gx6605s SOC system timer driver" if COMPILE_TEST
+	depends on CSKY
+	select CLKSRC_MMIO
+	select TIMER_OF
+	help
+	  This option enables support for gx6605s SOC's timer.
+
 endmenu
drivers/clocksource/Makefile +1 -0
index 5ce82d3..9196331 100644
@@ -80,3 +80,4 @@ obj-$(CONFIG_X86_NUMACHIP)		+= numachip.o
 obj-$(CONFIG_ATCPIT100_TIMER)		+= timer-atcpit100.o
 obj-$(CONFIG_RISCV_TIMER)		+= riscv_timer.o
 obj-$(CONFIG_CSKY_MP_TIMER)		+= timer-mp-csky.o
+obj-$(CONFIG_GX6605S_TIMER)		+= timer-gx6605s.o
drivers/clocksource/timer-gx6605s.c new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/4 dt-bindings: timer: gx6605s SOC timer

In reply to Daniel Lezcano

From: Guo Ren <[email protected]>

Dt-bindings doc for gx6605s SOC's system timer.

---
 .../bindings/timer/csky,gx6605s-timer.txt          | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt
Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt new file +42 -0
new file mode 100644
index 0000000..6b04344
@@ -0,0 +1,42 @@
+=================
+gx6605s SOC Timer
+=================
+
+The timer is used in gx6605s soc as system timer and the driver
+contain clk event and clk source.
+
+==============================
+timer node bindings definition
+==============================
+
+	Description: Describes gx6605s SOC timer
+
+	PROPERTIES
+
+	- compatible
+		Usage: required
+		Value type: <string>
+		Definition: must be "csky,gx6605s-timer"
+	- reg
+		Usage: required
+		Value type: <u32 u32>
+		Definition: <phyaddr size> in soc from cpu view
+	- clocks
+		Usage: required
+		Value type: phandle + clock specifier cells
+		Definition: must be input clk node
+	- interrupt
+		Usage: required
+		Value type: <u32>
+		Definition: must be timer irq num defined by soc
+
+Examples:
+---------
+
+	timer0: timer@20a000 {
+		compatible = "csky,gx6605s-timer";
+		reg = <0x0020a000 0x400>;
+		clocks = <&dummy_apb_clk>;
+		interrupts = <10>;
+		interrupt-parent = <&intc>;
+	};
Signature · 1 line
2.7.4
#5 lore raw
In reply to Daniel Lezcano

Daniel,

Quoted 7 lines · Daniel Lezcano

this is a late pull request for the c-sky clocksource and clockevent. These are new drivers, they passed the review process several times for the c-sky architecture.

- Add the per cpu timer for the c-sky architecture (Guo Ren)

- Add the global timer for the c-sky architecture (Guo Ren)

Pulled. Can you please tag your pull requests in future and add the above short summary into the tag. That automatically creates a merge commit and I get the summary right into it.

Thanks,

tglx

#6 lore raw
Quoted 8 lines · Thomas Gleixner

Daniel,

Quoted 4 lines · Daniel Lezcano

this is a late pull request for the c-sky clocksource and clockevent. These are new drivers, they passed the review process several times for the c-sky architecture.

Quoted 7 lines
Quoted 3 lines

- Add the per cpu timer for the c-sky architecture (Guo Ren)

- Add the global timer for the c-sky architecture (Guo Ren)

Pulled. Can you please tag your pull requests in future and add the above short summary into the tag. That automatically creates a merge commit and I get the summary right into it.

Ok, will do next time.

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