Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5134094rwb; Wed, 21 Sep 2022 03:45:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HxnhTE1lM65QykeBxGZ8K8nRWPy2WGbcikX9V6rmrIepIlj6byLAn5RmV06aG9aUPd/W3 X-Received: by 2002:a17:907:6da2:b0:77c:52c4:882f with SMTP id sb34-20020a1709076da200b0077c52c4882fmr20454578ejc.246.1663757133969; Wed, 21 Sep 2022 03:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663757133; cv=none; d=google.com; s=arc-20160816; b=cup7LOJqdlLfpGFUWVlY96bVt6C2DYSKGUoUFOKiFJcl0CAQMJ6SeCM4KuZfFlwBWK pGFH9oARGk5WUTYiOcb/9l5520tMAK8JP9pTNBV+gtL454PUCDzXNoEsJ7ds7wEL37OX n5bt5tJR4sl0h5J1W4Opilen1YEDvULJQJdRxnbxrTb3JiHqy+X9Lmz/TSHZqtHgwrn3 0qJsYc/z34k/2E9tp2SIHTQfzZLit6MeqXaQdbUeH8/SaomYD3k75bgRe9rlsT3uLEhB v4hwsWbthcn9AR9KqJxcpH3Fn9Dt9Dt3oSsM3+1Utm8BL75aaMPaPatDEcjhiJa7YG2c oDBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MR9H4bqmZ2tfEGO733RPO0gfhVbT29059auoKfFWu98=; b=TT+Gr3stYfQ1U7JD6SOy+x94ab3GeMDdWa/0t/s8NAn0xoDNDml1RWagdhNeId656J HcVKZnqR56Kp0YaZtDunEyb2JkAI1x4J4cFkG4JUUWmkhLKgfhZvz3M9Wz+5+s24PXXP yuEZ6K576/VfcSFeVpHjFTc08c/IntwVAb0ftlJl2ed1S+zhoc1FvJPC2p/4CxMddSeF YdRK1o+NL5SGRnv1xtSy42T5PLkBLi7lAjgSv9a67w0vizKfSHFkfdqnO2qXPkgAyhiR fgYPPy6dAYQzhGrGEbm3HAAq5gYCUAth/NXBH0T7xlbKDCydWQl1LmUUOOJnNKEzhwP7 9Sow== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a50d746000000b004487436b380si2156109edj.363.2022.09.21.03.45.07; Wed, 21 Sep 2022 03:45:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbiIUKOU (ORCPT + 99 others); Wed, 21 Sep 2022 06:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbiIUKOP (ORCPT ); Wed, 21 Sep 2022 06:14:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA28E9352A; Wed, 21 Sep 2022 03:14:14 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B2E9313D5; Wed, 21 Sep 2022 03:14:20 -0700 (PDT) Received: from [10.57.18.118] (unknown [10.57.18.118]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 71CA13F73D; Wed, 21 Sep 2022 03:14:11 -0700 (PDT) Message-ID: <567e9e6c-e34c-4ded-9622-9ad8387dd24b@arm.com> Date: Wed, 21 Sep 2022 11:14:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: Similar SoCs with different CPUs and interrupt bindings Content-Language: en-GB To: Krzysztof Kozlowski , "Lad, Prabhakar" 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 References: From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE 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 On 2022-09-21 10:26, Krzysztof Kozlowski wrote: > On 21/09/2022 11:20, Lad, Prabhakar wrote: >>> >>> 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? > > diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi > index ff6aab388eb7..0ecca775fa3f 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_NUMBER(na) (na + 32) > +#define SOC_PERIPHERAL_IRQ(nr, na) GIC_SPI nr SOC_PERIPHERAL_IRQ_NUMBER(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 = , > > > > Or any other method like that.... Which will generate the text: "interrupts = ," (give or take some whitespace) CPP supports constant expressions in #if and #elif directives, but macros are purely literal text replacement. It might technically be achievable with some insane CPP metaprogramming, but for all practical purposes this is a non-starter unless dtc itself grows the ability to process arithmetic expressions. Thanks, Robin.