From patchwork Fri Mar 17 10:26:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1758188 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=LxFYH03x; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PdL0h5RBCz2473 for ; Fri, 17 Mar 2023 21:27:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5596085DB0; Fri, 17 Mar 2023 11:26:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="LxFYH03x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 80BD385888; Fri, 17 Mar 2023 11:26:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.2 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on072e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::72e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 19C6F85EE9 for ; Fri, 17 Mar 2023 11:26:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glIr7XfrWi4KxLXZTAksF2vO4DszjmuXRzQTf2GValL0M7To0TDP7D7C4zg/V3GPj7veczvWrvVMs7erUQnm05HST0xDAub/mjDCcFF4KF7K1TBlyVKazQdrepi4WQNc2i2YV0lmO8Rn6+smbzOs9nFP01ovlB5pC8oNquF4rW8TQp6TGzuJd+z8ABta8RRu4c6pGGKNXf1OunJfmyWdQzPE6vVfDwHr/xy34fGL1RzgiB0FiQ5EoctCMx5TvwGW0SGNOofeSs+E4El2cEyGWz5zKJrhJ7E2rbFEIJVrM8HDJqcirQRfRLJ+kO+fb38KSLv+LRnrOR987hWyG3KEjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hm6/nBgWvatvDH+CU5fih9AsP7AKEUR8nB+zLcBpdCA=; b=Xj/lmcqEpXxl+qxGBPgAlXUKkwfGbRHYAXsg7SqQ1sOgjUJSqxme7lDLk7Lq+70kEbPJE///7R3942aqE3LoF5J0tOSREwgqMZiCfd89MdyfcojWGv6xU1tzkHn449ZZQvFuDQwNbTRWdhPgLwLVRhD3fUyyxZvJjvgcOPm2N7ykA7++plq3K/YaPELHznvjZ3TTC/zFMTYh2gDUxcr9uQGSzu0QE5s8JCE7yO8ue+IsZcLr7y5QicG5z9QVnxpKYuoVQz+xuJeUeg3e/GT7cUa29YAjTG88xf3Gi7wPr7LpocFf4BLCPMtDUNa3ai5eDRTYZNuYWu18BqdcRlNGTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hm6/nBgWvatvDH+CU5fih9AsP7AKEUR8nB+zLcBpdCA=; b=LxFYH03xk2ZtwU/5vgsljCdvq4IBeh5ClkYjMHgxOG7GmOApPRL4zPkNXseIVFMeEKuiNGW3UGQjbALRDfgqkn5hhoHesJSO3ets3niE3JBu+tUoSaZWZcqDkf/NWMTvhDoVBggUm0qL3C0ZAXzp0PfgOWuhx8URbOHHfYYVeS8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) by PAVPR10MB6864.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:324::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.10; Fri, 17 Mar 2023 10:26:51 +0000 Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::5f2d:43cd:7e4a:30fb]) by DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::5f2d:43cd:7e4a:30fb%2]) with mapi id 15.20.6222.008; Fri, 17 Mar 2023 10:26:51 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Rasmus Villemoes Subject: [PATCH] scripts/Makefile.lib: also consider $(CONFIG_SYS_BOARD)-u-boot.dtsi Date: Fri, 17 Mar 2023 11:26:39 +0100 Message-Id: <20230317102639.464263-1-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.37.2 X-ClientProxiedBy: BE1P281CA0162.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:67::17) To DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR10MB7100:EE_|PAVPR10MB6864:EE_ X-MS-Office365-Filtering-Correlation-Id: d0f0ec78-928b-4e54-9ff7-08db26d21f41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h3SghhsrpKqNSMK8QPTNuRHlg3zUAuCyCMuvoFKsb8z/O2IjbGG60a2e8nM/2zgjIjGBT2kg4dNX7vOHBtG/qwE86YUL3//EFodlJTV1FCxaRXIKzzWdZmzrdVH+uxT8MqAKvbkzHTLxzm82DP0dHgKesUJ2jsvIP0xKR3FLNE7j3FpI4/BSGxbQzs3jNB+sE4km5OIXXSrzlYF22ilhtzelObsXGf/E0xovwwiALKUeHKrgq4AgQ1ZlDmZnTqFd+azItkvtpk92buYmOQwvcK9IS0KOBBR/Dc8LXeKGVGH53W90k4QlulcWeMLr8PyIIQw4Kg6mxwP+NnuDQodbkmS6u7m0jQx7rVukv5nv9S8l4hAgWER/FlGVAYLGOFAyUTvinkWfzNQRuqgJ7u7VxHTfMccTHxXU940gcsP+xIfs85SA/vrQdbaucTfZTQ8ne+NAft+2mlkO1r232FbX8GmHz1nnVsXvOMvwDjFBmKCCh1TKwIttwP6yrIFBALLeflypHaU0v2CZmuQFGuE6xRsawXq9lCi724Fu8YUxd+arjfc8QS6//J5ohsw7XLJpePUlNodxH090HthvsX3IjsC6DrIPUAOCLYGYa1CqEVljgBJ1O4f7WO/9RLdiQO7fsebacYfzXQp6YLYULrYxlWd/VcBmzlmhR2IK20ApQW5S++vyYF6ZfcDmBpTT1ANzW/Epj7JWn8iR+vNIMW+RvQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(39850400004)(366004)(396003)(376002)(136003)(346002)(451199018)(6506007)(2616005)(1076003)(186003)(6512007)(6666004)(6486002)(107886003)(316002)(52116002)(54906003)(26005)(8676002)(4326008)(66476007)(66556008)(66946007)(6916009)(478600001)(83380400001)(44832011)(2906002)(41300700001)(5660300002)(8976002)(8936002)(38100700002)(38350700002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HxAEMe5I3sX0o0YXXvtEoalPtkUnQdAK75sfCwQNaRec+8JeGvqiNxw6wFT7NnFZWti4AN2Th8jvqdsshDwFr0TOWI1x8zkTBswWnwJVKn3gsOq3kCnBenGu0RBKuUTZqOK1EfNneEmvFph4no7a8ZXsWknnd8fZXqgKUccm6InorzTz1DQqRbZSafnlXikzJxBFNdDQB1o2/ziKlGs8PyMeyidIofo2OD7wWT8YH/ibOaAfQGoogYHwcK63Ve/lEP1Jd0NSHjaL5qgP9FRjrOUkAqpvxdPMuuKT3+tfJaq6I06rE0ubLHqQDXScfHj2NNZNOuNYd35VYST2YyDS7FXQolr+bvN+P1uNuiCXz4Tppal10PwLwi+yk+7lLWbOIabMTmTbKUIl2Dm6q3icWtMgdI/8ULOv/SjWn0Qo3wdq64jqIAPkWy6+G6NP6MdlJPJv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PrPkKS0bdCH9ZJXCyXVC/K9O9X6ZcX4ni1Q1lAKOTnNjlETNDAomAqjF8pi+v37wPXBRgbcsSRAdsl1lellPjW2TUQkjTTPR3Biw== X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: d0f0ec78-928b-4e54-9ff7-08db26d21f41 X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 10:26:51.4568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OCOdlFiiIoMIxXByqscZxGLQ+iNIaLkPnmTXJAVrBnrsDmBT6sIROUqar9QDeanNCUOuXeXtKfaJJThJV9OJ1tkPouguh4VxOrPBQhaYX6o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR10MB6864 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean I have a couple of boards, e.g. foo21, bar33, each with a few different revisions, so I have foo21-revA.dts foo21-revB.dts bar33-revA.dts bar33-revB.dts Now the necessary U-Boot specific additions for the foo21 boards doesn't depend on the revision (likely for bar33), so I just want to have and maintain one foo21-u-boot.dtsi But currently I need to add dummy files foo21-revA-u-boot.dtsi and foo21-revB-u-boot.dtsi each just containing '#include foo21-u-boot.dtsi'. And similarly for bar33, and all those files become quite unwieldy as more revisions need to be supported. It's quite natural to look for a file named after CONFIG_SYS_BOARD, with lower precedence of course than a -u-boot.dtsi file with the same basename as the .dts, but higher than CONFIG_SYS_SOC. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- Of course, this can cause unwanted changes for existing boards. But a bit of ad hoc scripting shows that the risk is low: I first grabbed all 'default "foo"' stanzas of all 'config SYS_BOARD' instances, as well as all values of CONFIG_SYS_BOARD set in *_defconfig files. Then I made a list of all existing *-u-boot.dtsi files, and from these removed any where there is a corresponding .dts file. That leaves just imx6ul imx8mm mt7620 mt7621 mt7622 mt7623 mt7628 mt8516 socfpga_arria10 sunxi and inspecting a few of those suggests that they set SYS_SOC to the same as SYS_BOARD, i.e. they were already picking up the .dtsi file due to the SYS_SOC rule. Now, the only way to be really sure is to build the world with/without this patch and check if any .dtb file changes, but I don't have the means to do that. But I do notice that doc/develop/devicetree/control.rst | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/develop/devicetree/control.rst b/doc/develop/devicetree/control.rst index c71570d64b..831d225fb1 100644 --- a/doc/develop/devicetree/control.rst +++ b/doc/develop/devicetree/control.rst @@ -174,6 +174,7 @@ devicetree for your board, searching for them in the same directory as the main file, in this order:: -u-boot.dtsi + -u-boot.dtsi -u-boot.dtsi -u-boot.dtsi -u-boot.dtsi diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index ecc15041ee..69f4d560d1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -160,6 +160,7 @@ ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) # Try these files in order to find the U-Boot-specific .dtsi include file u_boot_dtsi_options = $(strip $(wildcard $(dir $<)$(basename $(notdir $<))-u-boot.dtsi) \ + $(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_BOARD))-u-boot.dtsi) \ $(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \ $(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \ $(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \ @@ -167,6 +168,7 @@ u_boot_dtsi_options = $(strip $(wildcard $(dir $<)$(basename $(notdir $<))-u-boo u_boot_dtsi_options_raw = $(warning Automatic .dtsi inclusion: options: \ $(dir $<)$(basename $(notdir $<))-u-boot.dtsi \ + $(dir $<)$(subst $\",,$(CONFIG_SYS_BOARD))-u-boot.dtsi \ $(dir $<)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \ $(dir $<)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \ $(dir $<)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \