Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5129466rwb; Wed, 21 Sep 2022 03:40:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM646wWmcoipf/7PjXkxPDm9Zn38E/yWlTh+ix7TQLWOZGtgu+r0dWtvnwRVcv4XG7UUqxeI X-Received: by 2002:a05:6402:2787:b0:451:d655:9269 with SMTP id b7-20020a056402278700b00451d6559269mr24375551ede.375.1663756853378; Wed, 21 Sep 2022 03:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663756853; cv=none; d=google.com; s=arc-20160816; b=yJPZ9Lj6P7uBt6UJHpVrPHqnQGwH354ztT/3Y/rjIF/BHSCglJNlQjYlZiqXZD5bNN mTdg8v6ed47V3ddUG0Ii/Pzq27oO2/dBj/pmeaSpY6RNdyTRbH4sB6gpOkq4p4by1Dgz pNbV22fr2AwxWhyw7a5Y+k5lL5cXzKICt4ZGnMpxtMfeNUjLJ82J4fHJUGkNoDQtEOgp 6HWn3ozm5z4FRVVIBklWwo05zIh89rHpDC1cab7+PWSuD1z7cFcAtQJoUlytb7RM0UA2 81AA3R6H7Z68RTegvtCttLKLBaEOyz+3nXLxGt41QQWr5xWXb/LDEK5fWLT5j75c1F3t 6GEw== 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=mGdSF5O+l6DRak3WGmXGAgdJhMH3YKjrkDaJ8hXaH2M=; b=DBBTFDwv++gpCuZFB6cI3eJVSdcxZFHy11IiOlZu2rAQp4B68tAfpBKLqlPIffUqxr gQxKapEiSN+NG9QWJUEiEUTl7QBCWj3xtWfkDjhH90MWBOzXigRyomOA+qvf9Y1/oAWI h4MoOh5tdnZ3hI99s7lra/Lpvb+N0fpKGXBa67SqtrRHanxK2aXgwB4dtDe8aWTcR2t/ 0YOaZSyzROhaal1Pn7u4wGU/nQSAxDtR0yCMThdVV61rarH0ONYngjIa+vUCoLP1i63W ai4sUQ5xqGH1Km6uluex/ZokvEyokrpMlwNvVHvaOU4X708tZEV1ZPDWu9iaKMqxlV7t Lk8g== 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 t4-20020a17090605c400b0074168953071si1538819ejt.866.2022.09.21.03.40.26; Wed, 21 Sep 2022 03:40:53 -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 S229677AbiIUK13 (ORCPT + 99 others); Wed, 21 Sep 2022 06:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiIUK1X (ORCPT ); Wed, 21 Sep 2022 06:27:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F45F3ECDD; Wed, 21 Sep 2022 03:27:22 -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 0E2B5143D; Wed, 21 Sep 2022 03:27:28 -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 C259B3F73D; Wed, 21 Sep 2022 03:27:18 -0700 (PDT) Message-ID: <146a749f-f4f0-c188-d6a3-1b41d88487ec@arm.com> Date: Wed, 21 Sep 2022 11:27:14 +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: <567e9e6c-e34c-4ded-9622-9ad8387dd24b@arm.com> 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 11:17, Krzysztof Kozlowski wrote: > On 21/09/2022 12:14, Robin Murphy wrote: >>> +#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. > > Except I put it into flags, not to IRQ number, it works, so I am not > sure why do you call it non-starter? Oh, it seems dtc *does* understand arithmetic already, that's what I was missing. $ echo "/dts-v1/;/{foo = <(2 + 3)>;};" | dtc -Odts /dts-v1/; / { foo = <0x05>; }; Thanks for teaching me something new! Robin.