From patchwork Mon Oct 24 17:34:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 10364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp685799wru; Mon, 24 Oct 2022 15:41:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FRCv+Wvh3cWS7jfGDf6eUb2j9Pp53cOkDZlrTKQgNV+wTi2LPjUjcAq4af+xUIntI+/TD X-Received: by 2002:a17:906:5a5f:b0:79f:9f1f:2fef with SMTP id my31-20020a1709065a5f00b0079f9f1f2fefmr13924454ejc.396.1666651276516; Mon, 24 Oct 2022 15:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666651276; cv=none; d=google.com; s=arc-20160816; b=PicrmwxEbCkcLLrmVPFoG+nxWr8r2cBh8LYd2nhBCaMzxGAgy2uq8axWEB4Eo1lsba mDqq8UF2eiD8JZdCmoDIlv8wszoTbkiUHkVm1t7OW0gv3yo1aX7so8GjThtSBeq5poNo eFQj6INC4YYGBMpc6oSD3aw4OmV1Uws1o/I0VYxLMK0VESIipHI9ef8TeQ+shCsBl2JZ fGeEXXGh5uvlQcnfKXfRlbecw3JcZp0PC8XkUULx5ZnyAwgYjEQCT1D+Y0oWdNiu8d8Z jOLY1+5EO2EIcouowL0o5n8dlHABbbhkG8CGukqn2tkT6pavHZgi5RVbSxtOd6DXjU75 9fWQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0Wv3kxu1zrI9I3zQ+/ntswY76RUlx98SfDnQU2HARwY=; b=sJmTRdJlpOVmsRRZJeImGCM/nO5sN6QErxhNIZ4Ld0iyybtzJhkmusbPZrPGQIuK94 D2ZbwhDNdx/zwsl6kZy3uT43u5GT/yZZsW3LJT3ONCmMQ/Najf8g0ZMD8x8CavxVg7pe QDj3BTtS7p1THk1SOEChpQt6zMPf4T/jHWG9gMf8SXlLm1CniNfjSCWHaoc8IVMxyvgB yb3oluRF++nZv6ceFt5Eo4q5YId991dKvocOWcfu+x5Mnv5NMHhHiJGJ46z8+EbI5rbX Sm9GQLQKH/i3KCNtdX7d6gJRRod/kaYnQCgTT1dj5ZQ/b7A4lODpoRYo2I1klmGeZ7Af Tn3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hXT8UWk0; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a056402430700b004574154f09asi1078523edc.529.2022.10.24.15.40.51; Mon, 24 Oct 2022 15:41:16 -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=@ti.com header.s=ti-com-17Q1 header.b=hXT8UWk0; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbiJXWkJ (ORCPT + 99 others); Mon, 24 Oct 2022 18:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232051AbiJXWjH (ORCPT ); Mon, 24 Oct 2022 18:39:07 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE5752BC853; Mon, 24 Oct 2022 14:02:42 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29OHYbA5050121; Mon, 24 Oct 2022 12:34:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1666632877; bh=0Wv3kxu1zrI9I3zQ+/ntswY76RUlx98SfDnQU2HARwY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hXT8UWk0aIiJTHKS33cig5CCvhV3QV4PYwjWxDEnmd+IOSxTNQo46NtchRmE6eEu3 nUQ06Qxeng6BL21C3rF26Ho6nEl1BvfCYSdmZ1WG3KKBAmZYYRm6f1GH8zeqdRXy9s ysP3dKBVjHR+Zx4ZzIjlZJ9hJ74sqXEGYZujQPgc= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29OHYbbv122837 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 24 Oct 2022 12:34:37 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 24 Oct 2022 12:34:36 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 24 Oct 2022 12:34:36 -0500 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29OHYYJ0039154; Mon, 24 Oct 2022 12:34:36 -0500 From: Andrew Davis To: Shawn Guo , Li Yang , Sascha Hauer , Rob Herring , Krzysztof Kozlowski , Nishanth Menon , Vignesh Raghavendra , Masahiro Yamada , Michal Marek , Nick Desaulniers , Geert Uytterhoeven , Frank Rowand CC: , , , , , Andrew Davis Subject: [PATCH v2 2/7] kbuild: Allow DTB overlays to built into .dtso.S files Date: Mon, 24 Oct 2022 12:34:29 -0500 Message-ID: <20221024173434.32518-3-afd@ti.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024173434.32518-1-afd@ti.com> References: <20221024173434.32518-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747610529156945912?= X-GMAIL-MSGID: =?utf-8?q?1747610529156945912?= DTB files can be built into the kernel by converting them to assembly files then assembling them into object files. We extend this here for DTB overlays with the .dtso extensions. We change the start and end delimiting tag prefix to make it clear that this data came from overlay files. [Based on patch by Frank Rowand ] Signed-off-by: Andrew Davis Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Reviewed-by: Frank Rowand Tested-by: Frank Rowand --- scripts/Makefile.lib | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0376a6f18bfb1..250b9fd73f6d2 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -358,7 +358,7 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@) # Generate an assembly file to wrap the output of the device tree compiler -quiet_cmd_dt_S_dtb= DTB $@ +quiet_cmd_dt_S_dtb= DTBS $@ cmd_dt_S_dtb= \ { \ echo '\#include '; \ @@ -375,6 +375,24 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE $(call if_changed,dt_S_dtb) +# Generate an assembly file to wrap the output of the device tree compiler +quiet_cmd_dt_S_dtbo= DTBOS $@ +cmd_dt_S_dtbo= \ +{ \ + echo '\#include '; \ + echo '.section .dtb.init.rodata,"a"'; \ + echo '.balign STRUCT_ALIGNMENT'; \ + echo '.global __dtbo_$(subst -,_,$(*F))_begin'; \ + echo '__dtbo_$(subst -,_,$(*F))_begin:'; \ + echo '.incbin "$<" '; \ + echo '__dtbo_$(subst -,_,$(*F))_end:'; \ + echo '.global __dtbo_$(subst -,_,$(*F))_end'; \ + echo '.balign STRUCT_ALIGNMENT'; \ +} > $@ + +$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE + $(call if_changed,dt_S_dtbo) + quiet_cmd_dtc = DTC $@ cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ $(DTC) -o $@ -b 0 \