From 10c209172ae6ff91293ac1aeee706e9eb5c52e48 Mon Sep 17 00:00:00 2001 From: Varalaxmi Bingi Date: Wed, 27 Apr 2022 17:33:55 +0530 Subject: dt-processor.sh: adding pdi_path argument (-i) Expecting the pdi also in the system device tree path. This patch will add teh PDI_PATH variable in versal case. if pdi not present in sdt path it will throw warning. if more then one pdi is present, throw a warning. Signed-off-by: Varalaxmi Bingi Also fix -p and -h usage. Signed-off-by: Mark Hatle --- .../recipes-core/meta/files/dt-processor.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'meta-xilinx-standalone-experimental') diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh index 2dc48b75..36a81cc7 100755 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh +++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh @@ -40,6 +40,7 @@ $0 [-e ] Apply a partial overlay [-m ] zynqmp or versal [-p ] Path to psu_init files, defaults to system_dtb path + [-i ] Path to the pdi file [-l ] write local.conf changes to this file [-P ] Path to petalinux schema file @@ -50,7 +51,7 @@ EOF parse_args() { [ $# -eq 0 ] && usage - while getopts ":c:s:d:o:e:m:l:h:P:" opt; do + while getopts ":c:s:d:o:e:m:l:hP:p:i:" opt; do case ${opt} in c) config_dir=$OPTARG ;; s) system_dtb=$OPTARG ;; @@ -59,11 +60,12 @@ parse_args() { e) external_fpga=$OPTARG ;; m) machine=$OPTARG ;; p) psu_init_path=$OPTARG ;; + i) pdi_path=$OPTARG ;; l) localconf=$OPTARG ;; P) petalinux_schema=$OPTARG ;; h) usage ;; :) error "Missing argument for -$OPTARG" ;; - \?) error "Invalid option -$OPTARG" + \?) error "Invalid option -$OPTARG" ;; esac done @@ -72,6 +74,9 @@ parse_args() { if [ -z "$psu_init_path" ]; then psu_init_path=$(dirname ${system_dtb}) fi + if [ -z "$pdi_path" ]; then + pdi_path=$(dirname ${system_dtb}) + fi } detect_machine() { @@ -297,6 +302,15 @@ EOF cortex_a72_linux() { info "cortex-a72 for Linux [ $1 ]" + # Find the first file ending in .pdi + full_pdi_path=$(ls ${pdi_path}/*.pdi 2>/dev/null | head -n 1) + if [ -z "${full_pdi_path}" ]; then + warn "Warning: Unable to find a pdi file in ${pdi_path}" + full_pdi_path="__PATH TO PDI FILE HERE__" + elif [ "${full_pdi_path}" != "$(ls ${pdi_path}/*.pdi 2>/dev/null)" ]; then + warn "Warning: multiple PDI files found, using first found $(basename ${full_pdi_path})." + fi + if [ "$1" = "None" ]; then dtb_file="cortexa72-${machine}-linux.dtb" system_conf=conf/cortexa72-${machine}-linux.conf @@ -922,7 +936,7 @@ gen_local_conf() { echo "PSM_MCDEPENDS = \"${psm_mcdepends}\"" >> $1 echo "PSM_FIRMWARE_DEPLOY_DIR = \"${psm_firmware_deploy_dir}\"" >> $1 fi - [ "${machine}" = "versal" ] && echo "PDI_PATH = \"__PATH TO PDI FILE HERE__\"" >> $1 + [ "${machine}" = "versal" ] && echo "PDI_PATH = \"${full_pdi_path}\"" >> $1 echo } -- cgit v1.2.3-54-g00ecf