mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Cc: [email protected] Cc: Stephen Warren <[email protected]> Cc: Lee Jones <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
5c4acd97e8
commit
401667bb8a
1 changed files with 26 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue