Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5109838rwb; Wed, 21 Sep 2022 03:22:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zi0EaGSi5mZTgJNsqkYMNoGpYd+HlmNnFwTnDHFjx0xLZGCbSpwT1wAchihpBcVVRnLoe X-Received: by 2002:a05:6402:3549:b0:454:414e:a7fd with SMTP id f9-20020a056402354900b00454414ea7fdmr10906163edd.69.1663755742004; Wed, 21 Sep 2022 03:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663755741; cv=none; d=google.com; s=arc-20160816; b=cUekxp5vdawPMTJm+0aJVy/ADU0pmM6gJe9IAQkmXdmZq4Kz61PHCVDyrMYV2Wi7iy cxtebb1p7bcVlXm1lDWXa+yJO2zB7gsvU5w+brg+pGdGC7z6g53oviLjFCfsTw/PHbWo 7Nq45a5CnerXHOet9rn1h6YdYf05rB9RlaWUZ5RNhMS4ZGOixLGZZx1mhyPNLOhGisiq 3gCVpXUGzlkT/dtpfovZ8CRQIWnFd7Dnkt6+dblforrWNseV1GczJzkNQCfF8CDPCcuT qlCI089EDaaQvd80TLm/yWKAxXiL502Cgom3makzlMB6l4bYF9NyDMFk30ZUMDyUueGl 3KTA== 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:dkim-signature; bh=GLpNbv2dDZs2ELKJfedbPTLfT2mNSjQrTpD1eCAo9R4=; b=nzI1FCjyDuPt8Mm/n7Zmvz4m+QSmIFoeeUGvR+aO+jhtNkTcDGMr8tvUEY7J075il7 RZmzBO4UTzImybKWlTX4VJonT23xM+1x1grLP/e4B8QAkDSTXTtGbN9eHiqDpS/wfFAg 4CmGMfLycgRmWw85bAIw8PcdDdUjQQqMbJOohN5OAmHS1+v5+HPOSeGbKB1ICO0dUtue Sd7EyAkYIdVC9zIqoHoqN12llw+gBQ9prxk0JS7CdhDa+O5wtsjHkimdHO9ECm+7lSxF HwKgWKK2ZscnvxigEIXXLJCOFWZoUqKDp48BUrA/s0yM29vAmjgzcBz8Hln3X35bRD0v d8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mdAeRwbF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di17-20020a170906731100b00734804bb362si2053604ejc.568.2022.09.21.03.21.56; Wed, 21 Sep 2022 03:22:21 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mdAeRwbF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiIUJW1 (ORCPT + 99 others); Wed, 21 Sep 2022 05:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbiIUJWG (ORCPT ); Wed, 21 Sep 2022 05:22:06 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E09EA51A37; Wed, 21 Sep 2022 02:21:27 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id a41so7735292edf.4; Wed, 21 Sep 2022 02:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=GLpNbv2dDZs2ELKJfedbPTLfT2mNSjQrTpD1eCAo9R4=; b=mdAeRwbFj19Rzs/mqgRFM2d7927buI86UH/L76robThQCURIrMdVolDmohaWuKLt8F ZfJGEFoE5VoyRUdHha0+3lArmu35lorSe0gugTFVVrKQJBPKvNZmq7HbVEpBfkHTjfKx X+FRub5EJupwXhVdt7yIy/jkz30YU74pYcMEwqsMB3xrL+wzsWAbmla2uTv3ihCuU9J9 eYWlTb67MOkHBcKQiT1i4XFrIn0KbAbBlMUPVD6NqznG8+UVojtf1f5yeFMb/wlgHwda 3soPAwF9S213cC9McMt9xZ7Rq8GJhxlCiJxhBSldfOIvj0jbxFmFKTZioJDYlrxq2UlP iSLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=GLpNbv2dDZs2ELKJfedbPTLfT2mNSjQrTpD1eCAo9R4=; b=xntGCVrHyezYpeT8ZxCifWLSbgJjVLWxs+8c1UYQ1ELQl6WIvYOIX7nDd8nnUP7FvV 3AcymrRTH6FW73iuSiC1RP23oYnkZnPv7MmZX1kqC21JRDEJ2ECgDZsQToSZOPY7Vcy9 xba7VWPEo+trH/xCO0ablbvGV0VjLHMU9OlG/oA0noD7yRUJ9YV28L/LlvbMq2OTc9XS T2ct1tb7MIHrNRxTYCxCsgpMmj3XeD49p0PaKpwyOIjk22aDmIOEVfiEeEN8MVWmMYRz hJeLBVu/YkYDCgR61SxeGy/kgqwfjnC2ahha47SbL6SurU1NL3kLc7/nH4lIwj3b0SK2 TXGg== X-Gm-Message-State: ACrzQf3yewhy53iOHLICk8NJPQ8uS33vHN96juGj5/HpTJQxHGd7LdRz CgXb+Xw8uEAvOBuYNqPEempdCT0+bI0cgLtchVE= X-Received: by 2002:a05:6402:350b:b0:452:2b68:90db with SMTP id b11-20020a056402350b00b004522b6890dbmr23967840edd.255.1663752085609; Wed, 21 Sep 2022 02:21:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Lad, Prabhakar" Date: Wed, 21 Sep 2022 10:20:58 +0100 Message-ID: Subject: Re: Similar SoCs with different CPUs and interrupt bindings To: Krzysztof Kozlowski Cc: Geert Uytterhoeven , Rob Herring , Krzysztof Kozlowski , Andre Przywara , Conor Dooley , Samuel Holland , Biju Das , Chris Paterson , Atish Patra , "Lad, Prabhakar" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-riscv , Linux ARM , Linux-Renesas , Linux Kernel Mailing List , Arnd Bergmann , Olof Johansson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Krzysztof, On Wed, Sep 21, 2022 at 9:53 AM Krzysztof Kozlowski wrote: > > On 21/09/2022 09:46, Geert Uytterhoeven wrote: > > Hi Rob, Krzysztof, > > > > This is a topic that came up at the RISC-V BoF at Plumbers, and it was > > suggested to bring it up with you. > > I guess you also need SoC maintainers as well (+Cc Arnd and Olof). :) > > > > > The same SoC may be available with either RISC-V or other (e.g. ARM) CPU > > cores (an example of this are the Renesas RZ/Five and RZ/G2UL SoCs). > > To avoid duplication, we would like to have: > > - .dtsi includes .dtsi, > > - .dtsi includes .dtsi. > > > > Unfortunately RISC-V and ARM typically use different types of interrupt > > controllers, using different bindings (e.g. 2-cell vs. 3-cell), and > > possibly using different interrupt numbers. Hence the interrupt-parent > > and interrupts{-extended} properties should be different, too. > > > > Possible solutions[1]: > > 1. interrupt-map > > > > 2. Use a SOC_PERIPHERAL_IRQ() macro in interrupts properties in > > .dtsi, with > > - #define SOC_PERIPHERAL_IRQ(nr, na) nr // RISC-V > > - #define SOC_PERIPHERAL_IRQ(nr, na) GIC_SPI na // ARM > > Note that the cpp/dtc combo does not support arithmetic, so even > > the simple case where nr = 32 + na cannot be simplified. > > What do you mean? Macros support string concatenation and simple > arithmetic like adding numbers. I just tested it. > I did try the below: diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi index 689aa4ba416b..0f923c276cd3 100644 --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi @@ -8,6 +8,8 @@ #include #include +#define SOC_PERIPHERAL_IRQ(nr, na) GIC_SPI nr na + / { compatible = "renesas,r9a07g043"; #address-cells = <2>; @@ -128,7 +130,7 @@ ssi1: ssi@1004a000 { compatible = "renesas,r9a07g043-ssi", "renesas,rz-ssi"; reg = <0 0x1004a000 0 0x400>; - interrupts = , + interrupts = , , , ; This worked as expected, but couldn't get the arithmetic operation working. Could you please provide an example? Cheers, Prabhakar