Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp801926pxb; Tue, 3 Nov 2020 12:57:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbdGYbbP4LumowfPSvZAcLWJk3dpitLBhqDwC33xgIqRKeSLOz2BFQ0zLStTAmelsz24QU X-Received: by 2002:a17:906:d8a8:: with SMTP id qc8mr21537597ejb.149.1604437048876; Tue, 03 Nov 2020 12:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437048; cv=none; d=google.com; s=arc-20160816; b=zh04loX/P40Y7S/GjPjM8F8LXNtn54a5wkQwGR3hh1TNObyZu1szOJLWcxmDqcgEB7 vzcwy6ToPmSgT5nEGKj6NemFgfFyP9xQ3hiBZjXaJy3euKEW6U/3zybvqvRVaD9nRKqw As/HgPkpw5I52DAW7ksnXoXb/LaecXx/1NqntUkbK1sJ4LZL2LB2reqrt5psGcChdIV5 +59IApJgDYM0LvUnBdxhaB1PAFqZxYP93sdTOpgEZr4rxgCcQy5R3rEdAhjeFgIgMsDc J4c6qOd7yUXz3Isvq7wpEtzTlzPtmXr4bR3cgCykKxQr8UVs/1oYdHZKNgxWv02n/91W m7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4Regjgk8xOMaMtcBDdX0BGxUVACzPFiiM0788v8deDU=; b=mgo9ly+yZ3Z1u2VBPPr8pLLvA977VTTtI3AMxwc2TyRiv1HQ3j4+XS0Z09KsnrdIKt 6cKp9XZhnevk8hbY9VplNqAVV4q563fUlGGL95iyZFSN2y6tkqf2vHIDNXJBUXTl2imP cqtBecWpSzsGv3hT1Oan1lvaKthJrtYQ31qyriU3FozlP/opYBgQ2TCXYKxxyqYSjFMC hvlntCy6DHy+KS+VzJwW2EKLela/j2X/5pxDuFOpKzE0bG220f5EROWcJRYPeqx0Xemd oo8Z5bXziELRl6yt9hiDpjfbH0Np1ecjUQJ1Q8J27Oiha4jXBQeJOPi3ewvpRD14UBil IV0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si20157eji.106.2020.11.03.12.57.05; Tue, 03 Nov 2020 12:57:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731434AbgKCUw1 (ORCPT + 99 others); Tue, 3 Nov 2020 15:52:27 -0500 Received: from leonov.paulk.fr ([185.233.101.22]:57352 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732074AbgKCUwX (ORCPT ); Tue, 3 Nov 2020 15:52:23 -0500 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 335BDBFDEA; Tue, 3 Nov 2020 21:52:20 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 6080FC1D56; Tue, 3 Nov 2020 21:52:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.2 Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 3C836C1D48; Tue, 3 Nov 2020 21:51:01 +0100 (CET) From: Paul Kocialkowski To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Paul Kocialkowski , Matteo Scordino Subject: [PATCH v2 2/6] irqchip/sunxi-nmi: Add support for the V3s NMI Date: Tue, 3 Nov 2020 21:50:54 +0100 Message-Id: <20201103205058.435207-3-contact@paulk.fr> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201103205058.435207-1-contact@paulk.fr> References: <20201103205058.435207-1-contact@paulk.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The V3s/V3 has a NMI IRQ controller, which is mainly used for the AXP209 interrupt. In great wisdom, Allwinner decided to invert the enable and pending register offsets, compared to the A20. As a result, a specific compatible and register description is required for the V3s. This was tested with an AXP209 on a V3 board. Acked-by: Maxime Ripard Signed-off-by: Paul Kocialkowski --- drivers/irqchip/irq-sunxi-nmi.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c index a412b5d5d0fa..59e0e4612ef7 100644 --- a/drivers/irqchip/irq-sunxi-nmi.c +++ b/drivers/irqchip/irq-sunxi-nmi.c @@ -44,6 +44,10 @@ #define SUN7I_NMI_PENDING 0x04 #define SUN7I_NMI_ENABLE 0x08 +#define SUN8I_V3S_NMI_CTRL 0x00 +#define SUN8I_V3S_NMI_ENABLE 0x04 +#define SUN8I_V3S_NMI_PENDING 0x08 + #define SUN9I_NMI_CTRL 0x00 #define SUN9I_NMI_ENABLE 0x04 #define SUN9I_NMI_PENDING 0x08 @@ -79,6 +83,12 @@ static const struct sunxi_sc_nmi_reg_offs sun7i_reg_offs __initconst = { .enable = SUN7I_NMI_ENABLE, }; +static const struct sunxi_sc_nmi_reg_offs sun8i_v3s_reg_offs __initconst = { + .ctrl = SUN8I_V3S_NMI_CTRL, + .pend = SUN8I_V3S_NMI_PENDING, + .enable = SUN8I_V3S_NMI_ENABLE, +}; + static const struct sunxi_sc_nmi_reg_offs sun9i_reg_offs __initconst = { .ctrl = SUN9I_NMI_CTRL, .pend = SUN9I_NMI_PENDING, @@ -165,7 +175,6 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node, unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; int ret; - domain = irq_domain_add_linear(node, 1, &irq_generic_chip_ops, NULL); if (!domain) { pr_err("Could not register interrupt domain.\n"); @@ -254,6 +263,13 @@ static int __init sun7i_sc_nmi_irq_init(struct device_node *node, } IRQCHIP_DECLARE(sun7i_sc_nmi, "allwinner,sun7i-a20-sc-nmi", sun7i_sc_nmi_irq_init); +static int __init sun8i_v3s_sc_nmi_irq_init(struct device_node *node, + struct device_node *parent) +{ + return sunxi_sc_nmi_irq_init(node, &sun8i_v3s_reg_offs); +} +IRQCHIP_DECLARE(sun8i_v3s_sc_nmi, "allwinner,sun8i-v3s-sc-nmi", sun8i_v3s_sc_nmi_irq_init); + static int __init sun9i_nmi_irq_init(struct device_node *node, struct device_node *parent) { -- 2.29.1