From patchwork Sun Oct 23 18:24:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13016389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 804C4ECAAA1 for ; Sun, 23 Oct 2022 18:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JUk+T7WAyi6YKd2Z7o9y3H6RmSQMX0ryS6fZL6kmaUg=; b=j0ZEr7+0WH7ow1 QppxcyGxhz6T14zFIcHDHdTYgCDyeZnLgyEnF/PrWy3oWwQaperuOMN1F292mjpbwpCyoc6vYOM+m 8dZGrNj2mK0zL14CwZgrrTD4DyxRKhj65blO7koBXch7+jn9YeSap+T2PvtOW34q8YMIEZ5dcyRLF VpqKrVnhhpiMENO0p5y+n3Gr0epDVDdl5PAvZsS+J43/lEyCrsA+ODtF2xBjLTmA+NguIIXa/3Hho toRbvmE0xBs4XFG0QfCyrwD21e4bCPkIQmlUJH+VyHGRWk3FjkyAOk0ZVDdhIEnhAOCEvJDCadgNY y5EW1xegiUupeLi0UKvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1omfez-00Fvh1-Jx; Sun, 23 Oct 2022 18:25:21 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1omfed-00FvZg-GV for linux-arm-kernel@lists.infradead.org; Sun, 23 Oct 2022 18:25:02 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29NIOfsZ035573; Sun, 23 Oct 2022 13:24:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1666549481; bh=Fmy+mYVx9MxGpU/WkG0ZR8SjHYq+UKMu6PeS/x/ZGk4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EXyqHctyiZX78waID8y1ByJOcBfm74UC2bUYWr4A8pRH+LNXW2sb7b/vzv8MFWNS3 +gn4IA9VHIFH2rws1Ls3MClx14vIVdfyNwPwMxoXqkr2UW/Yj2WUT3/pr1SKLcKESC e3lqvg6HiPMrjZ/xYpWVOmBigbXiG8dQE6HsrX4Y= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29NIOf0G043391 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 23 Oct 2022 13:24:41 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Sun, 23 Oct 2022 13:24:40 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE105.ent.ti.com (157.170.170.35) 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; Sun, 23 Oct 2022 13:24:40 -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 29NIObVZ042708; Sun, 23 Oct 2022 13:24:39 -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 2/6] kbuild: Allow DTB overlays to built into .dtso.S files Date: Sun, 23 Oct 2022 13:24:33 -0500 Message-ID: <20221023182437.15263-3-afd@ti.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221023182437.15263-1-afd@ti.com> References: <20221023182437.15263-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221023_112459_715199_FC03A901 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 \