blob: 7efefcf440338c0e657733cdc2ae26e38aba9e35 [file] [log] [blame]
Kevin Cernekeed666cd02014-10-20 21:28:05 -07001/*
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 Cernekeee5a6fcc2014-12-25 09:49:15 -08006 * Copyright (C) 2014 Broadcom Corporation
7 * Author: Kevin Cernekee <cernekee@gmail.com>
Kevin Cernekeed666cd02014-10-20 21:28:05 -07008 */
9
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080010#include <linux/of.h>
11#include <linux/irqchip.h>
Kevin Cernekeed666cd02014-10-20 21:28:05 -070012
13#include <asm/bmips.h>
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080014#include <asm/irq.h>
Kevin Cernekeed666cd02014-10-20 21:28:05 -070015#include <asm/irq_cpu.h>
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080016#include <asm/time.h>
Kevin Cernekeed666cd02014-10-20 21:28:05 -070017
Simon Arlottc7c42ec2015-11-22 14:30:14 +000018static 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 Cernekeed666cd02014-10-20 21:28:05 -070024unsigned int get_c0_compare_int(void)
25{
26 return CP0_LEGACY_COMPARE_IRQ;
27}
28
Kevin Cernekeed666cd02014-10-20 21:28:05 -070029void __init arch_init_irq(void)
30{
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080031 struct device_node *dn;
32
Simon Arlottc7c42ec2015-11-22 14:30:14 +000033 /* Only these controllers support SMP IRQ affinity */
34 dn = of_find_matching_node(NULL, smp_intc_dt_match);
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080035 if (dn)
36 of_node_put(dn);
37 else
38 bmips_tp1_irqs = 0;
39
40 irqchip_init();
Kevin Cernekeed666cd02014-10-20 21:28:05 -070041}
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080042
Joel Porquet0a271c22015-07-07 17:17:33 -040043IRQCHIP_DECLARE(mips_cpu_intc, "mti,cpu-interrupt-controller",
Kevin Cernekeee5a6fcc2014-12-25 09:49:15 -080044 mips_cpu_irq_of_init);