sead3-int.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
  7. */
  8. #include <linux/init.h>
  9. #include <linux/irq.h>
  10. #include <linux/irqchip/mips-gic.h>
  11. #include <linux/io.h>
  12. #include <asm/irq_cpu.h>
  13. #include <asm/setup.h>
  14. #include <asm/mips-boards/sead3int.h>
  15. #define SEAD_CONFIG_GIC_PRESENT_SHF 1
  16. #define SEAD_CONFIG_GIC_PRESENT_MSK (1 << SEAD_CONFIG_GIC_PRESENT_SHF)
  17. #define SEAD_CONFIG_BASE 0x1b100110
  18. #define SEAD_CONFIG_SIZE 4
  19. static void __iomem *sead3_config_reg;
  20. void __init arch_init_irq(void)
  21. {
  22. if (!cpu_has_veic)
  23. mips_cpu_irq_init();
  24. sead3_config_reg = ioremap_nocache(SEAD_CONFIG_BASE, SEAD_CONFIG_SIZE);
  25. gic_present = (__raw_readl(sead3_config_reg) &
  26. SEAD_CONFIG_GIC_PRESENT_MSK) >>
  27. SEAD_CONFIG_GIC_PRESENT_SHF;
  28. pr_info("GIC: %spresent\n", (gic_present) ? "" : "not ");
  29. pr_info("EIC: %s\n",
  30. (current_cpu_data.options & MIPS_CPU_VEIC) ? "on" : "off");
  31. if (gic_present)
  32. gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, CPU_INT_GIC,
  33. MIPS_GIC_IRQ_BASE);
  34. }