Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or modify it |
| 3 | * under the terms of the GNU General Public License version 2 as published |
| 4 | * by the Free Software Foundation. |
| 5 | * |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 6 | * Copyright (C) 2014 Broadcom Corporation |
| 7 | * Author: Kevin Cernekee <cernekee@gmail.com> |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 10 | #include <linux/of.h> |
| 11 | #include <linux/irqchip.h> |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 12 | |
| 13 | #include <asm/bmips.h> |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 14 | #include <asm/irq.h> |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 15 | #include <asm/irq_cpu.h> |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 16 | #include <asm/time.h> |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 17 | |
Simon Arlott | c7c42ec | 2015-11-22 14:30:14 +0000 | [diff] [blame] | 18 | static const struct of_device_id smp_intc_dt_match[] = { |
| 19 | { .compatible = "brcm,bcm7038-l1-intc" }, |
| 20 | { .compatible = "brcm,bcm6345-l1-intc" }, |
| 21 | {} |
| 22 | }; |
| 23 | |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 24 | unsigned int get_c0_compare_int(void) |
| 25 | { |
| 26 | return CP0_LEGACY_COMPARE_IRQ; |
| 27 | } |
| 28 | |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 29 | void __init arch_init_irq(void) |
| 30 | { |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 31 | struct device_node *dn; |
| 32 | |
Simon Arlott | c7c42ec | 2015-11-22 14:30:14 +0000 | [diff] [blame] | 33 | /* Only these controllers support SMP IRQ affinity */ |
| 34 | dn = of_find_matching_node(NULL, smp_intc_dt_match); |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 35 | if (dn) |
| 36 | of_node_put(dn); |
| 37 | else |
| 38 | bmips_tp1_irqs = 0; |
| 39 | |
| 40 | irqchip_init(); |
Kevin Cernekee | d666cd0 | 2014-10-20 21:28:05 -0700 | [diff] [blame] | 41 | } |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 42 | |
Joel Porquet | 0a271c2 | 2015-07-07 17:17:33 -0400 | [diff] [blame] | 43 | IRQCHIP_DECLARE(mips_cpu_intc, "mti,cpu-interrupt-controller", |
Kevin Cernekee | e5a6fcc | 2014-12-25 09:49:15 -0800 | [diff] [blame] | 44 | mips_cpu_irq_of_init); |