From patchwork Fri Oct 13 08:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aradhya Bhatia X-Patchwork-Id: 152404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1750186vqb; Fri, 13 Oct 2023 01:54:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEq/69dXTIARlZMod7afqBcjacWsn30mk4oqxsgAh91N0T42i4wvz4JarwDen0FXMa7xJt6 X-Received: by 2002:a05:6808:1590:b0:3a9:f25d:d917 with SMTP id t16-20020a056808159000b003a9f25dd917mr34012976oiw.4.1697187289274; Fri, 13 Oct 2023 01:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697187289; cv=none; d=google.com; s=arc-20160816; b=aZitpnOR9rblnXDFBUiNaIEUBigj7yts7V4AALvS/ay997lYi97wKVcdYfLaV29RES yfjK/uB2ibw8gKpgt1HwUD2lZ4Tw8XUDOskBhC/iBMrbH73HeceIPLLB04dssAz2ZEjW n2yz+tWp75bDa6xZvUt3DOxwswjOHuWuDTt6sVzeGxwyc3GhxRCpc6jLcghl+GhtBDMd rzKAbYejcPOpNFbfTxRHJiynf86xZzZPJTp2rl8bOl0K06H0nzrQcVXlbEgYDcbc3nCh v4gmmPKgqPqLYUGFPRbX/2wx3IkBf85f5brp3TpJF1/VIFcVHlB9/JrwXCgV7jFoY0B+ mLbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EIam3hHPeLxKkwM9apMuaUiIVgyIIPYm6Gl0dS+/eNc=; fh=lDi1rHrLGPFV0MsZ1brxb7UFsvDz4tKIT4Kq1nABHSI=; b=RLknA6vO3zf3jP9e0ZYJ1GNl4pQKwZmxZID0FsqiSmDdm2kmBxi/KaVz+KyolM95TW O596kz0TZ+dW7cL2kF8UoF8RdqG4k4anmmnHNjPF3sr+nvE/+oAS61tQjc38KfyM582O s4r3GSSey0QmFL2e8/IQnkYWSwdmGN2/OvA6CD92orzxRYzLhx5nApHpOosTppKElrZ5 E5TYO1kb2pXg1uz4HT8QAdGkwbpIMi4bmFA2JOzWtirqSiCbDLEe9+pN/vNKhUf3Iw8W UPQH1/uqluc7zeNO64WwCJsT+0rhdNkAa+gctyHE9rvgOU8rincn2Z8MHGH/RPLvnbq0 fxYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ulAQTU51; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bz25-20020a056a02061900b005859e224617si4996890pgb.818.2023.10.13.01.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:54:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ulAQTU51; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 14A7082C2D2C; Fri, 13 Oct 2023 01:54:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbjJMIye (ORCPT + 19 others); Fri, 13 Oct 2023 04:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230125AbjJMIyd (ORCPT ); Fri, 13 Oct 2023 04:54:33 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D72C95; Fri, 13 Oct 2023 01:54:31 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39D8sPwe065459; Fri, 13 Oct 2023 03:54:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697187265; bh=EIam3hHPeLxKkwM9apMuaUiIVgyIIPYm6Gl0dS+/eNc=; h=From:To:CC:Subject:Date; b=ulAQTU51GdEa+oQ/saoxM+fXUgbPwSrq1PZYzKpVPlRAgj9sjoong40r+wGg6OkdI gVZrbBHOrB9CL7Bf+lPWghbDsOC3SwbP9LjueAULBUJbI9h5bf4lQnZnit2jxT2p+w RJmwM9qBzTBjPsbVxVwmM3ki4JFROwbDlpdqYl20= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39D8sPsN037438 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Oct 2023 03:54:25 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 13 Oct 2023 03:54:25 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 13 Oct 2023 03:54:25 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39D8sOTZ040179; Fri, 13 Oct 2023 03:54:25 -0500 From: Aradhya Bhatia To: Rob Herring , Frank Rowand CC: Devicetree List , Linux Kernel List , Andrew Davis , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jai Luthra , Jayesh Choudhary , Aradhya Bhatia Subject: [PATCH] scripts/dtc: Allow ports to have a single port@0 child Date: Fri, 13 Oct 2023 14:24:24 +0530 Message-ID: <20231013085424.7137-1-a-bhatia1@ti.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 01:54:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779629859162017679 X-GMAIL-MSGID: 1779629859162017679 Exempt 'ports' from the rule which asserts that nodes with single child node having reg = 0, should not have the '#size-cells' and '#address-cells' properties. Ports of certain hardware do need to be described as only having a single child node 'port@0', especially when hardware has multiple ports, and the other ports 'port@x' are planned to be added subsequently. In such cases, just using 'port', would be an inaccurate hardware description. For example, Texas Instruments' DSS (display-subsystem), which has 2 or 4 video ports depending on the SoC. Describing the first video port with just 'port' under ports would be inaccurate and even slightly misleading. Simply using port@0 (when other ports are not added) produces the following warning, while making dtbs with W=1 flag set[0]. code-block :: Warning (graph_child_address): /bus@100000/dss@4a00000/ports: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary Signed-off-by: Aradhya Bhatia [0]: https://lore.kernel.org/all/570903b6-8239-d44a-5fac-71700804cb5d@ti.com/ --- scripts/dtc/checks.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c index 9f31d2607182..705aa0fbcfa2 100644 --- a/scripts/dtc/checks.c +++ b/scripts/dtc/checks.c @@ -1797,9 +1797,18 @@ static void check_graph_child_address(struct check *c, struct dt_info *dti, cnt++; } - if (cnt == 1 && node->addr_cells != -1) + if (cnt == 1 && node->addr_cells != -1) { + /* + * The graph node "ports" are exempt from this rule, because + * certain hardware do need to be described as only having a + * signle port with reg = 0. + */ + if (!strcmp(node->name, "ports")) + return; + FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not necessary", node->children->name); + } } WARNING(graph_child_address, check_graph_child_address, NULL, &graph_nodes);