linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 13/16] ARM: local timers: remove smp_twd from arch/arm
Date: Thu, 16 Jun 2011 20:06:41 +0100	[thread overview]
Message-ID: <1308251204-16719-14-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1308251204-16719-1-git-send-email-marc.zyngier@arm.com>

There is no in-tree user of arch/arm/kernel/smp_twd.c, as they've
been all converted to driver/clocksource/arm_smp_twd.c.

Shed a tear, and get rid of it.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/Kconfig                  |    8 --
 arch/arm/include/asm/localtimer.h |   10 ---
 arch/arm/include/asm/smp_twd.h    |   28 -------
 arch/arm/kernel/Makefile          |    1 -
 arch/arm/kernel/smp_twd.c         |  163 -------------------------------------
 5 files changed, 0 insertions(+), 210 deletions(-)
 delete mode 100644 arch/arm/include/asm/smp_twd.h
 delete mode 100644 arch/arm/kernel/smp_twd.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dafb20a..f3c1124 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1370,13 +1370,6 @@ config HAVE_ARM_SCU
 	help
 	  This option enables support for the ARM system coherency unit
 
-config HAVE_ARM_TWD
-	bool
-	depends on SMP
-	select TICK_ONESHOT
-	help
-	  This options enables support for the ARM timer and watchdog unit
-
 choice
 	prompt "Memory split"
 	default VMSPLIT_3G
@@ -1417,7 +1410,6 @@ config LOCAL_TIMERS
 	bool "Use local timer interrupts"
 	depends on SMP && !LOCAL_TIMER_DEVICES
 	default y
-	select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
 	help
 	  Enable support for local timers on SMP platforms, rather then the
 	  legacy IPI broadcast method.  Local timers allows the system
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 5c8acb4..74af2cd 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -26,22 +26,12 @@ irqreturn_t percpu_timer_handler(int irq, void *dev_id);
 
 #ifdef CONFIG_LOCAL_TIMERS
 
-#ifdef CONFIG_HAVE_ARM_TWD
-
-#include "smp_twd.h"
-
-#define local_timer_ack()	twd_timer_ack()
-
-#else
-
 /*
  * Platform provides this to acknowledge a local timer IRQ.
  * Returns true if the local timer IRQ is to be processed.
  */
 int local_timer_ack(void);
 
-#endif
-
 /*
  * Setup a local timer interrupt for a CPU.
  */
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
deleted file mode 100644
index fed9981..0000000
--- a/arch/arm/include/asm/smp_twd.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __ASMARM_SMP_TWD_H
-#define __ASMARM_SMP_TWD_H
-
-#define TWD_TIMER_LOAD			0x00
-#define TWD_TIMER_COUNTER		0x04
-#define TWD_TIMER_CONTROL		0x08
-#define TWD_TIMER_INTSTAT		0x0C
-
-#define TWD_WDOG_LOAD			0x20
-#define TWD_WDOG_COUNTER		0x24
-#define TWD_WDOG_CONTROL		0x28
-#define TWD_WDOG_INTSTAT		0x2C
-#define TWD_WDOG_RESETSTAT		0x30
-#define TWD_WDOG_DISABLE		0x34
-
-#define TWD_TIMER_CONTROL_ENABLE	(1 << 0)
-#define TWD_TIMER_CONTROL_ONESHOT	(0 << 1)
-#define TWD_TIMER_CONTROL_PERIODIC	(1 << 1)
-#define TWD_TIMER_CONTROL_IT_ENABLE	(1 << 2)
-
-struct clock_event_device;
-
-extern void __iomem *twd_base;
-
-int twd_timer_ack(void);
-void twd_timer_setup(struct clock_event_device *);
-
-#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index a5b31af..c6c6d8b 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_PM_SLEEP)		+= sleep.o
 obj-$(CONFIG_HAVE_SCHED_CLOCK)	+= sched_clock.o
 obj-$(CONFIG_SMP)		+= smp.o smp_tlb.o
 obj-$(CONFIG_HAVE_ARM_SCU)	+= smp_scu.o
-obj-$(CONFIG_HAVE_ARM_TWD)	+= smp_twd.o
 obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER)	+= ftrace.o
 obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
deleted file mode 100644
index aa99656..0000000
--- a/arch/arm/kernel/smp_twd.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- *  linux/arch/arm/kernel/smp_twd.c
- *
- *  Copyright (C) 2002 ARM Ltd.
- *  All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/smp.h>
-#include <linux/jiffies.h>
-#include <linux/clockchips.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-
-#include <asm/smp_twd.h>
-#include <asm/localtimer.h>
-#include <asm/hardware/gic.h>
-
-/* set up by the platform code */
-void __iomem *twd_base;
-
-static unsigned long twd_timer_rate;
-static DEFINE_PER_CPU(bool, irq_reqd);
-
-static void twd_set_mode(enum clock_event_mode mode,
-			struct clock_event_device *clk)
-{
-	unsigned long ctrl;
-
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-		/* timer load already set up */
-		ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE
-			| TWD_TIMER_CONTROL_PERIODIC;
-		__raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD);
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-		/* period set, and timer enabled in 'next_event' hook */
-		ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT;
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-		disable_irq(clk->irq);
-		/* fall through */
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	default:
-		ctrl = 0;
-	}
-
-	__raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
-}
-
-static int twd_set_next_event(unsigned long evt,
-			struct clock_event_device *unused)
-{
-	unsigned long ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
-
-	ctrl |= TWD_TIMER_CONTROL_ENABLE;
-
-	__raw_writel(evt, twd_base + TWD_TIMER_COUNTER);
-	__raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
-
-	return 0;
-}
-
-/*
- * local_timer_ack: checks for a local timer interrupt.
- *
- * If a local timer interrupt has occurred, acknowledge and return 1.
- * Otherwise, return 0.
- */
-int twd_timer_ack(void)
-{
-	if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
-		__raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
-		return 1;
-	}
-
-	return 0;
-}
-
-static void __cpuinit twd_calibrate_rate(void)
-{
-	unsigned long count;
-	u64 waitjiffies;
-
-	/*
-	 * If this is the first time round, we need to work out how fast
-	 * the timer ticks
-	 */
-	if (twd_timer_rate == 0) {
-		printk(KERN_INFO "Calibrating local timer... ");
-
-		/* Wait for a tick to start */
-		waitjiffies = get_jiffies_64() + 1;
-
-		while (get_jiffies_64() < waitjiffies)
-			udelay(10);
-
-		/* OK, now the tick has started, let's get the timer going */
-		waitjiffies += 5;
-
-				 /* enable, no interrupt or reload */
-		__raw_writel(0x1, twd_base + TWD_TIMER_CONTROL);
-
-				 /* maximum value */
-		__raw_writel(0xFFFFFFFFU, twd_base + TWD_TIMER_COUNTER);
-
-		while (get_jiffies_64() < waitjiffies)
-			udelay(10);
-
-		count = __raw_readl(twd_base + TWD_TIMER_COUNTER);
-
-		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
-
-		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-			(twd_timer_rate / 1000000) % 100);
-	}
-}
-
-/*
- * Setup the local clock events for a CPU.
- */
-void __cpuinit twd_timer_setup(struct clock_event_device *clk)
-{
-	int err;
-	bool *reqd;
-
-	twd_calibrate_rate();
-
-	clk->name = "local_timer";
-	clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
-			CLOCK_EVT_FEAT_C3STOP;
-	clk->rating = 350;
-	clk->set_mode = twd_set_mode;
-	clk->set_next_event = twd_set_next_event;
-	clk->shift = 20;
-	clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
-	clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
-	clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
-
-	reqd = &__get_cpu_var(irq_reqd);
-	if (!*reqd) {
-		err = request_irq(clk->irq, percpu_timer_handler,
-				  IRQF_PERCPU | IRQF_NOBALANCING | IRQF_TIMER,
-				  clk->name, clk);
-		if (err) {
-			pr_err("%s: can't register interrupt %d on cpu %d (%d)\n",
-			       clk->name, clk->irq, smp_processor_id(), err);
-			return;
-		}
-
-		*reqd = true;
-	} else
-		enable_irq(clk->irq);
-
-	clockevents_register_device(clk);
-}
-- 
1.7.0.4

  parent reply	other threads:[~2011-06-16 19:06 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 19:06 [RFC PATCH 00/16] Consolidation: move SMP local timers to driver/clocksource Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 01/16] ARM: local timers: early device probing hooks Marc Zyngier
2011-06-17 14:56   ` Arnd Bergmann
2011-06-17 15:13     ` Marc Zyngier
2011-06-17 16:10       ` Arnd Bergmann
2011-06-16 19:06 ` [RFC PATCH 02/16] ARM: local timers: add arm_smp_twd driver to driver/clocksource Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 03/16] ARM: local timers: move realview to LOCAL_TIMER_DEVICES/ARM_SMP_TWD Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 04/16] ARM: local timers: move vexpress " Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 05/16] ARM: local timers: remove localtimer.c from plat-versatile Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 06/16] ARM: local timers: move Tegra to LOCAL_TIMER_DEVICES/ARM_SMP_TWD Marc Zyngier
2011-06-16 20:07   ` Stephen Warren
2011-06-16 20:22     ` Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 07/16] ARM: local timers: move OMAP4 " Marc Zyngier
2011-06-17  8:16   ` Santosh Shilimkar
2011-06-17  8:39     ` Marc Zyngier
2011-06-17  8:42       ` Santosh Shilimkar
2011-06-16 19:06 ` [RFC PATCH 08/16] ARM: local timers: move shmobile " Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 09/16] ARM: local timers: move ux500 " Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 10/16] ARM: local timers: add exynos_mct driver to driver/clocksource Marc Zyngier
2011-06-17 15:09   ` Arnd Bergmann
2011-06-17 15:17     ` Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 11/16] ARM: local timers: move exynos4 to LOCAL_TIMER_DEVICES/EXYNOS_MCT/ARM_SMP_TWD Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 12/16] ARM: watchdog: make mpcore_wdt independant from asm/smp_twd.h Marc Zyngier
2011-06-17  7:08   ` Wim Van Sebroeck
2011-06-17  8:04     ` Marc Zyngier
2011-06-16 19:06 ` Marc Zyngier [this message]
2011-06-16 19:06 ` [RFC PATCH 14/16] ARM: local timers: add msm_timer driver to driver/clocksource Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 15/16] ARM: local timers: move msm to LOCAL_TIMER_DEVICES/MSM_TIMER Marc Zyngier
2011-06-16 19:06 ` [RFC PATCH 16/16] ARM: local timers: remove local timer support from arch/arm Marc Zyngier
2011-06-17 11:00 ` [RFC PATCH 00/16] Consolidation: move SMP local timers to driver/clocksource Linus Walleij
2011-06-17 13:27   ` Marc Zyngier
2011-06-20  8:21     ` Linus Walleij
2011-06-17 15:07 ` Arnd Bergmann
2011-06-17 15:24   ` Marc Zyngier
2011-06-17 17:25   ` Rob Herring
2011-06-20  8:25     ` Marc Zyngier
2011-06-20  8:32       ` Russell King - ARM Linux
2011-06-22  0:54         ` Magnus Damm
2011-06-26  7:00         ` Grant Likely
2011-06-27  4:53           ` Magnus Damm
2011-06-21 11:13     ` Marc Zyngier
2011-06-21 12:51       ` Rob Herring
2011-06-21 13:02         ` Marc Zyngier
2011-06-21 13:18           ` Rob Herring
2011-06-21 13:46             ` Marc Zyngier
2011-06-20  8:23   ` Linus Walleij

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=1308251204-16719-14-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@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).