From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 10 Dec 2021 14:09:41 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvfef-00259G-47 for lore@lore.pengutronix.de; Fri, 10 Dec 2021 14:09:41 +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 1mvfed-0008Ok-SP; Fri, 10 Dec 2021 14:09:39 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvfcW-0005ds-N9; Fri, 10 Dec 2021 14:07:28 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1mvfcW-003mPH-LW; Fri, 10 Dec 2021 14:07:27 +0100 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1mvfcU-00GNcF-Qh; Fri, 10 Dec 2021 14:07:26 +0100 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 10 Dec 2021 14:07:26 +0100 Message-Id: <20211210130726.3903960-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211209110258.3307503-2-michael.riesch@wolfvision.net> References: <20211209110258.3307503-2-michael.riesch@wolfvision.net> MIME-Version: 1.0 Subject: Re: [ptxdist] [APPLIED] 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: 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 Thanks, applied as 2fafa7c4308db8d1e79dc3b5d2c9cb3400a16ff8. Michael [sent from post-receive hook] On Fri, 10 Dec 2021 14:07:26 +0100, Michael Riesch wrote: > Make ptxd_make_dtb more general and provide suitable wrappers to > support the generation of device tree overlays. > > Signed-off-by: Michael Riesch > Message-Id: <20211209110258.3307503-2-michael.riesch@wolfvision.net> > Signed-off-by: Michael Olbrich > > diff --git a/rules/post/ptxd_make_world_dtbo.make b/rules/post/ptxd_make_world_dtbo.make > new file mode 100644 > index 000000000000..61babc653660 > --- /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 f5e796b9d13d..f78d2f885114 100644 > --- a/scripts/lib/ptxd_make_world_dtb.sh > +++ b/scripts/lib/ptxd_make_world_dtb.sh > @@ -7,24 +7,22 @@ > # > > ptxd_make_dtb() { > - local dtc dts tmp_dts dtb deps tmp_deps > + local dtc dts tmp_dts dtb dtb_extra_args dtb_kernel_dir 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 > + dts="${dtb_source}" > + dtb="${dtb_target}" > > - 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})" > + dtb_kernel_dir="${pkg_kernel_src:-${pkg_dir}}" > > - dtc="${pkg_build_dir}/scripts/dtc/dtc" > + dtc="${dtb_kernel_dir}/scripts/dtc/dtc" > if [ ! -x "${dtc}" ]; then > dtc=dtc > fi > > + if [ "$(ptxd_get_ptxconf PTXCONF_KERNEL_DTS_SUPPORT_OVERLAYS)" == "y" ]; then > + dtb_extra_args="-@" > + fi > + > tmp_dts="${ptx_state_dir}/${pkg_label}.$(basename "${dts}").tmp" > > deps="${ptx_state_dir}/${pkg_label}.$(basename "${dts}").deps" > @@ -39,16 +37,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 +55,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 +79,54 @@ ptxd_make_dtb() { > export -f ptxd_make_dtb > > > +ptxd_make_world_dtbo() { > + local dtb_deps_target dtb_source dtb_target > + > + ptxd_make_world_init || break > + > + dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" > + > + 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_source dtb_target > > ptxd_make_world_init || break > > dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" > - dtb_dir="${pkg_pkg_dir}/boot" > > - echo -e "\nBuilding Device trees..." > + echo -e "\nBuilding device trees..." > > for dts_dts in ${pkg_dts}; do > + 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 > + dtb_source="${ptxd_reply}" > + dtb_target="${pkg_pkg_dir}/boot/$(basename ${dts_dts/%.dts/.dtb})" > + > ptxd_make_dtb || break > done > } _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de