From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 07 Dec 2021 16:39:54 +0100 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 1mucZO-0001QQ-9e for lore@lore.pengutronix.de; Tue, 07 Dec 2021 16:39:54 +0100 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 1mucZN-0004gP-Rc; Tue, 07 Dec 2021 16:39:53 +0100 Received: from [40.107.8.72] (helo=EUR04-VI1-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 1mucYr-0004Vl-SW; Tue, 07 Dec 2021 16:39:22 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8PW2pso5/9VnyZcg+6M0oKNJ914w9WG/1vMl/7zIT+nJoXTYInVm38uJCkaBULlfiZVgxk8gkRtj0PTjVa4Sw9siMThnx3H5ZgvJYGc9LHT1Qicdb3x/eC52k4YM3Wi3sIIGT4zpqT/IxZ0YFic75+zMqTEw89Jaa/FuXafwMpoTTPd16KTWEU74CFFNhXoEvCE5kc+X6S5XJSfKHwZnVyhIbmsRNSrIvfL9cn12WHqC6WmUtP5hbDFkIOH31CgknSDQh5JrQGEnEscCdPmEcCQO620T8Eqnh6T3ZKo9s1PKXiCxkUDDUmAZdgC0cIKtGnJM1dwlHg58P6iLtd6Mw== 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=0i7yfioMp9e4FSCSwJ4rvfyZau2sEHRjnGDX8WB98D4=; b=Vt9Rx3K9Kpp32Nm1BoyISg2oBsWobanJOPK2CVJaMDmzFd/IMZyaLTDc3Q8blJfMIEGoMGxHamI3H/a1uDceRR7FlyQRYC45+vOIzh0PIqjKQ6jZWSc3eu1NVi5MqvHO2Wnn+j1L9faw9LYpT8JfjHHNm6V+0kNfhDHrLJhMirm71hachir13SO4/tiS9LjxFAajszxI3ziZYLhVOz6+4rzvOxT5UkquclQwo6IuHJJbkhvhionYm68V2oT0Jc4nKCZNAkyjHjexeakSUJrD1XBeqv9gAzeelJP4PMu6/JxmAk1X5Odlg3NJcdo/IJf19tOii7W1dWhxqxEhJqsl3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0i7yfioMp9e4FSCSwJ4rvfyZau2sEHRjnGDX8WB98D4=; b=CY2Lx9h9J6hD8oaJpRYJZ9KBBuLxq7jjaX6VksdxMssXCaUV//94VaQw8AjlJe9ocKvP4AXEJAQk1KtpjyvCp2K8hpHl6aZSKnfAViSo11k9V6TXBeDX1M4cvFZ1zfZ/seqgT+mtafdr5+hzq/Ha7g+mmwrPYBZtF1WwJd8iWtM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DB8PR08MB5116.eurprd08.prod.outlook.com (2603:10a6:10:e5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 15:39:19 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956%4]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 15:39:19 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Tue, 7 Dec 2021 16:39:04 +0100 Message-Id: <20211207153905.2386379-2-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211207153905.2386379-1-michael.riesch@wolfvision.net> References: <20211207153905.2386379-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0095.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::10) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 Received: from charlie.fritz.box (2a05:1141:1c9:7c00:2971:328c:3026:3149) by ZR0P278CA0095.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Tue, 7 Dec 2021 15:39:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca4c56dc-78fa-4161-87a7-08d9b997bba8 X-MS-TrafficTypeDiagnostic: DB8PR08MB5116:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 10TlcRKjRKcZ2tKid3Jl8e7bDjAPA+6YwTv6uxNeEvR8zpIIsUKQgaQCjWpjMOd3R0g+rr0OU4IACjPxn6ZfIknWDC0ATWJXK9T99utRwD81Pe4F+MWeehR4N6+hMMGWyiA/dpQ+0iTUkurP77ywpcld5l5w8TD6NFf9HIwDnAqrHlwb9VwkWWO619358nQF8ZQiJYGT1MPwOUSGn0dt0A4f4YzPOL6qcY2fp5HrAykN1jR+Kb8zh3VmIg8kUnzojixSq6SfRfQOHYMTMy7P4WlLVWcW5oR8mlc1L9XZqR2rsnP2PEb9biotqxuedKciab40yfWKY4KZvBX4l3OAEG/dDwvFXD87o5P9WRJiElt1zx77qTybkrWiAt0zjI6vXlHhD2iRRjdaxEPstI6cwl6cHaAeBkbk7dfFmzD2YNA10RxoV0RkWiNEMDPg3mAiZuafOt2ekRxeulwZu7xE6kGACQ7g+OGoiYH00qlnHuZh69Se90mF9qsVtjogwrjJnoM6/siTc+mdBOyQ8gpTj1QKFqTc6DOjCoSBlRdqE/Ij1koJKDgH4F4ksd5dcC4GA+dVdNnVz7nyO2f30Blfzu4OyymW3ceTtr3MyzvcNPrlvrk5NTz0d/qBQTCeCWh6GOO1iLEZ6e3FSDf7pu+QWA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39850400004)(396003)(366004)(376002)(136003)(8676002)(6916009)(66476007)(36756003)(66946007)(2616005)(66556008)(5660300002)(6666004)(86362001)(52116002)(6506007)(508600001)(44832011)(316002)(2906002)(107886003)(38100700002)(4326008)(6512007)(6486002)(186003)(1076003)(83380400001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mufn6cOEYzRoqBXk4ZZkz0NMFI67dvCeU7WrD+omOLZKp6L+5I9dfmu/o1bd?= =?us-ascii?Q?6/HMWzdZIB349KpD5o9DszdDrAer7FWpe6A6DMdaV7T9MYOX/QKRdjUI+2uq?= =?us-ascii?Q?8ef2/EOflECRvlo18BCg9lTreUaep29wU7yi90qzwOE5XOiZ6rWRGmVJm/Tl?= =?us-ascii?Q?0HO23ZDSV9vN3Q9akzzt+SVvgn4PxQyX0PbGWmkoZDQYtTv8v75FpQfV0GKj?= =?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Aa1ff+VYlBXYPYxIEoNkh2Q8BNJI?= =?us-ascii?Q?yCo9OiP0h9FGoDsv5CdoEDaNKgDGhCJzSy8P3epL5WIRkAaUIOiD+U9W3cUF?= =?us-ascii?Q?tkmXsXV6B1YdWut/msIM3sU4Kf9EqKJHchc6bSLz7ZUOC3vLXuitfw7gbuoz?= =?us-ascii?Q?+ykzKKfUQ1HwdXqvqb8jFKsfqAneP5S+s4fYCgk29Co+c1t008r8qHl4qBWL?= =?us-ascii?Q?t9Bd2TSAx1kqiN5CHKdo0f4dWKF1rhvPxqjfb9VZWsmEGHfVGd5MTrPkYDfJ?= =?us-ascii?Q?d214m580yIg/k2dpqWRLWz3gmM8O8jaNUpCNW1NkhpRhXWUTCNf9rqxJEydp?= =?us-ascii?Q?F+E74OsYO9SArPOk3Dn31KshdmEdoDAf6jDMOUvdpJHRxKvN8mNnDLjLGu/a?= =?us-ascii?Q?rlTkSqHKuEYa4kwvCnf4lNS2asyXmVxq3RgSrlEmY8KlhMdjXihckwxVvFM6?= =?us-ascii?Q?rwvVr9ya+X+YTMkVXMDeXshPw8gzH7ETybicJc0r05uDaFXa4qHFGvEdNGH6?= =?us-ascii?Q?6g3m/XO/xGq1XUiPPbPg8yLEhYVOxPP8V6rINomlDWJJG+OJZwUHLsIi12vJ?= =?us-ascii?Q?9R/w+lfVETqeQVWDfOk4hw04knl9fnuP8zYnGkpr9yFT2TYmITXHXpK4tGvZ?= =?us-ascii?Q?BbIn9ZTtMg=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: ca4c56dc-78fa-4161-87a7-08d9b997bba8 X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 15:39:19.0179 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 88vEsbHOJmCDFtHFDE0VKiRxjNLJw0PMU3kV3378IONNUYcvceF8FSzmGPg/HmbEoU8AvVsRdQsYxJeGtYvH2JMKJZx8LYIzljIf/af62lA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5116 X-Host-Lookup-Failed: Reverse DNS lookup failed for 40.107.8.72 (deferred) 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.8 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MSGID_FROM_MTA_HEADER, PDS_HP_HELO_NORDNS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_PASS,T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH 1/2] ptxd_make_world_{dtb, dtbo}: add support for device tree overlays 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 Cc: christian.melki@t2data.com, m.tretter@pengutronix.de, Michael Riesch 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 Make ptxd_make_dtb more general and provide suitable wrappers to support the generation of device tree overlays. Signed-off-by: Michael Riesch --- rules/post/ptxd_make_world_dtbo.make | 21 +++++++ scripts/lib/ptxd_make_world_dtb.sh | 82 ++++++++++++++++++++-------- 2 files changed, 80 insertions(+), 23 deletions(-) create mode 100644 rules/post/ptxd_make_world_dtbo.make diff --git a/rules/post/ptxd_make_world_dtbo.make b/rules/post/ptxd_make_world_dtbo.make new file mode 100644 index 000000000..61babc653 --- /dev/null +++ b/rules/post/ptxd_make_world_dtbo.make @@ -0,0 +1,21 @@ +# -*-makefile-*- +# +# Copyright (C) 2020 by Michael Tretter +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +world/dtbo/env = \ + $(call world/env, $(1)) \ + pkg_dtso_path="$($(1)_DTSO_PATH)" \ + pkg_dtso="$($(1)_DTSO)" \ + pkg_dtbo_dir="$($(1)_DTBO_DIR)" \ + pkg_kernel_src="$($(1)_KERNEL_DIR)" \ + pkg_arch="$(GENERIC_KERNEL_ARCH)" + +world/dtbo = \ + $(call world/dtbo/env,$(strip $(1))) \ + ptxd_make_world_dtbo + +# vim: syntax=make diff --git a/scripts/lib/ptxd_make_world_dtb.sh b/scripts/lib/ptxd_make_world_dtb.sh index f5e796b9d..c1ded5ffb 100644 --- a/scripts/lib/ptxd_make_world_dtb.sh +++ b/scripts/lib/ptxd_make_world_dtb.sh @@ -9,18 +9,10 @@ ptxd_make_dtb() { local dtc dts tmp_dts dtb deps tmp_deps - if [[ "${dts_dts}" =~ ^/.* ]]; then - ptxd_bailout "'${dts_dts}' must not be an absolute path!" \ - "Use _DTS_PATH to specify the search path." - fi - - if ! ptxd_in_path pkg_dts_path "${dts_dts}"; then - ptxd_bailout "Device-tree '${dts_dts}' not found in '${pkg_dts_path}'." - fi - dts="${ptxd_reply}" - dtb="${dtb_dir}/$(basename ${dts/%.dts/.dtb})" + dts="${dtb_source}" + dtb="${dtb_target}" - dtc="${pkg_build_dir}/scripts/dtc/dtc" + dtc="${dtb_kernel_dir}/scripts/dtc/dtc" if [ ! -x "${dtc}" ]; then dtc=dtc fi @@ -39,16 +31,16 @@ ptxd_make_dtb() { -Wp,-MT,${dtb_deps_target} \ -nostdinc \ -I"$(dirname "${dts}")" \ - -I${pkg_dir}/arch/${pkg_arch}/boot/dts \ - -I${pkg_dir}/arch/${pkg_arch}/boot/dts/include \ - -I${pkg_dir}/scripts/dtc/include-prefixes \ - -I${pkg_dir}/drivers/of/testcase-data \ - -I${pkg_dir}/include \ + -I${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts \ + -I${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts/include \ + -I${dtb_kernel_dir}/scripts/dtc/include-prefixes \ + -I${dtb_kernel_dir}/drivers/of/testcase-data \ + -I${dtb_kernel_dir}/include \ -undef -D__DTS__ -x assembler-with-cpp \ -o ${tmp_dts} \ ${dts} && - sed -e "\;^ ${pkg_dir}[^ ]*;d" \ + sed -e "\;^ ${dtb_kernel_dir}[^ ]*;d" \ -e 's;^ \([^ \]*\); $(wildcard \1);' "${tmp_deps}" > "${deps}" && # empty line in case all dependencies were removed echo >> "${deps}" && @@ -57,9 +49,9 @@ ptxd_make_dtb() { echo "DTC $(ptxd_print_path "${dtb}")" && ptxd_eval \ "${dtc}" \ - $(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS) \ + "${dtb_extra_args}" \ -i "$(dirname "${dts}")" \ - -i "${pkg_dir}/arch/${pkg_arch}/boot/dts" \ + -i "${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts" \ -d "${tmp_deps}" \ -I dts -O dtb -b 0 \ -o "${dtb}" "${tmp_dts}" && @@ -81,17 +73,61 @@ ptxd_make_dtb() { export -f ptxd_make_dtb +ptxd_make_world_dtbo() { + local dtb_deps_target dtb_extra_args dtb_kernel_dir dtb_source dtb_target + + ptxd_make_world_init || break + + dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" + dtb_extra_args="-@" + dtb_kernel_dir="${pkg_kernel_src}" + if [ -z $dtb_kernel_dir ]; then + dtb_kernel_dir="${pkg_dir}" + fi + + echo -e "\nBuilding device tree overlays..." + + for overlay in ${pkg_dtso}; do + if [[ "${overlay}" =~ ^/.* ]]; then + ptxd_bailout "'${overlay}' must not be an absolute path!" \ + "Use _DTSO_PATH to specify the search path." + fi + + if ! ptxd_in_path pkg_dtso_path "${overlay}"; then + ptxd_bailout "Overlay '${overlay}' not found in '${pkg_dtso_path}'." + fi + dtb_source="${ptxd_reply}" + dtb_target="${pkg_pkg_dir}/${pkg_dtbo_dir}/$(basename ${overlay/%.dts*/.dtbo})" + + ptxd_make_dtb || break + done +} +export -f ptxd_make_world_dtbo + + ptxd_make_world_dtb() { - local dtb_deps_target dtb_dir + local dtb_deps_target dtb_extra_args dtb_kernel_dir dtb_source dtb_target ptxd_make_world_init || break dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" - dtb_dir="${pkg_pkg_dir}/boot" + dtb_extra_args="$(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS)" + dtb_kernel_dir="${pkg_dir}" + + echo -e "\nBuilding device trees..." + + for tree in ${pkg_dts}; do + if [[ "${tree}" =~ ^/.* ]]; then + ptxd_bailout "'${tree}' must not be an absolute path!" \ + "Use _DTS_PATH to specify the search path." + fi - echo -e "\nBuilding Device trees..." + if ! ptxd_in_path pkg_dts_path "${tree}"; then + ptxd_bailout "Overlay '${tree}' not found in '${pkg_dts_path}'." + fi + dtb_source="${ptxd_reply}" + dtb_target="${pkg_pkg_dir}/boot/$(basename ${tree/%.dts/.dtb})" - for dts_dts in ${pkg_dts}; do ptxd_make_dtb || break done } -- 2.30.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de