From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 02 Jun 2021 14:20:11 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1loPr1-0002Fp-Q1 for lore@lore.pengutronix.de; Wed, 02 Jun 2021 14:20:11 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1loPr1-0005uH-Eg; Wed, 02 Jun 2021 14:20:11 +0200 Received: from mail-eopbgr30080.outbound.protection.outlook.com ([40.107.3.80] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loPqR-0005to-PK for ptxdist@pengutronix.de; Wed, 02 Jun 2021 14:19:39 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lhlzVduM/3Fu9w/NUAAXyol7kjxToce7ckTu+MKxJL0AIwsSh35MTa0cxv9o1rXAx9g//6Lno2gQqFTM5V/re6JGAXe7n5fRd6eVD5crym7fAcvvTD90H2y8GSmYdg7vQP3FcNxT2BWsigP/bTKBOU0JhRs4txG/leLU7GiTV+I+Y59lcAm60QemIlfEI7ajT/54OivAjeW8wGZ8KjLpgGNErYeuNEqUZ6bhXCs3YZUhUe4/FeixWIOFtuoXlrcjGciCuOqrFFuaASayNJ5UGAC31AsJ6vFxRYrEKOmHZlIFhGmuUXLGLwBxqdL55r5+CnyqmGkrG7FzDgsr2S+hng== 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-SenderADCheck; bh=rHxjMBXIzDIdbnscevw8ARNlgek4CDzmOUdXFgVjbS4=; b=hhOSQ/Bi2LaWnTLQvvcV3kV7aCohrHv/Se3Qd1hJz/yT+rhmYWV5+pwYBeRRqDnobrfPzRDAZAuH4MwY+yuTsM2n7MfmoTgm/0LFQiN18zlai8DGQAcnOG2jATEB4fWGNi8fNeq6uBd8N9msJjkXYwLmtxQeTbFw93r/nbFNMLjJmEz/L5EtB3lXx1qfv+pMbGdbystupiBeyimfkEojhBsGcIv+94w/qLwkQZK95wmF/Qqjvp0c9guH0f8+mffqHdLDsAlGglApjlW82iatVy11E7woUfBlr4fAqVqlS6+5k7laF3+XWxtzVnjQaTeectSIfXwQ1YHVrShdYdCrCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=t2data.com; dmarc=pass action=none header.from=t2data.com; dkim=pass header.d=t2data.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t2datacom.onmicrosoft.com; s=selector1-t2datacom-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rHxjMBXIzDIdbnscevw8ARNlgek4CDzmOUdXFgVjbS4=; b=h5DCAcyz+kMmAZlOrz/NsQxPkcEFeA95q5c2CRuVg3vsHmopwFLtsGj4sBTSaTAOgUJNyoOA3hO6jp0naPSKoGdZa8GhA+OH7F2Syl3xsgMLGLtlGGc8ndFbZvAMPEDJ3fceLzZkAn5puyDvpRcAOdhXo8IWQcxk3VxqrvCmCkE= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=none action=none header.from=t2data.com; Received: from HE1PR0602MB2858.eurprd06.prod.outlook.com (2603:10a6:3:da::10) by HE1PR0602MB3435.eurprd06.prod.outlook.com (2603:10a6:7:7f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.27; Wed, 2 Jun 2021 12:19:33 +0000 Received: from HE1PR0602MB2858.eurprd06.prod.outlook.com ([fe80::45ab:82f:2e40:b921]) by HE1PR0602MB2858.eurprd06.prod.outlook.com ([fe80::45ab:82f:2e40:b921%10]) with mapi id 15.20.4195.020; Wed, 2 Jun 2021 12:19:33 +0000 From: Christian Melki To: ptxdist@pengutronix.de Date: Wed, 2 Jun 2021 14:19:10 +0200 Message-Id: <20210602121910.2527-1-christian.melki@t2data.com> X-Mailer: git-send-email 2.31.1 X-Originating-IP: [212.247.174.226] X-ClientProxiedBy: HE1PR0202CA0006.eurprd02.prod.outlook.com (2603:10a6:3:8c::16) To HE1PR0602MB2858.eurprd06.prod.outlook.com (2603:10a6:3:da::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from voodoostar.hq.t2data.com (212.247.174.226) by HE1PR0202CA0006.eurprd02.prod.outlook.com (2603:10a6:3:8c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.21 via Frontend Transport; Wed, 2 Jun 2021 12:19:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88efb4a1-63a0-4262-bf46-08d925c0ad9d X-MS-TrafficTypeDiagnostic: HE1PR0602MB3435: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3qshN1A/qHzv9zfZrjyTzNvzaSHk7x9pFBDrHqUbSBUpu13bh5pBBJiyKgs5M8tr2cU3DQqvADvxWJ2sPhX56YoPQ5tlJZgqHXZjM0cn55XdgCEx1rrbNPuxa0ReRxeDLxN08GbOKHakQNER40opoH0M9y+Q4epQFRl1rXeNxlzBNOTFZPfWDVVUFDRvQP2mTZTlX+MFk3c7qn6U2vx8zPOe6gQwTCBXiiCdOK8P81KarAFe5DH9TyXTDfdve+jv649CPw7ikCizXivLyWbC1ruodZVAYnmmTlsPfYGgjzxkVQw2plJ5YUxpmeMOcfeOwRIvT++3Vll/g54F54N5O4c6frTVU/ZRS6OZQ5Wwh3yd5f3ACKs/UE1WEUeIdeynOvZr4/rM+iPNCt4DE/8yzv8bOY7LxtkC/OxTu3H9rUlPG2ZKIi40eBLKOjtX3tYMghINtd+IBD3AAS+lPHXTxSjSuRh2rB3/9LhLBBgguZ4jBHNpp3AsTXg2547VnJ5N2QkeT0MuGNlUzH6Bj3IQBG5pXwp+K76ivcURN6C1rfG+8QyZgBjkLrYKKJVk3axgMC+JUkD269iOSxq/3o+vvmAIxjkxggUbHdsFo/n/LGPDdbY06c34a8YD54W4L1WsToHAh1jJyk/JUU2pOvoe0g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0602MB2858.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(42606007)(136003)(396003)(366004)(39830400003)(316002)(8676002)(6916009)(8936002)(66476007)(6666004)(52116002)(86362001)(26005)(66556008)(16526019)(38100700002)(38350700002)(1076003)(2906002)(6486002)(36756003)(5660300002)(44832011)(7696005)(186003)(478600001)(66946007)(2616005)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?0n4OKET1wekYObWbc2sSZBmTabZ9JhqAyKyffRteYKr0EcFPzTFpA7MHpYOo?= =?us-ascii?Q?nS0hpdBUPJkKPbuuvq6/VMRMO58Sq4QLF8xZkO4Mfaqs3XgHhcRDGvVL2olv?= =?us-ascii?Q?V1KQFHV17ynGCsq6jOUvLQqyO8igCfBx5ASE7vNFNf4Y2Pk3EtPwOJFqs3ct?= =?us-ascii?Q?pdfNhdW8yfMv+Qqh/opOKdUuVjQbbMbHk4xG7EEMQ1qH+FumRGpJhNeDQK5Y?= =?us-ascii?Q?ORAlqPhclYlAXF1yfdCqSEW6vMG3KpOzqiOkI/fNmgjOwSHkpSgeglF8tzBq?= =?us-ascii?Q?4W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uGHdn9ib6dUs?= =?us-ascii?Q?8MWkI5MEk21VWSLs20MY1MyTGI7nnUmD738lFhil/i0yziSJXHdLbBqTZwNX?= =?us-ascii?Q?YIxwaOeAOqu7v5T62BivycKzNcHGK/IUDozNb+jd6tTHUBqxs7nkvqyOmz4s?= =?us-ascii?Q?rYcJELq6E2MQcEZvqlZG+9w2?= X-OriginatorOrg: t2data.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88efb4a1-63a0-4262-bf46-08d925c0ad9d X-MS-Exchange-CrossTenant-AuthSource: HE1PR0602MB2858.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2021 12:19:32.8669 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 27928da5-aacd-4ba1-9566-c748a6863e6c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Twsnplik7OOZgTbtlvgmbtaEXJB+3zqhJsTB63f7WCkvTB0kQWQ/X6xHr/8sGNNmDpdDnC+6dsAgXeUsbDwdPC9c0Z7jCgZfmtNIhPma/2s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0602MB3435 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [RFC] Add DTB overlay handling to ptxdist X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false The only real difference here is that the symbol handling must always be present. Hence "-@" for default extra arg. Make paths variable but default to boot for the old dtb behavior. There is a lot of duplication going on here, but the main purpose is to separate dtb from dtbo handling with separate names and functions. Signed-off-by: Christian Melki diff --git a/platforms/dtc.in b/platforms/dtc.in index 5e8b35291..101d99836 100644 --- a/platforms/dtc.in +++ b/platforms/dtc.in @@ -13,10 +13,18 @@ menuconfig DTC if DTC config DTC_INSTALL_OFTREE - bool "install oftree to /boot" + bool "install oftrees to target path" help - Creates a package to install the 'oftree' file to /boot - of your target system. + Creates a package to install the 'oftree' files + to your target system. + +config DTC_INSTALL_OFTREE_OVERLAY + bool "install oftrees overlays to target path" + help + Creates a package to install the 'oftree' overlay + files to your target system. + +comment "device tree paths ---" config DTC_OFTREE_DTS_PATH string "path to source dts file" @@ -25,6 +33,15 @@ config DTC_OFTREE_DTS_PATH Define path to the dts source file. Multiple directories can be specified separated by ':'. +config DTC_OFTREE_DTO_PATH + string "path to source dto (overlay) files" + default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts" + help + Define path to the dto source files. Multiple directories can be + specified separated by ':'. + +comment "device tree sources ---" + config DTC_OFTREE_DTS string "source dts file" default ".dts" @@ -34,7 +51,43 @@ config DTC_OFTREE_DTS is used as a search path for the device tree files specified here. Multiple dts files can be specified, separated by spaces. +config DTC_OFTREE_DTO + string "source dto file" + default ".dto" + help + Select the dts/dto files to use for the device tree binary overlay + blob generation. For relative file names DTC_OFTREE_DTO_PATH + is used as a search path for the device tree overlay files specified + here. Multiple dts overlay files can be specified, separated by spaces. + +if DTC_INSTALL_OFTREE + +comment "device tree binary install path ---" + +config DTC_INSTALL_OFTREE_PATH + string "oftree installation path" + default "/boot" + help + oftree target installation path + +endif + +if DTC_INSTALL_OFTREE_OVERLAY + +comment "device tree overlay install path ---" + +config DTC_INSTALL_OFTREE_OVERLAY_PATH + string "oftree overlay installation path" + default "/lib/firmware" + help + oftree overlay target installation path + +endif + config DTC_EXTRA_ARGS string "extra options passed to dtc" + default "-@" + help + Defaults to -@ for compiling dtb/dtbo for resolving symbols. endif diff --git a/rules/dtc.make b/rules/dtc.make index 7c281e8f0..45543d3d4 100644 --- a/rules/dtc.make +++ b/rules/dtc.make @@ -26,11 +26,18 @@ $(call ptx/error, PTXCONF_KERNEL_ARCH_STRING is no longer defined.) $(call ptx/error, Use GENERIC_KERNEL_ARCH instead) endif +ifneq ($(subst PTXCONF_KERNEL_ARCH_STRING,,$(value PTXCONF_DTC_OFTREE_DTO_PATH)),$(value PTXCONF_DTC_OFTREE_DTO_PATH)) +$(call ptx/error, invalid value for PTXCONF_DTC_OFTREE_DTO_PATH:) +$(call ptx/error, PTXCONF_KERNEL_ARCH_STRING is no longer defined.) +$(call ptx/error, Use GENERIC_KERNEL_ARCH instead) +endif +o # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- ptx/dtb = $(notdir $(basename $(strip $(1)))).dtb +ptx/dtbo = $(notdir $(basename $(strip $(1)))).dtbo dts/env = \ $(call ptx/env) \ @@ -40,17 +47,31 @@ dts/env = \ dts_kernel_dir="$(KERNEL_DIR)" \ dts_kernel_arch="$(GENERIC_KERNEL_ARCH)" +dto/env = \ + $(call ptx/env) \ + dts_path=$(PTXCONF_DTC_OFTREE_DTO_PATH) \ + dts_dtb="$(strip $(1))" \ + dts_dts="$(strip $(2))" \ + dts_kernel_dir="$(KERNEL_DIR)" \ + dts_kernel_arch="$(GENERIC_KERNEL_ARCH)" + %.dtb: $(STATEDIR)/dtc.install @$(call targetinfo) @$(call dts/env, $@, $(DTB_DTS)) ptxd_make_dts_dtb @$(call finish) +%.dtbo: $(STATEDIR)/dtc.install + @$(call targetinfo) + @$(call dto/env, $@, $(DTBO_DTO)) ptxd_make_dts_dtb + @$(call finish) + DTC_DTB = $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), $(IMAGEDIR)/$(call ptx/dtb, $(dts))) +DTC_DTBO = $(foreach dto, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTO)), $(IMAGEDIR)/$(call ptx/dtbo, $(dto))) # make sure "ptxdist targetinstall kernel" generates a new device trees -$(STATEDIR)/kernel.targetinstall.post: $(DTC_DTB) +$(STATEDIR)/kernel.targetinstall.post: $(DTC_DTB) $(DTC_DTBO) -$(STATEDIR)/dtc.targetinstall: $(DTC_DTB) +$(STATEDIR)/dtc.targetinstall: $(DTC_DTB) $(DTC_DTBO) @$(call targetinfo) ifdef PTXCONF_DTC_INSTALL_OFTREE @@ -61,10 +82,16 @@ ifdef PTXCONF_DTC_INSTALL_OFTREE @$(call install_fixup, dtc, DESCRIPTION, "oftree description for machine $(PTXCONF_PLATFORM)") @$(call install_copy, dtc, 0, 0, 0755, /boot); + @$(call install_copy, dtc, 0, 0, 0755, "$(PTXCONF_DTC_INSTALL_OFTREE_PATH)"); @$(foreach dtb, $(DTC_DTB), \ $(call install_copy, dtc, 0, 0, 0644, \ - "$(dtb)", "/boot/$(notdir $(dtb))")$(ptx/nl)) - + "$(dtb)", "$(PTXCONF_DTC_INSTALL_OFTREE_PATH)/$(notdir $(dtb))")$(ptx/nl)) +ifdef PTXCONF_DTC_INSTALL_OFTREE_OVERLAY + @$(call install_copy, dtc, 0, 0, 0755, "$(PTXCONF_DTC_INSTALL_OFTREE_OVERLAY_PATH)"); + @$(foreach dtbo, $(DTC_DTBO), \ + $(call install_copy, dtc, 0, 0, 0644, \ + "$(dtbo)", "$(PTXCONF_DTC_INSTALL_OFTREE_OVERLAY_PATH)/$(notdir $(dtbo))")$(ptx/nl)) +endif @$(call install_finish, dtc) endif @$(call touch) diff --git a/rules/post/dts.make b/rules/post/dts.make index ffa8bf2fc..4bb1856ff 100644 --- a/rules/post/dts.make +++ b/rules/post/dts.make @@ -8,8 +8,12 @@ # # defined in post/ to make sure PTXCONF_DTC_OFTREE_DTS is fully defined +# defined in post/ to make sure PTXCONF_DTC_OFTREE_DTO is fully defined # $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \ $(eval $(IMAGEDIR)/$(call ptx/dtb, $(dts)): DTB_DTS=$(dts))) +$(foreach dto, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTO)), \ + $(eval $(IMAGEDIR)/$(call ptx/dtbo, $(dto)): DTBO_DTO=$(dto))) + # vim: syntax=make -- 2.31.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de