X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Fmicroblaze%2Fcpu%2Finterrupts.c;h=a6a52f85270a851f5de3f716aafd75bcb3cbad3f;hb=09140113108541b95d340f3c7b6ee597d31ccc73;hp=b6d6610f2fd70ec6f3410b42c27a9d2013572183;hpb=db7a7dee6878fe7539d5967de1caff83246254e0;p=oweals%2Fu-boot.git diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c index b6d6610f2f..a6a52f8527 100644 --- a/arch/microblaze/cpu/interrupts.c +++ b/arch/microblaze/cpu/interrupts.c @@ -1,19 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2007 Michal Simek * (C) Copyright 2004 Atmark Techno, Inc. * * Michal SIMEK * Yasushi SHOJI - * - * SPDX-License-Identifier: GPL-2.0+ */ #include #include +#include +#include #include #include #include +DECLARE_GLOBAL_DATA_PTR; + void enable_interrupts(void) { debug("Enable interrupts for the whole CPU\n"); @@ -112,11 +115,26 @@ static void intc_init(void) int interrupt_init(void) { int i; + const void *blob = gd->fdt_blob; + int node = 0; + + debug("INTC: Initialization\n"); + + node = fdt_node_offset_by_compatible(blob, node, + "xlnx,xps-intc-1.00.a"); + if (node != -1) { + fdt_addr_t base = fdtdec_get_addr(blob, node, "reg"); + if (base == FDT_ADDR_T_NONE) + return -1; + + debug("INTC: Base addr %lx\n", base); + intc = (microblaze_intc_t *)base; + irq_no = fdtdec_get_int(blob, node, "xlnx,num-intr-inputs", 0); + debug("INTC: IRQ NO %x\n", irq_no); + } else { + return node; + } -#if defined(CONFIG_SYS_INTC_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM) - intc = (microblaze_intc_t *)CONFIG_SYS_INTC_0_ADDR; - irq_no = CONFIG_SYS_INTC_0_NUM; -#endif if (irq_no) { vecs = calloc(1, sizeof(struct irq_action) * irq_no); if (vecs == NULL) { @@ -169,7 +187,7 @@ void interrupt_handler(void) } #if defined(CONFIG_CMD_IRQ) -int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, const char *argv[]) +int do_irqinfo(struct cmd_tbl *cmdtp, int flag, int argc, const char *argv[]) { int i; struct irq_action *act = vecs;