From: Noam Camus <noamc@ezchip.com>
To: <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <cmetcalf@ezchip.com>,
<daniel.lezcano@linaro.org>, <marc.zyngier@arm.com>,
Noam Camus <noamc@ezchip.com>
Subject: [PATCH v5 09/20] ARC: IRQ: use device tree to get timer device configuration
Date: Sun, 27 Dec 2015 15:23:28 +0200 [thread overview]
Message-ID: <1451222619-3610-10-git-send-email-noamc@ezchip.com> (raw)
In-Reply-To: <1451222619-3610-1-git-send-email-noamc@ezchip.com>
From: Noam Camus <noamc@ezchip.com>
We've designated:
TIMER0 for events (clockevents)
TIMER1 for free running (clocksource)
Till now timer configuration was done on arch/arc/kernel/time.c
with constant values.
This commit add device tree support so we can do this work
at dedicated clocksource driver which parse the DT blob.
Such driver will get clocksource rate as well as interrupt line
from DT and use them for setting clocksourcse and clockevents.
Note that lately called of_clk_init() is moved before we call
clocksource_probe() since at that time device from DT
need a "provider" (clocks) which will be available only after
we call to of_clk_init().
Signed-off-by: Noam Camus <noamc@ezchip.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
---
arch/arc/kernel/setup.c | 1 -
arch/arc/kernel/smp.c | 2 ++
arch/arc/kernel/time.c | 8 ++++++++
3 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index e1b8744..4681e9c 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -433,7 +433,6 @@ void __init setup_arch(char **cmdline_p)
static int __init customize_machine(void)
{
- of_clk_init(NULL);
/*
* Traverses flattened DeviceTree - registering platform devices
* (if any) complete with their resources
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index 2cfe135..ec6a5c1 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -138,7 +138,9 @@ void start_kernel_secondary(void)
pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu);
+#ifndef CONFIG_CLKSRC_OF
arc_local_timer_setup();
+#endif
local_irq_enable();
preempt_disable();
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index dfad287..be6dd9e 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -38,6 +38,7 @@
#include <linux/init.h>
#include <linux/timex.h>
#include <linux/profile.h>
+#include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <asm/irq.h>
@@ -283,6 +284,13 @@ void __init time_init(void)
*/
clocksource_register_hz(&arc_counter, arc_get_core_freq());
+#ifdef CONFIG_COMMON_CLK
+ of_clk_init(NULL);
+#endif
+#ifdef CONFIG_CLKSRC_OF
+ clocksource_probe();
+#else
/* sets up the periodic event timer */
arc_local_timer_setup();
+#endif
}
--
1.7.1
next prev parent reply other threads:[~2015-12-27 13:43 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 13:23 [PATCH v5 00/20] Adding plat-eznps to ARC Noam Camus
2015-12-27 13:23 ` [PATCH v5 01/20] Documentation: Add EZchip vendor to binding list Noam Camus
2015-12-27 13:23 ` [PATCH v5 02/20] soc: Support for EZchip SoC Noam Camus
2015-12-27 13:23 ` [PATCH v5 03/20] ARC: [plat-eznps] define IPI_IRQ Noam Camus
2015-12-27 13:23 ` [PATCH v5 04/20] clocksource: Add NPS400 timers driver Noam Camus
2015-12-27 14:55 ` kbuild test robot
2015-12-27 21:41 ` Noam Camus
2015-12-28 9:00 ` Daniel Lezcano
2015-12-28 10:35 ` Vineet Gupta
2015-12-28 10:55 ` Daniel Lezcano
2015-12-28 11:11 ` Vineet Gupta
2016-01-01 10:31 ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 05/20] irqchip: add nps Internal and external irqchips Noam Camus
2015-12-30 10:08 ` Vineet Gupta
2015-12-30 10:41 ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 06/20] ARC: Set vmalloc size from configuration Noam Camus
2015-12-27 13:23 ` [PATCH v5 07/20] ARC: rwlock: disable interrupts in !LLSC variant Noam Camus
2015-12-27 13:23 ` [PATCH v5 08/20] ARC: Mark secondary cpu online only after all HW setup is done Noam Camus
2015-12-27 13:23 ` Noam Camus [this message]
2015-12-28 11:42 ` [PATCH v5 09/20] ARC: IRQ: use device tree to get timer device configuration Vineet Gupta
2015-12-30 11:20 ` Vineet Gupta
2015-12-27 13:23 ` [PATCH v5 10/20] ARC: IRQ: do not use hwirq directly at arch_do_IRQ() Noam Camus
2015-12-30 10:10 ` Vineet Gupta
2015-12-31 5:21 ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 11/20] ARC: IPI: do not use generic IRQ domain Noam Camus
2015-12-30 10:13 ` Vineet Gupta
2015-12-31 5:14 ` Noam Camus
2015-12-27 13:23 ` [PATCH v5 12/20] ARC: [plat-eznps] Add eznps board defconfig and dts Noam Camus
2015-12-27 13:23 ` [PATCH v5 13/20] ARC: [plat-eznps] Add eznps platform Noam Camus
2015-12-27 13:23 ` [PATCH v5 14/20] ARC: [plat-eznps] Use dedicated user stack top Noam Camus
2015-12-27 13:23 ` [PATCH v5 15/20] ARC: [plat-eznps] Use dedicated atomic/bitops/cmpxchg Noam Camus
2015-12-27 13:23 ` [PATCH v5 16/20] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus
2015-12-27 13:23 ` [PATCH v5 17/20] ARC: [plat-eznps] Use dedicated identity auxiliary register Noam Camus
2015-12-27 13:23 ` [PATCH v5 18/20] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus
2015-12-27 13:23 ` [PATCH v5 19/20] ARC: [plat-eznps] Use dedicated COMMAND_LINE_SIZE Noam Camus
2015-12-27 13:23 ` [PATCH v5 20/20] ARC: Add eznps platform to Kconfig and Makefile Noam Camus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1451222619-3610-10-git-send-email-noamc@ezchip.com \
--to=noamc@ezchip.com \
--cc=cmetcalf@ezchip.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=marc.zyngier@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®