From 83d783a3d6e61a0c6b08f659bd076b23661ef0a1 Mon Sep 17 00:00:00 2001 From: Sandeep Gundlupet Raju Date: Thu, 20 Apr 2023 21:14:06 -0600 Subject: dt-processor: Fix dts generated files structure 1. Add AMD Copyright notice. 2. Fix pdi_path typo in usage. 3. If dt-processor is run with two different zynqmp/versal sdt dts then -linux.dts and multiconfig dts were overwritten. Generate dts files in build/conf/dts// directory instead of build/conf/dts. This way when user use same build directory for building different machine target it will avoid overwriting dts files. Signed-off-by: Sandeep Gundlupet Raju Signed-off-by: Mark Hatle --- .../recipes-core/meta/files/dt-processor.sh | 56 +++++++++++----------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'meta-xilinx-standalone-experimental/recipes-core') 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 939fabe4..2e457ac3 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 @@ -1,6 +1,7 @@ #! /bin/bash -# Copyright (c) 2021 Xilinx Inc +# Copyright (c) 2021-2022 Xilinx Inc +# Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -42,7 +43,7 @@ $0 [-t ] Machine type: zynqmp or versal (usually auto detected) [-v ] SOC Variant: cg, dr, eg, ev, ai-prime, premium (usually auto detected) [-p ] Path to psu_init files, defaults to system_dts path - [-i ] Path to the pdi file + [-i ] Path to the pdi file [-l ] write local.conf changes to this file [-P ] Path to petalinux schema file @@ -199,7 +200,7 @@ cortex_a53_linux() { # Check if it is overlay dts otherwise just create linux dts ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ "${overlay_dts}" = "true" ]; then if [ "${external_fpga}" = "true" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt ${machine} full \ @@ -232,7 +233,7 @@ cortex_a53_linux() { ## Generate a multiconfig cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" EOF @@ -268,7 +269,7 @@ cortex_a53_baremetal() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "${domain_file}" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \ @@ -309,7 +310,7 @@ EOF cat /dev/null >"${conf_file}" fi cat <>"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexa53" @@ -335,7 +336,7 @@ cortex_a53_freertos() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "${domain_file}" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \ @@ -361,7 +362,7 @@ cortex_a53_freertos() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexa53" @@ -396,10 +397,10 @@ cortex_a72_linux() { fi ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" # Check if it is overlay dts otherwise just create linux dts if [ "${overlay_dts}" = "true" ]; then - # As there is no partial support on Versal, As per fpga manager implementatin there is + # As there is no partial support on Versal, As per fpga manager implementation there is # a flag "external_fpga" which says apply overlay without loading the bit file. if [ "${external_fpga}" = "true" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt \ @@ -432,7 +433,7 @@ cortex_a72_linux() { ## Generate a multiconfig cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" EOF @@ -453,7 +454,7 @@ cortex_a72_baremetal() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "${domain_file}" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \ @@ -479,7 +480,7 @@ cortex_a72_baremetal() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexa72" @@ -505,7 +506,7 @@ cortex_a72_freertos() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "${domain_file}" ]; then LOPPER_DTC_FLAGS="-b 0 -@" lopper -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \ @@ -531,7 +532,7 @@ cortex_a72_freertos() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexa72" @@ -572,7 +573,7 @@ cortex_r5_baremetal() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "$domain_file" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \ @@ -612,7 +613,7 @@ EOF cat /dev/null >"${conf_file}" fi cat <>"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexr5" @@ -638,7 +639,7 @@ cortex_r5_freertos() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" if [ -n "$domain_file" ]; then LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \ @@ -664,7 +665,7 @@ cortex_r5_freertos() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$3" DEFAULTTUNE = "cortexr5" @@ -684,7 +685,7 @@ process_microblaze() { mkdir -p machine/include/${mach_conf} ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-microblaze-yocto.dts" "${system_dts}" \ || error "lopper failed" rm -f lop-microblaze-yocto.dts.dtb @@ -714,7 +715,7 @@ pmu-microblaze() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" ) @@ -732,7 +733,7 @@ pmu-microblaze() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$1" @@ -765,7 +766,7 @@ pmc-microblaze() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" ) @@ -783,7 +784,7 @@ pmc-microblaze() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$1" @@ -816,7 +817,7 @@ psm-microblaze() { # Build device tree ( - cd dts || error "Unable to cd to dts dir" + cd dts/${mach_conf} || error "Unable to cd to dts/${mach_conf} dir" LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" ) @@ -834,7 +835,7 @@ psm-microblaze() { sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," cat <"${conf_file}" -CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_file}" +CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${mach_conf}/${dts_file}" ESW_MACHINE = "$1" @@ -890,7 +891,7 @@ EOF cat <>"${conf_file}" # Set the default (linux) domain device tree -CONFIG_DTFILE ?= "\${TOPDIR}/conf/dts/${system_conf}" +CONFIG_DTFILE ?= "\${TOPDIR}/conf/dts/${mach_conf}/${system_conf}" CONFIG_DTFILE[vardepsexclude] += "TOPDIR" require conf/machine/${incmachine} @@ -1182,6 +1183,7 @@ fi detect_machine # Now that we know the machine name, we can create the directory mkdir -p machine/include/${mach_conf} +mkdir -p dts/${mach_conf} echo "System Configuration:" echo "MODEL = \"${model}\"" -- cgit v1.2.3-54-g00ecf