linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support
@ 2023-02-03 13:05 Claudiu Beznea
  2023-02-03 13:05 ` [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM Claudiu Beznea
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudiu Beznea @ 2023-02-03 13:05 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, Claudiu Beznea

Hi,

This series adds delay timer support for Microchip PIT64B driver.

Thank you,
Claudiu Beznea

Changed in v2:
- rebase on top of [1] and as a consequence get rid of patch 1/1 from v1

[1] https://lore.kernel.org/all/20230121182911.4e47a5ff@endymion.delvare/

Claudiu Beznea (2):
  clocksource/drivers/timer-microchip-pit64b: select driver only on ARM
  clocksource/drivers/timer-microchip-pit64b: add delay timer

 drivers/clocksource/Kconfig                  |  2 +-
 drivers/clocksource/timer-microchip-pit64b.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM
  2023-02-03 13:05 [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Claudiu Beznea
@ 2023-02-03 13:05 ` Claudiu Beznea
  2023-02-13 18:26   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Select " tip-bot2 for Claudiu Beznea
  2023-02-03 13:05 ` [PATCH v2 2/2] clocksource/drivers/timer-microchip-pit64b: add delay timer Claudiu Beznea
  2023-02-03 13:26 ` [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Daniel Lezcano
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Beznea @ 2023-02-03 13:05 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, Claudiu Beznea

Microchip PIT64B is currently available on ARM based devices. Thus
select it only for ARM. This allows implementing delay timer.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 778dad0c06a9..5fc8f0e7fb38 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -706,7 +706,7 @@ config INGENIC_OST
 
 config MICROCHIP_PIT64B
 	bool "Microchip PIT64B support"
-	depends on OF
+	depends on OF && ARM
 	select TIMER_OF
 	help
 	  This option enables Microchip PIT64B timer for Atmel
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] clocksource/drivers/timer-microchip-pit64b: add delay timer
  2023-02-03 13:05 [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Claudiu Beznea
  2023-02-03 13:05 ` [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM Claudiu Beznea
@ 2023-02-03 13:05 ` Claudiu Beznea
  2023-02-13 18:26   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Add " tip-bot2 for Claudiu Beznea
  2023-02-03 13:26 ` [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Daniel Lezcano
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Beznea @ 2023-02-03 13:05 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, Claudiu Beznea

Add delay timer.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clocksource/timer-microchip-pit64b.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c
index d5f1436f33d9..57209bb38c70 100644
--- a/drivers/clocksource/timer-microchip-pit64b.c
+++ b/drivers/clocksource/timer-microchip-pit64b.c
@@ -9,6 +9,7 @@
 
 #include <linux/clk.h>
 #include <linux/clockchips.h>
+#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -92,6 +93,8 @@ struct mchp_pit64b_clksrc {
 static void __iomem *mchp_pit64b_cs_base;
 /* Default cycles for clockevent timer. */
 static u64 mchp_pit64b_ce_cycles;
+/* Delay timer. */
+static struct delay_timer mchp_pit64b_dt;
 
 static inline u64 mchp_pit64b_cnt_read(void __iomem *base)
 {
@@ -169,6 +172,11 @@ static u64 notrace mchp_pit64b_sched_read_clk(void)
 	return mchp_pit64b_cnt_read(mchp_pit64b_cs_base);
 }
 
+static unsigned long notrace mchp_pit64b_dt_read(void)
+{
+	return mchp_pit64b_cnt_read(mchp_pit64b_cs_base);
+}
+
 static int mchp_pit64b_clkevt_shutdown(struct clock_event_device *cedev)
 {
 	struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
@@ -376,6 +384,10 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer,
 
 	sched_clock_register(mchp_pit64b_sched_read_clk, 64, clk_rate);
 
+	mchp_pit64b_dt.read_current_timer = mchp_pit64b_dt_read;
+	mchp_pit64b_dt.freq = clk_rate;
+	register_current_timer_delay(&mchp_pit64b_dt);
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support
  2023-02-03 13:05 [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Claudiu Beznea
  2023-02-03 13:05 ` [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM Claudiu Beznea
  2023-02-03 13:05 ` [PATCH v2 2/2] clocksource/drivers/timer-microchip-pit64b: add delay timer Claudiu Beznea
@ 2023-02-03 13:26 ` Daniel Lezcano
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2023-02-03 13:26 UTC (permalink / raw)
  To: Claudiu Beznea, tglx; +Cc: linux-kernel

On 03/02/2023 14:05, Claudiu Beznea wrote:
> Hi,
> 
> This series adds delay timer support for Microchip PIT64B driver.
> 
> Thank you,
> Claudiu Beznea
> 
> Changed in v2:
> - rebase on top of [1] and as a consequence get rid of patch 1/1 from v1

Applied, thanks

-- 
<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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Add delay timer
  2023-02-03 13:05 ` [PATCH v2 2/2] clocksource/drivers/timer-microchip-pit64b: add delay timer Claudiu Beznea
@ 2023-02-13 18:26   ` tip-bot2 for Claudiu Beznea
  0 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Claudiu Beznea @ 2023-02-13 18:26 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Claudiu Beznea, Daniel Lezcano, x86, linux-kernel

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

Commit-ID:     f3af3dc7cc351bd22742eac992c72c76749ce8c3
Gitweb:        https://git.kernel.org/tip/f3af3dc7cc351bd22742eac992c72c76749ce8c3
Author:        Claudiu Beznea <claudiu.beznea@microchip.com>
AuthorDate:    Fri, 03 Feb 2023 15:05:37 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Mon, 13 Feb 2023 13:10:17 +01:00

clocksource/drivers/timer-microchip-pit64b: Add delay timer

Add delay timer.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230203130537.1921608-3-claudiu.beznea@microchip.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/timer-microchip-pit64b.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c
index d5f1436..57209bb 100644
--- a/drivers/clocksource/timer-microchip-pit64b.c
+++ b/drivers/clocksource/timer-microchip-pit64b.c
@@ -9,6 +9,7 @@
 
 #include <linux/clk.h>
 #include <linux/clockchips.h>
+#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -92,6 +93,8 @@ struct mchp_pit64b_clksrc {
 static void __iomem *mchp_pit64b_cs_base;
 /* Default cycles for clockevent timer. */
 static u64 mchp_pit64b_ce_cycles;
+/* Delay timer. */
+static struct delay_timer mchp_pit64b_dt;
 
 static inline u64 mchp_pit64b_cnt_read(void __iomem *base)
 {
@@ -169,6 +172,11 @@ static u64 notrace mchp_pit64b_sched_read_clk(void)
 	return mchp_pit64b_cnt_read(mchp_pit64b_cs_base);
 }
 
+static unsigned long notrace mchp_pit64b_dt_read(void)
+{
+	return mchp_pit64b_cnt_read(mchp_pit64b_cs_base);
+}
+
 static int mchp_pit64b_clkevt_shutdown(struct clock_event_device *cedev)
 {
 	struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
@@ -376,6 +384,10 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer,
 
 	sched_clock_register(mchp_pit64b_sched_read_clk, 64, clk_rate);
 
+	mchp_pit64b_dt.read_current_timer = mchp_pit64b_dt_read;
+	mchp_pit64b_dt.freq = clk_rate;
+	register_current_timer_delay(&mchp_pit64b_dt);
+
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Select driver only on ARM
  2023-02-03 13:05 ` [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM Claudiu Beznea
@ 2023-02-13 18:26   ` tip-bot2 for Claudiu Beznea
  0 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Claudiu Beznea @ 2023-02-13 18:26 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Claudiu Beznea, Daniel Lezcano, x86, linux-kernel

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

Commit-ID:     d19c8b2ed176c6aaf3dfefd149c740f73ce4875e
Gitweb:        https://git.kernel.org/tip/d19c8b2ed176c6aaf3dfefd149c740f73ce4875e
Author:        Claudiu Beznea <claudiu.beznea@microchip.com>
AuthorDate:    Fri, 03 Feb 2023 15:05:36 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Mon, 13 Feb 2023 13:10:17 +01:00

clocksource/drivers/timer-microchip-pit64b: Select driver only on ARM

Microchip PIT64B is currently available on ARM based devices. Thus
select it only for ARM. This allows implementing delay timer.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230203130537.1921608-2-claudiu.beznea@microchip.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 45085ab..ac22c1a 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -706,7 +706,7 @@ config INGENIC_OST
 
 config MICROCHIP_PIT64B
 	bool "Microchip PIT64B support"
-	depends on OF
+	depends on OF && ARM
 	select TIMER_OF
 	help
 	  This option enables Microchip PIT64B timer for Atmel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-13 18:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03 13:05 [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Claudiu Beznea
2023-02-03 13:05 ` [PATCH v2 1/2] clocksource/drivers/timer-microchip-pit64b: select driver only on ARM Claudiu Beznea
2023-02-13 18:26   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Select " tip-bot2 for Claudiu Beznea
2023-02-03 13:05 ` [PATCH v2 2/2] clocksource/drivers/timer-microchip-pit64b: add delay timer Claudiu Beznea
2023-02-13 18:26   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Add " tip-bot2 for Claudiu Beznea
2023-02-03 13:26 ` [PATCH v2 0/2] clocksource/drivers/timer-microchip-pit64b: add delay timer support Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).