diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2023-02-06 10:42:22 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-02-09 07:01:01 -0800 |
| commit | 6f6e6d96c99f4014bed996d78f4e83e52f4b5e47 (patch) | |
| tree | 1cf6306804932daa492e3135ff3b1342be23070e /meta-xilinx-standalone-experimental | |
| parent | 23769a4c390941a12b959eb1da0e124a1f3b06b7 (diff) | |
| download | meta-xilinx-6f6e6d96c99f4014bed996d78f4e83e52f4b5e47.tar.gz | |
dt-processor.sh: Add support for SOC_VARIANT
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-standalone-experimental')
| -rwxr-xr-x | meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh | 85 |
1 files changed, 74 insertions, 11 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 b4140345..359d8d10 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 | |||
| 40 | [-e <external_fpga>] Apply a partial overlay | 40 | [-e <external_fpga>] Apply a partial overlay |
| 41 | [-m <machine_conf>] The name of the machine .conf to generate | 41 | [-m <machine_conf>] The name of the machine .conf to generate |
| 42 | [-t <machine>] Machine type: zynqmp or versal (usually auto detected) | 42 | [-t <machine>] Machine type: zynqmp or versal (usually auto detected) |
| 43 | [-v <soc_variant>] SOC Variant: cg, dr, eg, ev, ai-prime, premium (usually auto detected) | ||
| 43 | [-p <psu_init_path>] Path to psu_init files, defaults to system_dts path | 44 | [-p <psu_init_path>] Path to psu_init files, defaults to system_dts path |
| 44 | [-i <pdu_path>] Path to the pdi file | 45 | [-i <pdu_path>] Path to the pdi file |
| 45 | [-l <config_file>] write local.conf changes to this file | 46 | [-l <config_file>] write local.conf changes to this file |
| @@ -53,7 +54,7 @@ parse_args() { | |||
| 53 | [ $# -eq 0 ] && usage | 54 | [ $# -eq 0 ] && usage |
| 54 | [ $1 = "--help" ] && usage | 55 | [ $1 = "--help" ] && usage |
| 55 | 56 | ||
| 56 | while getopts ":c:s:d:o:e:m:l:hP:p:i:" opt; do | 57 | while getopts ":c:s:d:o:e:m:l:hP:p:i:t:v:" opt; do |
| 57 | case ${opt} in | 58 | case ${opt} in |
| 58 | c) config_dir=$OPTARG ;; | 59 | c) config_dir=$OPTARG ;; |
| 59 | s) system_dts=$OPTARG ;; | 60 | s) system_dts=$OPTARG ;; |
| @@ -62,6 +63,7 @@ parse_args() { | |||
| 62 | e) external_fpga=$OPTARG ;; | 63 | e) external_fpga=$OPTARG ;; |
| 63 | m) mach_conf=$OPTARG ; mach_conf=${mach_conf%%.conf} ;; | 64 | m) mach_conf=$OPTARG ; mach_conf=${mach_conf%%.conf} ;; |
| 64 | t) machine=$OPTARG ;; | 65 | t) machine=$OPTARG ;; |
| 66 | v) soc_variant=$OPTARG ;; | ||
| 65 | p) psu_init_path=$OPTARG ;; | 67 | p) psu_init_path=$OPTARG ;; |
| 66 | i) pdi_path=$OPTARG ;; | 68 | i) pdi_path=$OPTARG ;; |
| 67 | l) localconf=$OPTARG ;; | 69 | l) localconf=$OPTARG ;; |
| @@ -95,15 +97,61 @@ parse_args() { | |||
| 95 | 97 | ||
| 96 | detect_machine() { | 98 | detect_machine() { |
| 97 | if [ -z "${machine}" ]; then | 99 | if [ -z "${machine}" ]; then |
| 98 | # Identify the system type first using PSM/PMC/PMU | 100 | if [ -n "${deviceid}" ]; then |
| 99 | while read -r cpu core domain cpu_name os_hint; do | 101 | case ${deviceid} in |
| 100 | case ${cpu} in | 102 | # ZynqMP variants |
| 101 | pmu-microblaze) | 103 | xczu*cg) |
| 102 | machine="zynqmp" ;; | 104 | machine="zynqmp" |
| 103 | pmc-microblaze | psm-microblaze) | 105 | soc_variant="cg" ;; |
| 104 | machine="versal" ;; | 106 | xczu*dr) |
| 107 | machine="zynqmp" | ||
| 108 | soc_variant="dr" ;; | ||
| 109 | xczu*eg) | ||
| 110 | machine="zynqmp" | ||
| 111 | soc_variant="eg" ;; | ||
| 112 | xczu*ev) | ||
| 113 | machine="zynqmp" | ||
| 114 | soc_variant="ev" ;; | ||
| 115 | # Versal variants | ||
| 116 | xcvm*) | ||
| 117 | machine="versal" | ||
| 118 | soc_variant="prime" ;; | ||
| 119 | xcvc*) | ||
| 120 | machine="versal" | ||
| 121 | soc_variant="ai-core" ;; | ||
| 122 | xcve*) | ||
| 123 | machine="versal" | ||
| 124 | soc_variant="ai-edge" ;; | ||
| 125 | xcvn*) | ||
| 126 | machine="versal" | ||
| 127 | soc_variant="net" ;; | ||
| 128 | xcvp*) | ||
| 129 | machine="versal" | ||
| 130 | soc_variant="premium" ;; | ||
| 131 | xcvh*) | ||
| 132 | machine="versal" | ||
| 133 | soc_variant="hbm" ;; | ||
| 134 | # Special Case Starter Kit SOMs | ||
| 135 | xck26) | ||
| 136 | incmachine="k26-smk.conf" | ||
| 137 | machine="zynqmp" | ||
| 138 | soc_variant="ev" ;; | ||
| 139 | xck24) | ||
| 140 | incmachine="k24-smk.conf" | ||
| 141 | machine="zynqmp" | ||
| 142 | soc_variant="eg" ;; | ||
| 105 | esac | 143 | esac |
| 106 | done <${cpulist} | 144 | else |
| 145 | # Identify the system type first using PSM/PMC/PMU | ||
| 146 | while read -r cpu core domain cpu_name os_hint; do | ||
| 147 | case ${cpu} in | ||
| 148 | pmu-microblaze) | ||
| 149 | machine="zynqmp" ;; | ||
| 150 | pmc-microblaze | psm-microblaze) | ||
| 151 | machine="versal" ;; | ||
| 152 | esac | ||
| 153 | done <${cpulist} | ||
| 154 | fi | ||
| 107 | fi | 155 | fi |
| 108 | 156 | ||
| 109 | # Machine not provided and we cannot identify.. | 157 | # Machine not provided and we cannot identify.. |
| @@ -114,6 +162,9 @@ detect_machine() { | |||
| 114 | zynqmp | versal) : ;; | 162 | zynqmp | versal) : ;; |
| 115 | *) error "Invalid machine type ${machine}; please choose zynqmp or versal" | 163 | *) error "Invalid machine type ${machine}; please choose zynqmp or versal" |
| 116 | esac | 164 | esac |
| 165 | |||
| 166 | [ -z ${soc_variant} ] && \ | ||
| 167 | warn "Unable to autodetect soc variant, use -v to specify a variant." | ||
| 117 | } | 168 | } |
| 118 | 169 | ||
| 119 | dump_cpus() { | 170 | dump_cpus() { |
| @@ -800,6 +851,16 @@ EOF | |||
| 800 | generate_machine() { | 851 | generate_machine() { |
| 801 | info "Generating machine conf file" | 852 | info "Generating machine conf file" |
| 802 | conf_file="machine/${mach_conf}.conf" | 853 | conf_file="machine/${mach_conf}.conf" |
| 854 | |||
| 855 | # Machine include file | ||
| 856 | if [ -z ${incmachine} ]; then | ||
| 857 | if [ -n ${soc_variant} ]; then | ||
| 858 | incmachine="${machine}-${soc_variant}-generic.conf" | ||
| 859 | else | ||
| 860 | incmachine="${machine}-generic.conf" | ||
| 861 | fi | ||
| 862 | fi | ||
| 863 | |||
| 803 | mkdir -p machine | 864 | mkdir -p machine |
| 804 | # Generate header | 865 | # Generate header |
| 805 | cat <<EOF >"${conf_file}" | 866 | cat <<EOF >"${conf_file}" |
| @@ -832,7 +893,7 @@ EOF | |||
| 832 | CONFIG_DTFILE ?= "\${TOPDIR}/conf/dts/${system_conf}" | 893 | CONFIG_DTFILE ?= "\${TOPDIR}/conf/dts/${system_conf}" |
| 833 | CONFIG_DTFILE[vardepsexclude] += "TOPDIR" | 894 | CONFIG_DTFILE[vardepsexclude] += "TOPDIR" |
| 834 | 895 | ||
| 835 | require conf/machine/${machine}-generic.conf | 896 | require conf/machine/${incmachine} |
| 836 | 897 | ||
| 837 | # System Device Tree does not use HDF_MACHINE | 898 | # System Device Tree does not use HDF_MACHINE |
| 838 | HDF_MACHINE = "" | 899 | HDF_MACHINE = "" |
| @@ -1109,7 +1170,7 @@ mkdir -p dts multiconfig machine/include | |||
| 1109 | /dev/null > ${cpulist} || error "lopper failed" | 1170 | /dev/null > ${cpulist} || error "lopper failed" |
| 1110 | rm -f "lop-machine-name.dts.dtb" | 1171 | rm -f "lop-machine-name.dts.dtb" |
| 1111 | ) | 1172 | ) |
| 1112 | read local_mach_conf model < ${cpulist} | 1173 | read local_mach_conf deviceid model < ${cpulist} |
| 1113 | if [ -z "${mach_conf}" ]; then | 1174 | if [ -z "${mach_conf}" ]; then |
| 1114 | mach_conf=${local_mach_conf} | 1175 | mach_conf=${local_mach_conf} |
| 1115 | fi | 1176 | fi |
| @@ -1129,7 +1190,9 @@ mkdir -p machine/include/${mach_conf} | |||
| 1129 | echo "System Configuration:" | 1190 | echo "System Configuration:" |
| 1130 | echo "MODEL = \"${model}\"" | 1191 | echo "MODEL = \"${model}\"" |
| 1131 | echo "MACHINE = \"${mach_conf}\"" | 1192 | echo "MACHINE = \"${mach_conf}\"" |
| 1193 | echo "DEVICE_ID = \"${deviceid}\"" | ||
| 1132 | echo "SOC_FAMILY = \"${machine}\"" | 1194 | echo "SOC_FAMILY = \"${machine}\"" |
| 1195 | echo "SOC_VARIANT = \"${soc_variant}\"" | ||
| 1133 | echo "CPUs:" | 1196 | echo "CPUs:" |
| 1134 | dump_cpus " = " | 1197 | dump_cpus " = " |
| 1135 | echo | 1198 | echo |
