2012-05-30 15:02:49 -06:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/irq.h>
|
2014-10-20 13:03:53 -06:00
|
|
|
#include <linux/irqchip/mips-gic.h>
|
2012-05-30 15:02:49 -06:00
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
|
|
#include <asm/irq_cpu.h>
|
|
|
|
#include <asm/setup.h>
|
|
|
|
|
|
|
|
#include <asm/mips-boards/sead3int.h>
|
|
|
|
|
|
|
|
#define SEAD_CONFIG_GIC_PRESENT_SHF 1
|
|
|
|
#define SEAD_CONFIG_GIC_PRESENT_MSK (1 << SEAD_CONFIG_GIC_PRESENT_SHF)
|
|
|
|
#define SEAD_CONFIG_BASE 0x1b100110
|
|
|
|
#define SEAD_CONFIG_SIZE 4
|
|
|
|
|
2014-10-20 13:03:50 -06:00
|
|
|
static void __iomem *sead3_config_reg;
|
2012-05-30 15:02:49 -06:00
|
|
|
|
|
|
|
void __init arch_init_irq(void)
|
|
|
|
{
|
2014-09-18 15:47:30 -06:00
|
|
|
if (!cpu_has_veic)
|
2012-05-30 15:02:49 -06:00
|
|
|
mips_cpu_irq_init();
|
|
|
|
|
2014-10-20 13:03:50 -06:00
|
|
|
sead3_config_reg = ioremap_nocache(SEAD_CONFIG_BASE, SEAD_CONFIG_SIZE);
|
|
|
|
gic_present = (__raw_readl(sead3_config_reg) &
|
|
|
|
SEAD_CONFIG_GIC_PRESENT_MSK) >>
|
2012-05-30 15:02:49 -06:00
|
|
|
SEAD_CONFIG_GIC_PRESENT_SHF;
|
|
|
|
pr_info("GIC: %spresent\n", (gic_present) ? "" : "not ");
|
|
|
|
pr_info("EIC: %s\n",
|
|
|
|
(current_cpu_data.options & MIPS_CPU_VEIC) ? "on" : "off");
|
|
|
|
|
|
|
|
if (gic_present)
|
2014-09-18 15:47:24 -06:00
|
|
|
gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, CPU_INT_GIC,
|
|
|
|
MIPS_GIC_IRQ_BASE);
|
2012-05-30 15:02:49 -06:00
|
|
|
}
|
|
|
|
|