From: tip-bot for Eric Anholt <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, swarren@wwwdotorg.org, lee@kernel.org,
linux-kernel@vger.kernel.org, jason@lakedaemon.net,
f.fainelli@gmail.com, mingo@kernel.org, eric@anholt.net,
hpa@zytor.com, marc.zyngier@arm.com
Subject: [tip:irq/core] irqchip/bcm2836: Fix initialization of the LOCAL_IRQ_CNT timers
Date: Tue, 29 Dec 2015 02:45:37 -0800 [thread overview]
Message-ID: <tip-401667bb8a2e0825090c5e6c15b899c1c36a4773@git.kernel.org> (raw)
In-Reply-To: <1451166444-11044-2-git-send-email-eric@anholt.net>
Commit-ID: 401667bb8a2e0825090c5e6c15b899c1c36a4773
Gitweb: http://git.kernel.org/tip/401667bb8a2e0825090c5e6c15b899c1c36a4773
Author: Eric Anholt <eric@anholt.net>
AuthorDate: Sat, 26 Dec 2015 13:47:21 -0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 29 Dec 2015 11:40:45 +0100
irqchip/bcm2836: Fix initialization of the LOCAL_IRQ_CNT timers
The irqchip's register area includes the the setup for the timer's
scaling factors, and for the platform we want a fixed configuration of
these registers.
Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Lee Jones <lee@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-rpi-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1451166444-11044-2-git-send-email-eric@anholt.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/irqchip/irq-bcm2836.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index f687082..6ec125e 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -21,6 +21,9 @@
#include <linux/irqdomain.h>
#include <asm/exception.h>
+#define LOCAL_CONTROL 0x000
+#define LOCAL_PRESCALER 0x008
+
/*
* The low 2 bits identify the CPU that the GPU IRQ goes to, and the
* next 2 bits identify the CPU that the GPU FIQ goes to.
@@ -237,6 +240,27 @@ bcm2836_arm_irqchip_smp_init(void)
#endif
}
+/*
+ * The LOCAL_IRQ_CNT* timer firings are based off of the external
+ * oscillator with some scaling. The firmware sets up CNTFRQ to
+ * report 19.2Mhz, but doesn't set up the scaling registers.
+ */
+static void bcm2835_init_local_timer_frequency(void)
+{
+ /*
+ * Set the timer to source from the 19.2Mhz crystal clock (bit
+ * 8 unset), and only increment by 1 instead of 2 (bit 9
+ * unset).
+ */
+ writel(0, intc.base + LOCAL_CONTROL);
+
+ /*
+ * Set the timer prescaler to 1:1 (timer freq = input freq *
+ * 2**31 / prescaler)
+ */
+ writel(0x80000000, intc.base + LOCAL_PRESCALER);
+}
+
static int __init bcm2836_arm_irqchip_l1_intc_of_init(struct device_node *node,
struct device_node *parent)
{
@@ -246,6 +270,8 @@ static int __init bcm2836_arm_irqchip_l1_intc_of_init(struct device_node *node,
node->full_name);
}
+ bcm2835_init_local_timer_frequency();
+
intc.domain = irq_domain_add_linear(node, LAST_IRQ + 1,
&bcm2836_arm_irqchip_intc_ops,
NULL);
next prev parent reply other threads:[~2015-12-29 10:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-26 21:47 [PATCH 0/4] bcm2836 (Raspberry Pi 2) interrupt controller updates for 4.5 Eric Anholt
2015-12-26 21:47 ` [PATCH 1/4] irqchip: bcm2836: Fix initialization of the LOCAL_IRQ_CNT*IRQ timers Eric Anholt
2015-12-29 10:45 ` tip-bot for Eric Anholt [this message]
2015-12-26 21:47 ` [PATCH 2/4] irqchip: bcm2836: Add SMP support for the 2836 Eric Anholt
2015-12-29 10:46 ` [tip:irq/core] irqchip/bcm2836: " tip-bot for Andrea Merello
2016-01-02 10:27 ` [PATCH 2/4] irqchip: bcm2836: " Russell King - ARM Linux
2016-01-02 16:05 ` Andrea Merello
2015-12-26 21:47 ` [PATCH 3/4] irqchip: bcm2836: tolerate IRQs while no flag is set in ISR Eric Anholt
2015-12-29 10:46 ` [tip:irq/core] irqchip/bcm2836: Tolerate " tip-bot for Andrea Merello
2015-12-26 21:47 ` [PATCH 4/4] irqchip: bcm2836: make code more readable Eric Anholt
2015-12-29 10:46 ` [tip:irq/core] irqchip/bcm2836: Make " tip-bot for Andrea Merello
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=tip-401667bb8a2e0825090c5e6c15b899c1c36a4773@git.kernel.org \
--to=tipbot@zytor.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=hpa@zytor.com \
--cc=jason@lakedaemon.net \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mingo@kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome