summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-experimental
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2023-06-21 17:26:00 -0500
committerMark Hatle <mark.hatle@amd.com>2023-06-22 10:49:59 -0500
commit79a27b96380290ce42a101ec046f8b227f2e7a07 (patch)
tree85c5f5c6ae413303c08aece6e51ce2674e630039 /meta-xilinx-standalone-experimental
parentf9640a931ad9502e000e3b931a2b2b2403076a5e (diff)
downloadmeta-xilinx-79a27b96380290ce42a101ec046f8b227f2e7a07.tar.gz
dt-processor.sh: All dts_path to be relative or absolute
When the dts_path is relative, it's relative from <build>/conf/dts Note, using an absolute path may affect some recipe hashes, preventing sstate-cache re-use by other users. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-standalone-experimental')
-rwxr-xr-xmeta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh70
1 files changed, 41 insertions, 29 deletions
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 376785f3..9a76ad97 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,7 +40,7 @@ $0
40 [-o <overlay_dts>] Generate overlay dts 40 [-o <overlay_dts>] Generate overlay dts
41 [-e <external_fpga>] Apply a partial overlay 41 [-e <external_fpga>] Apply a partial overlay
42 [-m <machine_conf>] The name of the machine .conf to generate 42 [-m <machine_conf>] The name of the machine .conf to generate
43 [-D <dts_name>] Directory to place DTS files in (usually auto detected from DTS) 43 [-D <dts_path>] Absolute path or subdirectory of conf/dts to place DTS files in (usually auto detected from DTS)
44 [-t <machine>] Machine type: zynqmp or versal (usually auto detected) 44 [-t <machine>] Machine type: zynqmp or versal (usually auto detected)
45 [-v <soc_variant>] SOC Variant: cg, dr, eg, ev, ai-prime, premium (usually auto detected) 45 [-v <soc_variant>] SOC Variant: cg, dr, eg, ev, ai-prime, premium (usually auto detected)
46 [-r <require_machine>] This machine will be required, instead of the generic machine if defined 46 [-r <require_machine>] This machine will be required, instead of the generic machine if defined
@@ -66,7 +66,7 @@ parse_args() {
66 d) domain_file=$OPTARG ;; 66 d) domain_file=$OPTARG ;;
67 e) external_fpga=$OPTARG ;; 67 e) external_fpga=$OPTARG ;;
68 m) mach_conf=$OPTARG ; mach_conf=${mach_conf%%.conf} ;; 68 m) mach_conf=$OPTARG ; mach_conf=${mach_conf%%.conf} ;;
69 D) dts_name=$OPTARG ;; 69 D) dts_path=$OPTARG ;;
70 t) machine=$OPTARG ;; 70 t) machine=$OPTARG ;;
71 v) soc_variant=$OPTARG ;; 71 v) soc_variant=$OPTARG ;;
72 r) incmachine=$OPTARG ;; 72 r) incmachine=$OPTARG ;;
@@ -210,7 +210,7 @@ cortex_a53_linux() {
210 210
211 # Check if it is overlay dts otherwise just create linux dts 211 # Check if it is overlay dts otherwise just create linux dts
212 ( 212 (
213 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 213 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
214 if [ "${overlay_dts}" = "true" ]; then 214 if [ "${overlay_dts}" = "true" ]; then
215 if [ "${external_fpga}" = "true" ]; then 215 if [ "${external_fpga}" = "true" ]; then
216 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt ${machine} full \ 216 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt ${machine} full \
@@ -243,7 +243,7 @@ cortex_a53_linux() {
243 243
244 ## Generate a multiconfig 244 ## Generate a multiconfig
245 cat <<EOF >"${conf_file}" 245 cat <<EOF >"${conf_file}"
246CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 246CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
247 247
248TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" 248TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}"
249EOF 249EOF
@@ -279,7 +279,7 @@ cortex_a53_baremetal() {
279 279
280 # Build device tree 280 # Build device tree
281 ( 281 (
282 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 282 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
283 if [ -n "${domain_file}" ]; then 283 if [ -n "${domain_file}" ]; then
284 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ 284 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \
285 -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \ 285 -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \
@@ -320,7 +320,7 @@ EOF
320 cat /dev/null >"${conf_file}" 320 cat /dev/null >"${conf_file}"
321 fi 321 fi
322 cat <<EOF >>"${conf_file}" 322 cat <<EOF >>"${conf_file}"
323CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 323CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
324 324
325ESW_MACHINE = "$3" 325ESW_MACHINE = "$3"
326DEFAULTTUNE = "cortexa53" 326DEFAULTTUNE = "cortexa53"
@@ -346,7 +346,7 @@ cortex_a53_freertos() {
346 346
347 # Build device tree 347 # Build device tree
348 ( 348 (
349 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 349 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
350 if [ -n "${domain_file}" ]; then 350 if [ -n "${domain_file}" ]; then
351 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ 351 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \
352 -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \ 352 -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dts}" "${dts_file}" \
@@ -372,7 +372,7 @@ cortex_a53_freertos() {
372 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 372 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
373 373
374 cat <<EOF >"${conf_file}" 374 cat <<EOF >"${conf_file}"
375CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 375CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
376 376
377ESW_MACHINE = "$3" 377ESW_MACHINE = "$3"
378DEFAULTTUNE = "cortexa53" 378DEFAULTTUNE = "cortexa53"
@@ -407,7 +407,7 @@ cortex_a72_linux() {
407 fi 407 fi
408 408
409 ( 409 (
410 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 410 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
411 # Check if it is overlay dts otherwise just create linux dts 411 # Check if it is overlay dts otherwise just create linux dts
412 if [ "${overlay_dts}" = "true" ]; then 412 if [ "${overlay_dts}" = "true" ]; then
413 # As there is no partial support on Versal, As per fpga manager implementation there is 413 # As there is no partial support on Versal, As per fpga manager implementation there is
@@ -443,7 +443,7 @@ cortex_a72_linux() {
443 443
444 ## Generate a multiconfig 444 ## Generate a multiconfig
445 cat <<EOF >"${conf_file}" 445 cat <<EOF >"${conf_file}"
446CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 446CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
447 447
448TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" 448TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}"
449EOF 449EOF
@@ -464,7 +464,7 @@ cortex_a72_baremetal() {
464 464
465 # Build device tree 465 # Build device tree
466 ( 466 (
467 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 467 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
468 if [ -n "${domain_file}" ]; then 468 if [ -n "${domain_file}" ]; then
469 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ 469 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \
470 -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \ 470 -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \
@@ -490,7 +490,7 @@ cortex_a72_baremetal() {
490 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 490 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
491 491
492 cat <<EOF >"${conf_file}" 492 cat <<EOF >"${conf_file}"
493CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 493CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
494 494
495ESW_MACHINE = "$3" 495ESW_MACHINE = "$3"
496DEFAULTTUNE = "cortexa72" 496DEFAULTTUNE = "cortexa72"
@@ -516,7 +516,7 @@ cortex_a72_freertos() {
516 516
517 # Build device tree 517 # Build device tree
518 ( 518 (
519 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 519 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
520 if [ -n "${domain_file}" ]; then 520 if [ -n "${domain_file}" ]; then
521 LOPPER_DTC_FLAGS="-b 0 -@" lopper -f --enhanced -x '*.yaml' \ 521 LOPPER_DTC_FLAGS="-b 0 -@" lopper -f --enhanced -x '*.yaml' \
522 -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \ 522 -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dts}" "${dts_file}" \
@@ -542,7 +542,7 @@ cortex_a72_freertos() {
542 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 542 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
543 543
544 cat <<EOF >"${conf_file}" 544 cat <<EOF >"${conf_file}"
545CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 545CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
546 546
547ESW_MACHINE = "$3" 547ESW_MACHINE = "$3"
548DEFAULTTUNE = "cortexa72" 548DEFAULTTUNE = "cortexa72"
@@ -583,7 +583,7 @@ cortex_r5_baremetal() {
583 583
584 # Build device tree 584 # Build device tree
585 ( 585 (
586 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 586 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
587 if [ -n "$domain_file" ]; then 587 if [ -n "$domain_file" ]; then
588 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ 588 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \
589 -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \ 589 -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \
@@ -623,7 +623,7 @@ EOF
623 cat /dev/null >"${conf_file}" 623 cat /dev/null >"${conf_file}"
624 fi 624 fi
625 cat <<EOF >>"${conf_file}" 625 cat <<EOF >>"${conf_file}"
626CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 626CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
627 627
628ESW_MACHINE = "$3" 628ESW_MACHINE = "$3"
629DEFAULTTUNE = "cortexr5" 629DEFAULTTUNE = "cortexr5"
@@ -649,7 +649,7 @@ cortex_r5_freertos() {
649 649
650 # Build device tree 650 # Build device tree
651 ( 651 (
652 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 652 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
653 if [ -n "$domain_file" ]; then 653 if [ -n "$domain_file" ]; then
654 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ 654 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \
655 -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \ 655 -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dts}" "${dts_file}" \
@@ -675,7 +675,7 @@ cortex_r5_freertos() {
675 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 675 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
676 676
677 cat <<EOF >"${conf_file}" 677 cat <<EOF >"${conf_file}"
678CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 678CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
679 679
680ESW_MACHINE = "$3" 680ESW_MACHINE = "$3"
681DEFAULTTUNE = "cortexr5" 681DEFAULTTUNE = "cortexr5"
@@ -695,7 +695,7 @@ process_microblaze() {
695 695
696 mkdir -p machine/include/${mach_conf} 696 mkdir -p machine/include/${mach_conf}
697 ( 697 (
698 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 698 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
699 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-microblaze-yocto.dts" "${system_dts}" \ 699 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-microblaze-yocto.dts" "${system_dts}" \
700 || error "lopper failed" 700 || error "lopper failed"
701 rm -f lop-microblaze-yocto.dts.dtb 701 rm -f lop-microblaze-yocto.dts.dtb
@@ -725,7 +725,7 @@ pmu-microblaze() {
725 725
726 # Build device tree 726 # Build device tree
727 ( 727 (
728 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 728 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
729 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" 729 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed"
730 ) 730 )
731 731
@@ -743,7 +743,7 @@ pmu-microblaze() {
743 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 743 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
744 744
745 cat <<EOF >"${conf_file}" 745 cat <<EOF >"${conf_file}"
746CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 746CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
747 747
748ESW_MACHINE = "$1" 748ESW_MACHINE = "$1"
749 749
@@ -776,7 +776,7 @@ pmc-microblaze() {
776 776
777 # Build device tree 777 # Build device tree
778 ( 778 (
779 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 779 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
780 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" 780 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed"
781 ) 781 )
782 782
@@ -794,7 +794,7 @@ pmc-microblaze() {
794 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 794 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
795 795
796 cat <<EOF >"${conf_file}" 796 cat <<EOF >"${conf_file}"
797CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 797CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
798 798
799ESW_MACHINE = "$1" 799ESW_MACHINE = "$1"
800 800
@@ -827,7 +827,7 @@ psm-microblaze() {
827 827
828 # Build device tree 828 # Build device tree
829 ( 829 (
830 cd dts/${dts_name} || error "Unable to cd to dts/${dts_name} dir" 830 cd ${dts_path} || error "Unable to cd to ${dts_path} dir"
831 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed" 831 LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" "${dts_file}" || error "lopper failed"
832 ) 832 )
833 833
@@ -845,7 +845,7 @@ psm-microblaze() {
845 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," 845 sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES,"
846 846
847 cat <<EOF >"${conf_file}" 847 cat <<EOF >"${conf_file}"
848CONFIG_DTFILE = "\${TOPDIR}/conf/dts/${dts_name}/${dts_file}" 848CONFIG_DTFILE = "${dts_file_path}/${dts_file}"
849 849
850ESW_MACHINE = "$1" 850ESW_MACHINE = "$1"
851 851
@@ -905,7 +905,7 @@ EOF
905 cat <<EOF >>"${conf_file}" 905 cat <<EOF >>"${conf_file}"
906 906
907# Set the default (linux) domain device tree 907# Set the default (linux) domain device tree
908CONFIG_DTFILE ?= "\${TOPDIR}/conf/dts/${dts_name}/${system_conf}" 908CONFIG_DTFILE ?= "${dts_file_path}/${system_conf}"
909CONFIG_DTFILE[vardepsexclude] += "TOPDIR" 909CONFIG_DTFILE[vardepsexclude] += "TOPDIR"
910 910
911require conf/machine/${incmachine} 911require conf/machine/${incmachine}
@@ -1186,8 +1186,20 @@ if [ -z "${mach_conf}" ]; then
1186 mach_conf=${local_mach_conf} 1186 mach_conf=${local_mach_conf}
1187fi 1187fi
1188 1188
1189if [ -z "${dts_name}" ]; then 1189if [ -z "${dts_path}"]; then
1190 dts_name=${local_mach_conf} 1190 dts_path=${local_mach_conf}
1191fi
1192# Is it relative? If so, relative to conf/dts
1193if [ "${dts_path##/}" = "${dts_path}" ]; then
1194 dts_path="dts/${dts_path}"
1195else
1196 dts_path=$(realpath ${dts_path})
1197fi
1198# Convert the DTS_PATH into something we can put in a config file
1199if [ "${dts_path##/}" = "${dts_path}" ]; then
1200 dts_file_path="\${TOPDIR}/conf/${dts_path}"
1201else
1202 dts_file_path="${dts_path}"
1191fi 1203fi
1192 1204
1193# Generate CPU list 1205# Generate CPU list
@@ -1201,7 +1213,7 @@ fi
1201detect_machine 1213detect_machine
1202# Now that we know the machine name, we can create the directory 1214# Now that we know the machine name, we can create the directory
1203mkdir -p machine/include/${mach_conf} 1215mkdir -p machine/include/${mach_conf}
1204mkdir -p dts/${dts_name} 1216mkdir -p ${dts_path}
1205 1217
1206echo "System Configuration:" 1218echo "System Configuration:"
1207echo "MODEL = \"${model}\"" 1219echo "MODEL = \"${model}\""