Received: by 10.192.165.148 with SMTP id m20csp4959284imm; Tue, 1 May 2018 06:54:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq3J4FZ5XuCzUFe+7KjXhTNZKhkMGg3B3+etHTQ4ffEr//vCKOphaRHTad/Um9MRqBuZkmp X-Received: by 2002:a65:64d6:: with SMTP id t22-v6mr13224766pgv.41.1525182879562; Tue, 01 May 2018 06:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525182879; cv=none; d=google.com; s=arc-20160816; b=FtR32DjoCqgl4trPKo4nxkUasoIXoCQ31gjYH1NcLOrhnjs7tx5r1+/WAvsBwhGidf ujQexq3Wwgq490PdOM4ZcAHsg59UCyU+fBm4n9sw3Rr5RvdgOf8XjWoL12gaj/M66dY6 h96AwJX4qbp9IFdXP8XVb2kP6cd5mSEhikHdILQcqEbgadjq3rEUO9JAZ69m8OwSPtia JOjWXCSedwzmWL1mOCvAZI6PEpk6/MoKVMFSwgx6dO3uLfyk4X9Nf/+jWuFra3rgz2Ol aaS6ioNud6MdFM55S+0Ovy+lKVQwFf2Pb9zrBqxLsYR8H4VQpVtmnj5uDGwnlvhKbzDE IEfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=3CGmQZnVwwSXirBUGsL0sRIYa/P4t3t0pZ4e65OaJ9w=; b=Xyhy4/uhGQ/G61dRYd76GyziniQBcbzLbzL9k6Yj5P0TR0U2Cu+S4qF6QNQ7nmwsFk pki/EEG/CqBgGYvL2EqOk7yImW3rwI6Y059zkVAzyeGfQw9oHxEjoGN8QDZ7kh1iqeEd 9p67eusHe8TwpvAULZB/06R8paDSjSTRY71Dje+uuSFGYn2bFyb5UpuEjmOdh5FPsA7z tBRPamTwuwyjmRyZ9gR2/rctQCeXxoRKBuFy7iy3+P4ceak3EbaWCD6F9NDV2/ASF15/ lVoALaODUloZL/1++Rccl802wB8gFvtTG0LwflA0pM05Q/Rf/EAPAFUdWtewNF0O7o/t ysug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=TTY1D4vO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16-v6si7932335pgn.39.2018.05.01.06.54.24; Tue, 01 May 2018 06:54:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b=TTY1D4vO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755199AbeEANyO (ORCPT + 99 others); Tue, 1 May 2018 09:54:14 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:60188 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753505AbeEANyM (ORCPT ); Tue, 1 May 2018 09:54:12 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 01 May 2018 22:54:10 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id A9D3597123; Tue, 1 May 2018 22:54:10 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.49,351,1520866800"; d="scan'208";a="278341263" Received: from mail-os2jpn01lp0144.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.144]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 01 May 2018 22:54:10 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3CGmQZnVwwSXirBUGsL0sRIYa/P4t3t0pZ4e65OaJ9w=; b=TTY1D4vODeMqdfDsLL9fO6jGQ9TD3kwnf3FtRC/2lEq6JAgIWUmyfP5WR5yVQ31i7yqPwnK6FxKp2e+ll615+jrKIuqLF2NQvUphAy3kQoNH9QcBMZxy+TtGMVHDztdsvYRck57xWfUB1jNIio262fHjETUTg1+8osOXpcsvKLU= Received: from TY1PR01MB1769.jpnprd01.prod.outlook.com (52.133.163.146) by TY1PR01MB0714.jpnprd01.prod.outlook.com (10.167.158.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Tue, 1 May 2018 13:54:03 +0000 Received: from TY1PR01MB1769.jpnprd01.prod.outlook.com ([fe80::4822:4b30:7b84:3565]) by TY1PR01MB1769.jpnprd01.prod.outlook.com ([fe80::4822:4b30:7b84:3565%13]) with mapi id 15.20.0715.023; Tue, 1 May 2018 13:54:02 +0000 From: Phil Edworthy To: Rob Herring CC: Marc Zyngier , Mark Rutland , Thomas Gleixner , Jason Cooper , "devicetree@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Michel Pollet Subject: RE: [PATCH] irqchip: Add support for Renesas RZ/N1 GPIO interrupt multiplexer Thread-Topic: [PATCH] irqchip: Add support for Renesas RZ/N1 GPIO interrupt multiplexer Thread-Index: AQHT2weh6W4b6F6C9ECWpTAVlJ2E0qQa6pcAgAAAeeA= Date: Tue, 1 May 2018 13:54:02 +0000 Message-ID: References: <1524490386-1544-1-git-send-email-phil.edworthy@renesas.com> <20180501132844.GA8298@rob-hp-laptop> In-Reply-To: <20180501132844.GA8298@rob-hp-laptop> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=phil.edworthy@renesas.com; x-originating-ip: [193.141.220.21] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;TY1PR01MB0714;7:BZEcEuGXDQLr8daoozmIyWajJLuvAjZzvwUfO1P0PEck+2YGXVz8LPwJk0w2NKxR84zjRcHGAv1JobBKEji/vSE/PSjird1hLl+g49/Ntz8tlUcXwN+NYKGT9MoItnPDwiJSmtr2wz2hdrbRVYAS7FR8rHmMdfapwK5NnFmhVAqYSr4sQYsWkyD7lXv0zEd7DqZ1sQZVg6uIFEkuvDgkF3V+jQLb8O6408EpaAMtp7JZEBt5EmAb3gbLjorm4Vwl;20:asURqXQJTyhXIt5On1NZMoMMt5rhU57gcoHg35QBEyCer1ev8mDcUCI69NIyDNUiUoCdPt8jm/mE74/xyvQ8m7nhpxbm2wyfS5lVTOpZ6wu1TWHyO9H1y7CHuVbR8mCvovV6g1HsdHbPnYSFcFb093za0U3UQwuT3M1mtcT0LF4= x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:TY1PR01MB0714; x-ms-traffictypediagnostic: TY1PR01MB0714: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:TY1PR01MB0714;BCL:0;PCL:0;RULEID:;SRVR:TY1PR01MB0714; x-forefront-prvs: 06592CCE58 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(346002)(39860400002)(396003)(39380400002)(199004)(189003)(305945005)(26005)(59450400001)(3280700002)(2906002)(11346002)(3846002)(5250100002)(4326008)(7696005)(102836004)(6246003)(107886003)(53936002)(478600001)(9686003)(186003)(6116002)(53546011)(6506007)(3660700001)(76176011)(99286004)(68736007)(2900100001)(6436002)(81156014)(54906003)(5660300001)(25786009)(8676002)(229853002)(81166006)(575784001)(14454004)(86362001)(97736004)(486006)(33656002)(66066001)(44832011)(74316002)(7736002)(446003)(55016002)(6916009)(316002)(105586002)(476003)(8936002)(106356001);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR01MB0714;H:TY1PR01MB1769.jpnprd01.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: tu11VCU2RFU3E8MwNMTY4mjOc4/LGjnoDxL76fwqHLfoV86G5Iu1qohhtzdyBoaG7lPthVpkR6UsfwKUWQusiEdTCxBJC0FfM0bZYjbEnKV0JJpCIaPRtD5ctd/1c2GJqoY7MtMGpDVRq15804PcZsfMJIGtdIpg12BsXhG0/FZOakS08fL1+iFrrCx4A9g8 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5d4533c2-c02a-4d69-e851-08d5af6aff21 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d4533c2-c02a-4d69-e851-08d5af6aff21 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2018 13:54:02.3193 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB0714 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On 01 May 2018 14:29 Rob Herring wrote: > On Mon, Apr 23, 2018 at 02:33:06PM +0100, Phil Edworthy wrote: > > On RZ/N1 devices, there are 3 Synopsys DesignWare GPIO blocks each > > configured to have 32 interrupt outputs, so we have a total of 96 GPIO > > interrupts. All of these are passed to the GPIO IRQ Muxer, which > > selects > > 8 of the GPIO interrupts to pass onto the GIC. The interrupt signals > > aren't latched, so there is nothing to do in this driver when an > > interrupt is received, other than tell the corresponding GPIO block. > > > > Signed-off-by: Phil Edworthy > > --- > > .../interrupt-controller/renesas,rzn1-mux.txt | 85 ++++++++++ >=20 > Please split bindings to a separate patch. Will do. > > drivers/irqchip/Kconfig | 10 ++ > > drivers/irqchip/Makefile | 1 + > > drivers/irqchip/irq-rzn1-irq-mux.c | 178 > +++++++++++++++++++++ > > 4 files changed, 274 insertions(+) > > create mode 100644 > > Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1-mu > > x.txt create mode 100644 drivers/irqchip/irq-rzn1-irq-mux.c > > > > diff --git > > a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1- > > mux.txt > > b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1- > > mux.txt > > new file mode 100644 > > index 0000000..f28a365 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,r > > +++ zn1-mux.txt > > @@ -0,0 +1,85 @@ > > +* Renesas RZ/N1 GPIO Interrupt Multiplexer > > + > > +On Renesas RZ/N1 devices, there are 3 Synopsys DesignWare GPIO blocks > > +each configured to have 32 interrupt outputs, so we have a total of > > +96 GPIO interrupts. All of these are passed to the GPIO IRQ Muxer, > > +which selects > > +8 of the GPIO interrupts to pass onto the GIC. > > + > > +A single node in the device tree is used to describe the GPIO IRQ Muxe= r. > > + > > +Required properties: > > +- compatible: the SoC specific name, i.e. "renesas,r9a06g032-gpioirq" > > + or "renesas,r9a06g033-gpioirq" followed by the SoC family name, i.e= . > > + "renesas,rzn1-gpioirq". > > +- interrupt-controller: Identifies the node as an interrupt controller= . > > +- #interrupt-cells: should be <1>. The meaning of the cells is the inp= ut > > + interrupt index, 0 to 95. > > +- reg: Base address and size of GPIO IRQ Muxer registers. > > +- interrupts: The list of interrupts generated by the muxer which are = then > > + connected to a parent interrupt controller. The format of the inter= rupt > > + specifier depends in the interrupt parent controller. > > +- gpioirq-#N: One property for each interrupt output from the GPIO IRQ > Muxer > > + that specifies the input interrupt to use, #N is from 0 to 7. >=20 > Why do you need this in DT? Can't the driver handle this dynamically? > When you request an interrupt on a GPIO line, then connect that GPIO line > to a free IRQ line. On the SoC that has this block, there is another CPU that runs firmware. It's likely that the firmware will use some of these GPIO interrupts and so we don't want them to move around. The firmware runs before Linux is up, and luckily setting up the registers again won't affect the interrupts. > If you really need this in DT, then interrupt-map can be used here. Ok > > + > > +Optional properties: > > +- interrupt-parent: pHandle of the parent interrupt controller, if not > > + inherited from the parent node. > > + > > + > > +Example: > > + > > + The following is an example for the RZ/N1D SoC. > > + > > + gpioirq: gpioirq@51000480 { > > + compatible =3D "renesas,r9a06g032-gpioirq", > > + "renesas,rzn1-gpioirq"; > > + reg =3D <0x51000480 0x20>; > > + interrupts =3D > > + , > > + , > > + , > > + , > > + , > > + , > > + , > > + ; > > + interrupt-controller; > > + #interrupt-cells =3D <1>; > > + status =3D "disabled"; >=20 > Don't show status in examples. Ok > > + }; > > + > > + gpio0: gpio@5000b000 { > > + compatible =3D "snps,dw-apb-gpio"; > > + reg =3D <0x5000b000 0x80>; > > + #address-cells =3D <1>; > > + #size-cells =3D <0>; > > + clock-names =3D "bus"; > > + clocks =3D <&hclk_gpio0>; > > + status =3D "disabled"; > > + > > + gpio0a: gpio-controller@0 { > > + compatible =3D "snps,dw-apb-gpio-port"; > > + bank-name =3D "gpio0a"; > > + gpio-controller; > > + #gpio-cells =3D <2>; > > + snps,nr-gpios =3D <32>; > > + reg =3D <0>; > > + > > + interrupt-controller; > > + interrupt-parent =3D <&gpioirq>; > > + interrupts =3D < 0 1 2 3 4 5 6 7 > > + 8 9 10 11 12 13 14 15 > > + 16 17 18 19 20 21 22 23 > > + 24 25 26 27 28 29 30 31 >; > > + #interrupt-cells =3D <2>; > > + }; > > + }; > > + > > + > > + The following is an example for a board using this. >=20 > Don't show the soc/board split. This is convention, but not part of the > binding. Ok > > + > > + &gpioirq { > > + status =3D "okay"; > > + gpioirq-0 =3D <24>; /* gpio0a 24 */ > > + gpioirq-4 =3D <3>; /* gpio0a 3 */ > > + }; Thanks for your comments, Phil