linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vineet.Gupta1@synopsys.com (Vineet Gupta)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v2 06/10] ARC: timer: Build gfrc, rtc under same option (64-bit timers)
Date: Thu, 3 Nov 2016 14:31:37 -0700	[thread overview]
Message-ID: <1478208701-30923-7-git-send-email-vgupta@synopsys.com> (raw)
In-Reply-To: <1478208701-30923-1-git-send-email-vgupta@synopsys.com>

The original distinction was done as they were deveoped at different
times and primarily becuse they are specific to UP (RTC) and SMP (GFRC).

But given that driver now handles that at runtime, (i.e. not allowing
RTC as clocksource in SMP), we can simplify things a bit.

Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
---
 arch/arc/Kconfig                           | 10 ++--------
 arch/arc/configs/nsimosci_hs_smp_defconfig |  2 +-
 arch/arc/configs/vdk_hs38_smp_defconfig    |  2 +-
 arch/arc/kernel/setup.c                    |  4 ++--
 arch/arc/kernel/time.c                     |  6 +-----
 5 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index bd204bfa29ed..bde3e558d8bc 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -410,15 +410,9 @@ config ARC_HAS_DIV_REM
 	bool "Insn: div, divu, rem, remu"
 	default y
 
-config ARC_HAS_RTC
-	bool "Local 64-bit r/o cycle counter"
-	default n
-	depends on !SMP
-
-config ARC_HAS_GFRC
-	bool "SMP synchronized 64-bit cycle counter"
+config ARC_TIMERS_64BIT
+	bool "64-bit r/o cycle counters RTC (up) and GFRC (smp)"
 	default y
-	depends on SMP
 
 config ARC_NUMBER_OF_INTERRUPTS
 	int "Number of interrupts"
diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig
index 6da71ba253a9..155add7761ed 100644
--- a/arch/arc/configs/nsimosci_hs_smp_defconfig
+++ b/arch/arc/configs/nsimosci_hs_smp_defconfig
@@ -21,7 +21,7 @@ CONFIG_MODULES=y
 CONFIG_ARC_PLAT_SIM=y
 CONFIG_ISA_ARCV2=y
 CONFIG_SMP=y
-# CONFIG_ARC_HAS_GFRC is not set
+# CONFIG_ARC_TIMERS_64BIT is not set
 CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs_idu"
 CONFIG_PREEMPT=y
 # CONFIG_COMPACTION is not set
diff --git a/arch/arc/configs/vdk_hs38_smp_defconfig b/arch/arc/configs/vdk_hs38_smp_defconfig
index 969b206d6c67..573028f19de7 100644
--- a/arch/arc/configs/vdk_hs38_smp_defconfig
+++ b/arch/arc/configs/vdk_hs38_smp_defconfig
@@ -15,7 +15,7 @@ CONFIG_ARC_PLAT_AXS10X=y
 CONFIG_AXS103=y
 CONFIG_ISA_ARCV2=y
 CONFIG_SMP=y
-# CONFIG_ARC_HAS_GFRC is not set
+# CONFIG_ARC_TIMERS_64BIT is not set
 CONFIG_ARC_UBOOT_SUPPORT=y
 CONFIG_ARC_BUILTIN_DTB_NAME="vdk_hs38_smp"
 CONFIG_PREEMPT=y
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 5865bd34a7fa..3093fa898a23 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -239,8 +239,8 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
 	n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ",
 		       IS_AVAIL1(cpu->extn.timer0, "Timer0 "),
 		       IS_AVAIL1(cpu->extn.timer1, "Timer1 "),
-		       IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_HAS_RTC),
-		       IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_HAS_GFRC));
+		       IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT),
+		       IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT));
 
 	n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s",
 			   IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC),
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index 05a583414c65..9bb7e3105ca9 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -81,7 +81,7 @@ static int noinline arc_get_timer_clk(struct device_node *node)
 
 /********** Clock Source Device *********/
 
-#ifdef CONFIG_ARC_HAS_GFRC
+#ifdef CONFIG_ARC_TIMERS_64BIT
 
 static cycle_t arc_read_gfrc(struct clocksource *cs)
 {
@@ -128,10 +128,6 @@ static int __init arc_cs_setup_gfrc(struct device_node *node)
 }
 CLOCKSOURCE_OF_DECLARE(arc_gfrc, "snps,archs-timer-gfrc", arc_cs_setup_gfrc);
 
-#endif
-
-#ifdef CONFIG_ARC_HAS_RTC
-
 #define AUX_RTC_CTRL	0x103
 #define AUX_RTC_LOW	0x104
 #define AUX_RTC_HIGH	0x105
-- 
2.7.4

  parent reply	other threads:[~2016-11-03 21:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 21:31 [PATCH v2 00/10] Move ARC timer code into drivers/clocksource/ Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 01/10] ARC: timer: rtc: implement read loop in "C" vs. inline asm Vineet Gupta
2016-11-03 21:52   ` Daniel Lezcano
2016-11-03 22:23     ` Vineet Gupta
2016-11-03 22:35       ` Daniel Lezcano
2016-11-03 22:44         ` Vineet Gupta
2016-11-03 22:46           ` Daniel Lezcano
2016-11-04 17:58   ` Alexey Brodkin
2016-11-03 21:31 ` [PATCH v2 02/10] ARC: timer: gfrc, rtc: deuglify big endian code Vineet Gupta
2016-11-03 21:55   ` Daniel Lezcano
2016-11-03 22:15     ` Vineet Gupta
2016-11-04 18:11   ` Alexey Brodkin
2016-11-03 21:31 ` [PATCH v2 03/10] ARC: timer: gfrc, rtc: Read BCR to detect whether hardware exists Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 04/10] ARC: timer: gfrc: boot print alongside other timers Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 05/10] ARC: time: move time_init() out of the driver Vineet Gupta
2016-11-03 21:31 ` Vineet Gupta [this message]
2016-11-03 22:13   ` [PATCH v2 06/10] ARC: timer: Build gfrc, rtc under same option (64-bit timers) Daniel Lezcano
2016-11-03 21:31 ` [PATCH v2 07/10] ARC: breakout aux handling into a separate header Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 08/10] ARC: move mcip.h into include/soc and adjust the includes Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 09/10] ARC: breakout timer include code into separate header Vineet Gupta
2016-11-03 21:31 ` [PATCH v2 10/10] clocksource: import ARC timer driver Vineet Gupta
2016-11-03 22:38   ` Daniel Lezcano
2016-11-03 22:50     ` Vineet Gupta
2016-11-03 23:01       ` Daniel Lezcano
2016-11-03 23:06         ` Vineet Gupta

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=1478208701-30923-7-git-send-email-vgupta@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=linux-snps-arc@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).