From patchwork Wed Jun 29 10:39:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 71173 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2073124qgy; Wed, 29 Jun 2016 03:38:05 -0700 (PDT) X-Received: by 10.28.50.131 with SMTP id y125mr8791639wmy.94.1467196685224; Wed, 29 Jun 2016 03:38:05 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ui6si4087317wjc.204.2016.06.29.03.38.04; Wed, 29 Jun 2016 03:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3766A7506; Wed, 29 Jun 2016 12:38:03 +0200 (CEST) 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 3-ZE0LBXTlRr; Wed, 29 Jun 2016 12:38:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46FC8A74DA; Wed, 29 Jun 2016 12:38:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E93CDA7528 for ; Wed, 29 Jun 2016 12:37:57 +0200 (CEST) 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 3dvgCP5SQAjT for ; Wed, 29 Jun 2016 12:37:57 +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 conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id 584E6A74DA for ; Wed, 29 Jun 2016 12:37:53 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u5TAbXTB004174; Wed, 29 Jun 2016 19:37:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u5TAbXTB004174 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1467196661; bh=Jb8vq/Vm6ZvK0y5WiS+tUJgRz4L3XvzSyj6pCK06xhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bfkp4StlmUSLlhn6GyubB3fZgvyiDTrU6DQC1k1WDBE3M/S+kbSIy1uNK29xUn4ks 8EpUF+sXze3lChv2T7qP4B7+OplIgUgz3SwdmLXSIrHBYqvTj9VbFpTxl05nM+GLn7 ekH2QIl8G3ACqwFnj3FpEm1BT/AV7hnT2lRxGhAD/8gImLmK6s1o+GaThN18zuzpmD lsROcXM/tqVIZFoLBtMfIHdZowig1seXg461lVTe+J5YDfSe5vggCZL9KVbRIlIksR aROQkWDE56Eh9JZgw7KBG6UakX11/uRPbrROF9Oucs94xKfXAtOaOcSnIoly2VKFDP mBEgdVjLmdjag== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 29 Jun 2016 19:39:03 +0900 Message-Id: <1467196743-6576-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467196743-6576-1-git-send-email-yamada.masahiro@socionext.com> References: <1467196743-6576-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 11/11] ARM: uniphier: add external IRQ setup code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" I will carry this work-around until it is cared in the kernel. This looks up the AIDET node and sets up a register to handle active low interrupt signals. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/board_early_init_f.c | 39 +++++++++++++++++++++++++++ arch/arm/mach-uniphier/pinctrl/pinctrl-ld20.c | 5 ++++ 2 files changed, 44 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/board_early_init_f.c b/arch/arm/mach-uniphier/board_early_init_f.c index f853701..d35d38d 100644 --- a/arch/arm/mach-uniphier/board_early_init_f.c +++ b/arch/arm/mach-uniphier/board_early_init_f.c @@ -4,10 +4,47 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include +#include +#include + #include "init.h" #include "micro-support-card.h" #include "soc-info.h" +DECLARE_GLOBAL_DATA_PTR; + +static void uniphier_setup_xirq(void) +{ + const void *fdt = gd->fdt_blob; + int soc_node, aidet_node; + const u32 *val; + unsigned long aidet_base; + u32 tmp; + + soc_node = fdt_path_offset(fdt, "/soc"); + if (soc_node < 0) + return; + + aidet_node = fdt_subnode_offset_namelen(fdt, soc_node, "aidet", 5); + if (aidet_node < 0) + return; + + val = fdt_getprop(fdt, aidet_node, "reg", NULL); + if (!val) + return; + + aidet_base = fdt32_to_cpu(*val); + + tmp = readl(aidet_base + 8); /* AIDET DETCONFR2 */ + tmp |= 0x00ff0000; /* Set XIRQ0-7 low active */ + writel(tmp, aidet_base + 8); + + tmp = readl(0x55000090); /* IRQCTL */ + tmp |= 0x000000ff; + writel(tmp, 0x55000090); +} + int board_early_init_f(void) { led_puts("U0"); @@ -81,6 +118,8 @@ int board_early_init_f(void) break; } + uniphier_setup_xirq(); + led_puts("U2"); return 0; diff --git a/arch/arm/mach-uniphier/pinctrl/pinctrl-ld20.c b/arch/arm/mach-uniphier/pinctrl/pinctrl-ld20.c index 6066b16..645b901 100644 --- a/arch/arm/mach-uniphier/pinctrl/pinctrl-ld20.c +++ b/arch/arm/mach-uniphier/pinctrl/pinctrl-ld20.c @@ -43,4 +43,9 @@ void uniphier_ld20_pin_init(void) sg_set_pinsel(53, 0, 8, 4); /* USB3OD -> USB3OD */ sg_set_iectrl_range(46, 53); #endif + + sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */ + sg_set_iectrl(149); + sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ + sg_set_iectrl(153); }