From: Michal Simek Date: Mon, 9 Jul 2012 11:20:33 +0200 Subject: [U-Boot] [PATCH 06/12] microblaze: intc: Add device-tree driver configuration In-Reply-To: <1341825639-23475-1-git-send-email-monstr@monstr.eu> References: <1341825639-23475-1-git-send-email-monstr@monstr.eu> Message-ID: <1341825639-23475-6-git-send-email-monstr@monstr.eu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Read configuration from DTB. Signed-off-by: Michal Simek --- arch/microblaze/cpu/interrupts.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c index 79ee96a..98c9110 100644 --- a/arch/microblaze/cpu/interrupts.c +++ b/arch/microblaze/cpu/interrupts.c @@ -29,6 +29,9 @@ #include #include #include +#include + +DECLARE_GLOBAL_DATA_PTR; #undef DEBUG_INT @@ -134,10 +137,26 @@ int interrupts_init(void) { int i; +#ifndef CONFIG_OF_CONTROL #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 +#else + int temp; + int offset = 0; + + offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset, + "xlnx,xps-intc-1.00.a"); + if (offset > 0) { + temp = fdtdec_get_addr(gd->fdt_blob, offset, "reg"); + if (temp != FDT_ADDR_T_NONE) { + intc = (microblaze_intc_t *)temp; + irq_no = fdtdec_get_int(gd->fdt_blob, offset, + "xlnx,num-intr-inputs", 0); + } + } +#endif if (irq_no) { vecs = calloc(1, sizeof(struct irq_action) * irq_no); if (vecs == NULL) { -- 1.7.0.4