diff options
author | Michal Orzel | 2022-09-13 14:09:18 +0200 |
---|---|---|
committer | Stefano Stabellini | 2022-12-09 15:13:42 -0800 |
commit | 232aa4cf51234218c3bb9b01e2b874513677daa8 (patch) | |
tree | c018b7ce4e1df643c16f1fe601e38e68b56ac066 /scripts/uboot-script-gen | |
parent | b75192cb1bb8e5fcc384fa060f4c3c389f3bd561 (diff) |
Add support for lopper to generate partial dts
Currently ImageBuilder can compile and merge partial dts obtained from
a repository specified using PASSTHROUGH_DTS_REPO. With the recent
changes done in the lopper, we can use it to generate partial dts
automatically (to some extent as this is still an early support).
Introduce LOPPER_PATH option to specify a path to a lopper.py script,
the main script in the Lopper repository, that if set, will invoke lopper
to generate partial dts for the passthrough devices specified in
DOMU_PASSTHROUGH_PATHS.
Introduce LOPPER_CMD option to specify custom command line arguments
(if needed) for lopper's extract assist.
Example usage:
LOPPER_PATH="/home/user/lopper/lopper.py"
DOMU_PASSTHROUGH_PATHS[0]="/axi/spi@ff0f0000 /axi/serial@ff010000"
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts/uboot-script-gen')
-rwxr-xr-x | scripts/uboot-script-gen | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 02f3309..a5b4972 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -1135,10 +1135,28 @@ fi # tftp or move the files to a partition cd "$uboot_dir" -if test "$PASSTHROUGH_DTS_REPO" +# If both PASSTHROUGH_DTS_REPO and LOPPER_PATH options are specified, +# the former takes precedence because the partial device trees are already +# created (probably tested), hence the reliability is higher than using lopper. +if test "$PASSTHROUGH_DTS_REPO" || test "$LOPPER_PATH" then output_dir=`mktemp -d "partial-dtbs-XXX"` - compile_merge_partial_dts $output_dir "$PASSTHROUGH_DTS_REPO" + if test "$PASSTHROUGH_DTS_REPO" + then + compile_merge_partial_dts $output_dir "$PASSTHROUGH_DTS_REPO" + else + if test -z "$LOPPER_CMD" + then + # Default for ZynqMP MPSoC. + # The following command instructs lopper's extract assist to always + # include zynqmp-firmware node (as it contains e.g. clock-controller + # required by most of the devices) in the extracted tree structure + # and to drop nodes/properties during the extraction process that + # are not needed. + LOPPER_CMD="-i zynqmp-firmware -x interrupt-controller -x pinctrl -x power-domains -x resets -x current-speed" + fi + compile_merge_partial_dts $output_dir + fi if test $? -ne 0 then # Remove the output dir holding the partial dtbs in case of any error |