From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 839CBC282CA for ; Tue, 12 Feb 2019 10:39:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51E0A20449 for ; Tue, 12 Feb 2019 10:39:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rMHPAiWi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="A0NtL2vS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51E0A20449 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DVfvKMgUQU9kuU7Lyh1oX6wQ1paWrAKAwYzykfV7Ehw=; b=rMHPAiWiV73qzo aa30bBLMH8ZE7h70qedoerqgdbuti0FUToQZ2zSDwBwRuAtheDVSRkTo8YB6wakWn/wFTsLI3IuBW +F36g/qOLtL0XxdzvJDMrK79W+vdpodknuwoXmUZvK+kKomaxtf6L3DiPAJQ/skKfpyPJ43RFQG3k Ebh5dKgRR0yCeonoxgVgK2W6f7kMdSYqayz4g7ZtgW2bnUIXotYU5DYnxb6R0cuN8AHOC3mFUVO89 OjF5dCad7Tt6/voHMTlorGmSfIMrCmUSRVSDMNhF+qSjYhKVrNSlaypXc2ZteRQ0+oWAJIxtlDp9K gHsV3+ZWCJJJpbznwojA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtVTW-0006Ts-8F; Tue, 12 Feb 2019 10:39:38 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtVSv-0005rx-Aw for linux-arm-kernel@lists.infradead.org; Tue, 12 Feb 2019 10:39:03 +0000 Received: by mail-wm1-x344.google.com with SMTP id t200so2473355wmt.0 for ; Tue, 12 Feb 2019 02:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M5s8LgF6tZAAsjgatoDHdRTjLQOzD7FAKkqTEC3Dngk=; b=A0NtL2vS5wtohyKbNTSOMNy0sgifAWQgV2Dg9ssQVSuLZf4wiugryhNOOvCwTHMjKp RVg1iD60li032kHoDtpd+XqBoqFyF48E3Yk1yWXzMqoo5PeWkmJeUsSWlGqR0hDCiTBq td8TMk0IYv1LOLq9UxZk4CC3slOhCqaiPiEMTtyfrocNUtAwoCVjdUImSXgEFVlsXY3/ EGR+Uw6qh0IbFL9slIajbjzRtAOLLWvb1S2XcjCyBn9RK/6jVgeNnPwl+KC9/PVIVKKC Bz5cO+pLXW5fGcbGXmKkbBOt/s0qY7WM/a6elcGqpn2T6Rr1tbl845o+byXKbjcN6LY4 Q9DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M5s8LgF6tZAAsjgatoDHdRTjLQOzD7FAKkqTEC3Dngk=; b=SR0uVXYXb1WzRnHqWOQsWBD4QS5Pk7SQuUJDVfyik39GqiuYAtzMf3Fn1Ey5QfOfOv JmVNZQuK7zOyL5vYh9hdQli2aXiEaFkPAyb3DH6cCxc1TdG+drxGFkrpAmXWTuZcAxse pOQoc47zUYrANqecrNjbgf16sguXS+x0qo39DMJkfKHR4T+8MUWrw4ge2EMmyqLjeiL7 5DggxK1+xA2da7qZWvUlYm18P03IgNjG/Ykdf5F7RFKBwJnPo2D9SMczqNnEC9ldVDK8 hDxFz0a/nY63DJYWEouQ/6Uj7aMQRkiHViVpAkj4/ZhAldSp8q7j6DV+LoOIyHjyQF+X 15zw== X-Gm-Message-State: AHQUAuZrHPLkej2yqMLTZbasFZxZc/JIODGHCnOXZZPvoOfEpzzT+TZe RKx3biybwwy7qb2oKEg2HqWcPQ== X-Google-Smtp-Source: AHgI3IaqpkIONZ4SiszEyFIPK842IU+lcHNmOKaKwQVxiDPicCAxDjtQcDo99nPQ0fBDUI66agVtNg== X-Received: by 2002:a7b:c302:: with SMTP id k2mr2327411wmj.71.1549967939690; Tue, 12 Feb 2019 02:38:59 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-38-32.w90-86.abo.wanadoo.fr. [90.86.93.32]) by smtp.gmail.com with ESMTPSA id c14sm3708656wrn.12.2019.02.12.02.38.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 02:38:59 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Thomas Gleixner , Jason Cooper , Marc Zyngier , David Lechner Subject: [PATCH v3 03/37] ARM: davinci: aintc: use irq domain Date: Tue, 12 Feb 2019 11:38:01 +0100 Message-Id: <20190212103835.7768-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190212103835.7768-1-brgl@bgdev.pl> References: <20190212103835.7768-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190212_023901_373284_A1BCBB73 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski We need to create an irq domain if we want to select SPARSE_IRQ. The cp-intc driver already supports it, but aintc doesn't. Use the helpers provided by the generic irq chip abstraction. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/irq.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c index 952dc126c390..efba6dbdfd62 100644 --- a/arch/arm/mach-davinci/irq.c +++ b/arch/arm/mach-davinci/irq.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -40,23 +41,23 @@ #define IRQ_INTPRI0_REG_OFFSET 0x0030 #define IRQ_INTPRI7_REG_OFFSET 0x004C +static struct irq_domain *davinci_irq_domain; + static inline void davinci_irq_writel(unsigned long value, int offset) { __raw_writel(value, davinci_intc_base + offset); } static __init void -davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) +davinci_irq_setup_gc(void __iomem *base, + unsigned int irq_start, unsigned int num) { struct irq_chip_generic *gc; struct irq_chip_type *ct; - gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); - if (!gc) { - pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n", - __func__, irq_start); - return; - } + gc = irq_get_domain_generic_chip(davinci_irq_domain, irq_start); + gc->reg_base = base; + gc->irq_base = irq_start; ct = gc->chip_types; ct->chip.irq_ack = irq_gc_ack_set_bit; @@ -74,6 +75,7 @@ void __init davinci_irq_init(void) { unsigned i, j; const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios; + int ret, irq_base; davinci_intc_type = DAVINCI_INTC_TYPE_AINTC; davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_4K); @@ -110,8 +112,25 @@ void __init davinci_irq_init(void) davinci_irq_writel(pri, i); } + irq_base = irq_alloc_descs(-1, 0, davinci_soc_info.intc_irq_num, 0); + if (WARN_ON(irq_base < 0)) + return; + + davinci_irq_domain = irq_domain_add_legacy(NULL, + davinci_soc_info.intc_irq_num, + irq_base, 0, &irq_domain_simple_ops, + NULL); + if (WARN_ON(!davinci_irq_domain)) + return; + + ret = irq_alloc_domain_generic_chips(davinci_irq_domain, 32, 1, + "AINTC", handle_edge_irq, + IRQ_NOREQUEST | IRQ_NOPROBE, 0, 0); + if (WARN_ON(ret)) + return; + for (i = 0, j = 0; i < davinci_soc_info.intc_irq_num; i += 32, j += 0x04) - davinci_alloc_gc(davinci_intc_base + j, i, 32); + davinci_irq_setup_gc(davinci_intc_base + j, irq_base + i, 32); irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq); } -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel