From patchwork Mon Jul 9 09:20:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 169723 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 755252C0210 for ; Mon, 9 Jul 2012 19:21:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 19BEA2815B; Mon, 9 Jul 2012 11:21:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7rQP1l9vDUHP; Mon, 9 Jul 2012 11:21:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59F742815F; Mon, 9 Jul 2012 11:21:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6FA142815E for ; Mon, 9 Jul 2012 11:21:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4lzi5dAADwLR for ; Mon, 9 Jul 2012 11:21:14 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id BDA1828145 for ; Mon, 9 Jul 2012 11:20:59 +0200 (CEST) Received: by mail-bk0-f44.google.com with SMTP id y7so2470849bkt.3 for ; Mon, 09 Jul 2012 02:20:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=SrYiBktTle1E5rzJRghj0lKEL1SmL3x93T58MNl8CsI=; b=BTphNZuauWQlqlt5e9I2MVYxw65fhwkmJjVbal45Hv3HhrGghIq6UdX+P5qBPo8J3+ xCwDLDHzvM3op1PVJaYhFYLJw1xFSTxPQ8ZCP1BpMU+hwBlsbIfsyZ4qjtX414gVM7ej xDzuwsr2JG7ZwVATMuY1I1eSe3OTkbV+13a8UPrJvL3AtawPFDOt0nX64HZY9txwmqYl U13kYKoNg8eZlctnsIxWs2fZS/Y1m4FZLVtJngSTYLMtSFKU1hBy59X6d/lwO23XzLl5 70d1g6FAyPiwsWW/7/ZQLkDnHodGoUTu92cvXiJAMsDLKkjLDkTS2GFfTHye8HjR+AwW /WqQ== Received: by 10.205.132.12 with SMTP id hs12mr11631282bkc.47.1341825659627; Mon, 09 Jul 2012 02:20:59 -0700 (PDT) Received: from localhost (11.161.broadband5.iol.cz. [88.100.161.11]) by mx.google.com with ESMTPS id hs2sm25763411bkc.1.2012.07.09.02.20.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 02:20:58 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Mon, 9 Jul 2012 11:20:33 +0200 Message-Id: <1341825639-23475-6-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1341825639-23475-1-git-send-email-monstr@monstr.eu> References: <1341825639-23475-1-git-send-email-monstr@monstr.eu> X-Gm-Message-State: ALoCoQnMaS1Q4meSt+zLsVIbJqTQIZBQOUma5rpHd8+WB2QYaZqu1RWsaSvnnAgsbPRqpp8gEnsO Cc: linz@li-pro.net Subject: [U-Boot] [PATCH 06/12] microblaze: intc: Add device-tree driver configuration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@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) {