Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1305830iob; Fri, 29 Apr 2022 02:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3F2p2LkwHTjZHxp1YORU5VMuHmiBzd89I7xuGt+uS3IIlRyhPVQfwANHpGELK4Pu5IVJ+ X-Received: by 2002:a2e:904b:0:b0:24f:5af:4f86 with SMTP id n11-20020a2e904b000000b0024f05af4f86mr20644643ljg.511.1651224247873; Fri, 29 Apr 2022 02:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651224247; cv=none; d=google.com; s=arc-20160816; b=sjqvOTh4JBE/fJX9tUfue+rtbLf1sSj3TIvk76hG8AEbl9S12fR+nanE1cW6QTI1IS ETkIfsF0DhYtESzWrA+w30S+znEvHHPX334cMaW8MBC9koZJCtEb7Xs8IjMJt9KvIfvT LeGUzSJ0GvFDGR55bxGikaUeN8mFkstyfeMF9Djm1tLiiZ1QoI15euITRuOUPTyP97se IXgSHQ6kt/nbk/f0gzqpsokivkiqAGc6iWkgHQ07znZ4lhF8pDkqghPzsLJcmxIYFup+ F4I7RK2TWPQ/KWOsO8TI+rkKfQ8BfweX88elV3+dDF0D/CoaVP6AMZoDYskx2t1CsVAp HhOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=CVvsKUh93mtPsnlNQathxAWXpj+Qll6q8xdLe3dz68k=; b=vExmb1xJM+e0Kp1TGFHfvW269s+QbG4/TaBEZxdUxKrVvoQZXXExJ9f4OQBwZ8e18j gjNR678t6TQeXBbeIJ4X2W9G3wCyEUeOvTS8TSh/5q7Rec4byHW2tRheI4dkft23334l Gt+buQok5N0kxSKnTZE4k+PyTqZFRdaryFm1I3zpAEFfpCXKiE+ElLbNRg7fxjgGg5A4 GX54xqZpg8TGqA9x9oSXMkQTgfeAak3RQO7XMeHt+Ssy2r5STdbmQ1Vpwx8xm/hkiiTg MJvM6aZYborzBEJKS/Umw+Mh+bVuAGQHhzutpPIpldDnchn8uD5yjOme2LQrLAjmZqEf e/vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 196-20020a2e05cd000000b0024f14a4bfbfsi6717532ljf.122.2022.04.29.02.23.41; Fri, 29 Apr 2022 02:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236118AbiD2IsJ (ORCPT + 99 others); Fri, 29 Apr 2022 04:48:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351140AbiD2IsD (ORCPT ); Fri, 29 Apr 2022 04:48:03 -0400 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAF6C4021; Fri, 29 Apr 2022 01:44:46 -0700 (PDT) Received: by mail-qk1-f179.google.com with SMTP id i2so5357437qke.12; Fri, 29 Apr 2022 01:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CVvsKUh93mtPsnlNQathxAWXpj+Qll6q8xdLe3dz68k=; b=V1d/GbuzmefHVg4Vw4w0+jpC8UFkaebrCA42UDzcU5r+YsUmd8MflGluv4zrm7OALv 4zj/jD3oV9RqUQXVfBDZNfsMTeuQBKuqKtlR4ueYL1AkdF+hmHJa7SErcwZr5j9IJp/a FdIB/+FsX/6/mYVriTGXIfZl/Ho8B8jJh0cCuRmTmt5NSMmQoDn0SHEomfdByVCqbq2f kVLc3AcFr4fXS8SMiGFBfXZ0nYZOEvZdviWoWUOlJHBU59lADjRijKmOiGyarWWNz8cF w9ZS0HZ6yEX44g3SiaaJpgKmklLsxAuhKbBSTAsVdv8onUYUNNktYVShRLDjMxHYwIhh VjHw== X-Gm-Message-State: AOAM532rlFYrpYRhLVHDTn7izZYiU9LzdvNbzDyRL01MBxDyvGJBELNo wYlHQx8I542bmGxSLFPH3IExrJQI60byQonK X-Received: by 2002:a05:620a:29cc:b0:69f:402e:ac38 with SMTP id s12-20020a05620a29cc00b0069f402eac38mr17004080qkp.131.1651221884944; Fri, 29 Apr 2022 01:44:44 -0700 (PDT) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com. [209.85.219.177]) by smtp.gmail.com with ESMTPSA id a12-20020ac84d8c000000b002f38c14f35esm1319429qtw.81.2022.04.29.01.44.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Apr 2022 01:44:44 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id s30so13284742ybi.8; Fri, 29 Apr 2022 01:44:44 -0700 (PDT) X-Received: by 2002:a5b:24e:0:b0:63d:cba0:3d55 with SMTP id g14-20020a5b024e000000b0063dcba03d55mr33655714ybp.613.1651221884000; Fri, 29 Apr 2022 01:44:44 -0700 (PDT) MIME-Version: 1.0 References: <20220421221159.31729-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220421221159.31729-2-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 29 Apr 2022 10:44:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: interrupt-controller: Add Renesas RZ/G2L Interrupt Controller To: "Lad, Prabhakar" Cc: Lad Prabhakar , Marc Zyngier , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Geert Uytterhoeven , Linux Kernel Mailing List , Linux-Renesas , Biju Das Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Fri, Apr 29, 2022 at 10:38 AM Lad, Prabhakar wrote: > On Thu, Apr 28, 2022 at 10:32 AM Geert Uytterhoeven > > On Fri, Apr 22, 2022 at 12:12 AM Lad Prabhakar > > wrote: > > > Add DT bindings for the Renesas RZ/G2L Interrupt Controller. > > > > > > Signed-off-by: Lad Prabhakar > > > > Thanks for your patch! > > > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-irqc.yaml > > > @@ -0,0 +1,131 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/interrupt-controller/renesas,rzg2l-irqc.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Renesas RZ/G2L (and alike SoC's) Interrupt Controller (IA55) > > > + > > > +maintainers: > > > + - Lad Prabhakar > > > + - Geert Uytterhoeven > > > + > > > +description: | > > > + IA55 performs various interrupt controls including synchronization for the external > > > + interrupts of NMI, IRQ, and GPIOINT and the interrupts of the built-in peripheral > > > + interrupts output by each IP. And it notifies the interrupt to the GIC > > > + - IRQ sense select for 8 external interrupts, mapped to 8 GIC SPI interrupts > > > + - GPIO pins used as external interrupt input pins, mapped to 32 GIC SPI interrupts > > > + - NMI edge select (NMI is not treated as NMI exception and supports fall edge and > > > + stand-up edge detection interrupts) > > > + > > > +allOf: > > > + - $ref: /schemas/interrupt-controller.yaml# > > > + > > > +properties: > > > + compatible: > > > + items: > > > + - enum: > > > + - renesas,r9a07g044-irqc # RZ/G2L > > > + - const: renesas,rzg2l-irqc > > > + > > > + '#interrupt-cells': > > > + const: 2 > > > > What is the meaning of the cells? IRQ number + flags, I assume? > IRQ number and the type. > > > How are the numbers mapped, do you need a DT bindings header? > No, just plain numbers are used (driver handles the validation of the > interrupt numbering), for example like below, > > ð0 { > ... > status = "okay"; > > phy0: ethernet-phy@7 { > compatible = "ethernet-phy-id0022.1640", > "ethernet-phy-ieee802.3-c22"; > reg = <7>; > interrupt-parent = <&irqc>; > interrupts = <3 IRQ_TYPE_LEVEL_LOW>; OK, so the number must be an external interrupt number (0..7). > ... > }; > }; > > And for the GPIO: > > key-1 { > gpios = <&pinctrl RZG2L_GPIO(43, 0) GPIO_ACTIVE_HIGH>; > linux,code = ; > linux,input-type = ; > wakeup-source; > label = "SW1"; > }; OK, so in this case the interrupt number is obtained implicitly, and no interrupts property is used. > > Perhaps it would make sense to increase to 3 cells, so you can use > > one cell for the type (cfr. e.g. GIC_SPI), and the second for the > > plain index within the type? > > > Could you please elaborate on this. Are you referring to the type here > as the type to be set up in the GIC? Please ignore, you don't need the type, as it's always an external interrupt number, right? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds