static void __init intcp_init_irq(void) { u32 pic_mask, cic_mask, sic_mask; /* These masks are for the HW IRQ registers */ pic_mask = ~((~0u) << (11 - IRQ_PIC_START)); pic_mask |= (~((~0u) << (29 - 22))) << 22; cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)); sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START)); /* * Disable all interrupt sources */ writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR); writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR); fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START, -1, pic_mask, NULL); fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START, -1, cic_mask, NULL); fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START, IRQ_CP_CPPLDINT, sic_mask, NULL); }
static void __init intcp_init_irq(void) { u32 pic_mask, sic_mask; pic_mask = ~((~0u) << (11 - IRQ_PIC_START)); pic_mask |= (~((~0u) << (29 - 22))) << 22; sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START)); /* * Disable all interrupt sources */ writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR); writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR); fpga_irq_init(-1, pic_mask, &pic_irq_data); fpga_irq_init(-1, ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)), &cic_irq_data); fpga_irq_init(IRQ_CP_CPPLDINT, sic_mask, &sic_irq_data); }
void __init versatile_init_irq(void) { struct device_node *np; np = of_find_matching_node_by_address(NULL, vic_of_match, VERSATILE_VIC_BASE); __vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0, np); writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); np = of_find_matching_node_by_address(NULL, sic_of_match, VERSATILE_SIC_BASE); fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START, IRQ_VICSOURCE31, PIC_VALID, np); /* * Interrupts on secondary controller from 0 to 8 are routed to * source 31 on PIC. * Interrupts from 21 to 31 are routed directly to the VIC on * the corresponding number on primary controller. This is controlled * by setting PIC_ENABLEx. */ writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE); }
int __init fpga_irq_of_init(struct device_node *node, struct device_node *parent) { void __iomem *base; u32 clear_mask; u32 valid_mask; if (WARN_ON(!node)) return -ENODEV; base = of_iomap(node, 0); WARN(!base, "unable to map fpga irq registers\n"); if (of_property_read_u32(node, "clear-mask", &clear_mask)) clear_mask = 0; if (of_property_read_u32(node, "valid-mask", &valid_mask)) valid_mask = 0; fpga_irq_init(base, node->name, 0, -1, valid_mask, node); writel(clear_mask, base + IRQ_ENABLE_CLEAR); writel(clear_mask, base + FIQ_ENABLE_CLEAR); return 0; }
static void __init ap_init_irq(void) { /* Disable all interrupts initially. */ /* Do the core module ones */ writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); /* do the header card stuff next */ writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); fpga_irq_init(-1, INTEGRATOR_SC_VALID_INT, &sc_irq_data); }
static void __init ap_init_irq(void) { /* */ /* */ writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); /* */ writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); fpga_irq_init(-1, INTEGRATOR_SC_VALID_INT, &sc_irq_data); }
static void __init ap_init_irq(void) { /* Disable all interrupts initially. */ /* Do the core module ones */ writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); /* do the header card stuff next */ writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START, -1, INTEGRATOR_SC_VALID_INT, NULL); integrator_clk_init(false); }
static int __init fpga_init(struct vmm_devtree_node *node) { int rc; virtual_addr_t base; u32 clear_mask; u32 valid_mask; u32 picen_mask; u32 irq_start; u32 parent_irq; BUG_ON(!vmm_smp_is_bootcpu()); rc = vmm_devtree_request_regmap(node, &base, 0, "Versatile SIC"); WARN(rc, "unable to map fpga irq registers\n"); if (vmm_devtree_read_u32(node, "irq_start", &irq_start)) { irq_start = 0; } if (vmm_devtree_read_u32(node, "clear-mask", &clear_mask)) { clear_mask = 0; } if (vmm_devtree_read_u32(node, "valid-mask", &valid_mask)) { valid_mask = 0; } /* Some chips are cascaded from a parent IRQ */ if (vmm_devtree_irq_get(node, &parent_irq, 0)) { parent_irq = 0xFFFFFFFF; } fpga_irq_init((void *)base, "FPGA", irq_start, parent_irq, valid_mask, node); vmm_writel(clear_mask, (void *)base + IRQ_ENABLE_CLEAR); vmm_writel(clear_mask, (void *)base + FIQ_ENABLE_CLEAR); /* For VersatilePB, we have interrupts from 21 to 31 capable * of being routed directly to the parent interrupt controller * (i.e. VIC). This is controlled by setting PIC_ENABLEx. */ if (!vmm_devtree_read_u32(node, "picen-mask", &picen_mask)) { vmm_writel(picen_mask, (void *)base + PICEN_SET); } return 0; }
void __init versatile_init_irq(void) { vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0); writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); fpga_irq_init(IRQ_VICSOURCE31, ~PIC_MASK, &sic_irq); /* * Interrupts on secondary controller from 0 to 8 are routed to * source 31 on PIC. * Interrupts from 21 to 31 are routed directly to the VIC on * the corresponding number on primary controller. This is controlled * by setting PIC_ENABLEx. */ writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE); }
int __init fpga_irq_of_init(struct device_node *node, struct device_node *parent) { void __iomem *base; u32 clear_mask; u32 valid_mask; int parent_irq; if (WARN_ON(!node)) return -ENODEV; base = of_iomap(node, 0); WARN(!base, "unable to map fpga irq registers\n"); if (of_property_read_u32(node, "clear-mask", &clear_mask)) clear_mask = 0; if (of_property_read_u32(node, "valid-mask", &valid_mask)) valid_mask = 0; /* Some chips are cascaded from a parent IRQ */ parent_irq = irq_of_parse_and_map(node, 0); if (!parent_irq) { set_handle_irq(fpga_handle_irq); parent_irq = -1; } fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); writel(clear_mask, base + IRQ_ENABLE_CLEAR); writel(clear_mask, base + FIQ_ENABLE_CLEAR); /* * On Versatile AB/PB, some secondary interrupts have a direct * pass-thru to the primary controller for IRQs 20 and 22-31 which need * to be enabled. See section 3.10 of the Versatile AB user guide. */ if (of_device_is_compatible(node, "arm,versatile-sic")) writel(0xffd00000, base + PIC_ENABLES); return 0; }