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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 EC5B6C00A89 for ; Thu, 5 Nov 2020 11:25:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2CB9020759 for ; Thu, 5 Nov 2020 11:25:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RfxQ8VoV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CB9020759 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paulk.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Pj6chFJHhA78L5TbffhgnJ/B7kISumIZbpLn2gQXoqo=; b=RfxQ8VoVXaFy1D4zuJSxZRa/8 nqGiERa/a6N1qTFX3nWvMrl6Adjyq5H5jv2b8l1L6JIkd3DhuemgPclaPPHWy7g42soqS82Cfl++3 FS3xvLqcsFDcHWnhAfW4qTWZkdKBiqHQtv+M5CUQNBNL9RwBNGMYxXB0TJLHo1tTzJzve76r3urfM 4E4Qg1catFppJ8y8GI6AUcG5GHLA+CBma0xg2MqcCrHM2yANFKzFGiFrcfmh60hKzrxEhVZd9VR/b ralqTZdUs511dBrkjtGtYfmfRrB2x0MRia+nIED3dB0wdtPFn9UavKtuM2k65GWpGeTRUQkd3+gFu DXDGE/mTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kadNf-0007oF-GU; Thu, 05 Nov 2020 11:24:39 +0000 Received: from vpn-0-22.aquilenet.fr ([2a0c:e300:4:22::] helo=leonov.paulk.fr) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kadNd-0007mK-6L for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 11:24:38 +0000 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id E19B6C0150 for ; Thu, 5 Nov 2020 12:24:26 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 0D56DC1D59; Thu, 5 Nov 2020 12:24:26 +0100 (CET) Received: from collins (unknown [192.168.1.1]) by gagarine.paulk.fr (Postfix) with ESMTPSA id A4BFBC1D4F; Thu, 5 Nov 2020 12:24:18 +0100 (CET) Date: Thu, 5 Nov 2020 12:24:18 +0100 From: Paul Kocialkowski To: Samuel Holland Subject: Re: [PATCH v2 2/6] irqchip/sunxi-nmi: Add support for the V3s NMI Message-ID: <20201105112418.GA1237@collins> References: <20201103205058.435207-1-contact@paulk.fr> <20201103205058.435207-3-contact@paulk.fr> <85d40081-2dd1-3a0c-15ad-a58ce866700f@sholland.org> MIME-Version: 1.0 In-Reply-To: <85d40081-2dd1-3a0c-15ad-a58ce866700f@sholland.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_062437_552533_A51D5D61 X-CRM114-Status: GOOD ( 27.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Matteo Scordino , linux-kernel@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , Rob Herring , linux-arm-kernel@lists.infradead.org, Icenowy Zheng Content-Type: multipart/mixed; boundary="===============4788984807445255273==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4788984807445255273== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline --wac7ysb48OaltWcw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Samuel, On Wed 04 Nov 20, 22:14, Samuel Holland wrote: > On 11/3/20 2:50 PM, Paul Kocialkowski wrote: > > 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. > >=20 > > As a result, a specific compatible and register description is required > > for the V3s. This was tested with an AXP209 on a V3 board. > >=20 > > Acked-by: Maxime Ripard > > Signed-off-by: Paul Kocialkowski > > --- > > drivers/irqchip/irq-sunxi-nmi.c | 18 +++++++++++++++++- > > 1 file changed, 17 insertions(+), 1 deletion(-) > >=20 > > diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunx= i-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 > > =20 > > +#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 >=20 > These two sets of definitions are the same. So it would make sense for > V3S and sun9i to share a configuration, instead of creating a copy. Oh but that's true! I initially though it was the same as sun7i, found that= it wasn't but didn't notice about sun9i. So I think we can just use the sun9i compatible after all. Thanks! Paul > > @@ -79,6 +83,12 @@ static const struct sunxi_sc_nmi_reg_offs sun7i_reg_= offs __initconst =3D { > > .enable =3D SUN7I_NMI_ENABLE, > > }; > > =20 > > +static const struct sunxi_sc_nmi_reg_offs sun8i_v3s_reg_offs __initcon= st =3D { > > + .ctrl =3D SUN8I_V3S_NMI_CTRL, > > + .pend =3D SUN8I_V3S_NMI_PENDING, > > + .enable =3D SUN8I_V3S_NMI_ENABLE, > > +}; > > + > > static const struct sunxi_sc_nmi_reg_offs sun9i_reg_offs __initconst = =3D { > > .ctrl =3D SUN9I_NMI_CTRL, > > .pend =3D SUN9I_NMI_PENDING, > > @@ -165,7 +175,6 @@ static int __init sunxi_sc_nmi_irq_init(struct devi= ce_node *node, > > unsigned int clr =3D IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; > > int ret; > > =20 > > - > > domain =3D 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 dev= ice_node *node, > > } > > IRQCHIP_DECLARE(sun7i_sc_nmi, "allwinner,sun7i-a20-sc-nmi", sun7i_sc_n= mi_irq_init); > > =20 > > +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) > > { > >=20 >=20 --=20 Developer of free digital technology and hardware support. Website: https://www.paulk.fr/ Coding blog: https://code.paulk.fr/ Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/ --wac7ysb48OaltWcw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAl+j4OEACgkQhP3B6o/u lQw5vA//e0p7YbREoh7LicyYYBO8wpOJt0sgRwKDy5Xhg2DtHvrcUu9BZfA7gmIM gJzogwi3r1dc9s6d4rhD1ZGWf2jXM7T7IUL0OnbQagVhwmTEyrSHC9S60CqibU4w zt0aqN7XmVDM+9bGEsdJ3pLDk9lt2SiJ9vIJq/rsy0CXn7B7EYjTOEenOzUDlWxv W1iS2v/WjIutWCCZkOBlaTKSsadij4piKkyKWc7DkAY9rDOCMb6zLxrdy98fom5c l2Pmi7XAUk04NRMA/fKO6x7rLH2Nh6xlVQPOI6gE8gFs/dRl4GuTJcm/2gZAGd+C zxDwxAT5bgrsBo8HygK0dcN8Ub2Ea7J/x/m4k1BnQbN6VDWFojh6TvxHNYJ86bux PovslJ4tJJmMSxgnCKXs/8JkEMI5hrvoG7j8RH4O8g9mrqGldAcYMVtYAio6Oq+d 19pXfXzxMM8QPliapyDFTEgqRYQeQWwAjC/JHylXI3Dor7yDjKANh6VhkNDhJB/6 29c46CByRCVOXH7oxPa2G/4px8bAYXeZV8LBlNfDq4cOi7AaC5HES0MZhgOMXwYO /3GvfNnGBh2sOXkrZMWJuJdxU9IEd9KWgmEMAX9FA9Mwm1bSM1E8HpbkAhAETfi8 zyh2PB/XZGTOcC2gRmHD53j74QIvKH1qIshmknZVpwl7moKETJs= =USdf -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- --===============4788984807445255273== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4788984807445255273==--