diff options
3 files changed, 0 insertions, 1447 deletions
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup b/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup deleted file mode 100644 index 0a5736d8..00000000 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup +++ /dev/null | |||
| @@ -1,102 +0,0 @@ | |||
| 1 | Document Version: 20230112 | ||
| 2 | |||
| 3 | The Yocto Project setup for the System Device Tree workflow is as follows. | ||
| 4 | Be sure to read everything below, as the steps will be updated in the future | ||
| 5 | if the setup script changes. | ||
| 6 | |||
| 7 | The steps in this document expect that you have already built the setup | ||
| 8 | (meta-xilinx-setup) SDK, and installed it. | ||
| 9 | |||
| 10 | * Run the setup script | ||
| 11 | |||
| 12 | The setup environment should be run in a new shell (not the build shell) | ||
| 13 | to ensure that you do not contaminate the environment for your build. | ||
| 14 | |||
| 15 | We will assume below that the directory "prestep" was used for the SDK, | ||
| 16 | however you may use any path you wish. | ||
| 17 | |||
| 18 | Source the SDK environment file | ||
| 19 | $ . <build>/prestep/environment-setup-x86_64-petalinux-linux | ||
| 20 | |||
| 21 | Run the script from the same directory as this README | ||
| 22 | $ <build>/prestep/dt-processor.sh -c <conf> -s <dtb> -l conf/local.conf | ||
| 23 | |||
| 24 | Note: The -l option will automatically add the necessary parameters to the | ||
| 25 | local.conf file. If you need to re-run this comment, you just clear the | ||
| 26 | parameters from the end of the file. Without the -l option the items are | ||
| 27 | printed to the screen and must be manually added to your conf/local.conf | ||
| 28 | |||
| 29 | For example, zynqmp: | ||
| 30 | $ ./prestep/dt-processor.sh -c conf -s /proj/yocto/zcu102-sdt/system-top.dts -l conf/local.conf | ||
| 31 | |||
| 32 | The following will be written to the end of the conf/local.conf file: | ||
| 33 | |||
| 34 | # Each multiconfig will define it's own TMPDIR, this is the new default based | ||
| 35 | # on BASE_TMPDIR for the Linux build | ||
| 36 | TMPDIR = "${BASE_TMPDIR}/tmp" | ||
| 37 | |||
| 38 | # Use the newly generated MACHINE | ||
| 39 | MACHINE = "xlnx-zynqmp-zcu102-rev1-0" | ||
| 40 | |||
| 41 | # All of the TMPDIRs must be in a common parent directory. This is defined | ||
| 42 | # as BASE_TMPDIR. | ||
| 43 | # Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere, such as /tmp | ||
| 44 | BASE_TMPDIR ?= "${TOPDIR}" | ||
| 45 | |||
| 46 | # The following is the full set of multiconfigs for this configuration | ||
| 47 | # A large list can cause a slow parse. | ||
| 48 | BBMULTICONFIG = " cortexa53-0-zynqmp-fsbl-baremetal cortexa53-0-zynqmp-baremetal cortexa53-0-zynqmp-freertos cortexa53-1-zynqmp-baremetal cortexa53-1-zynqmp-freertos cortexa53-2-zynqmp-baremetal cortexa53-2-zynqmp-freertos cortexa53-3-zynqmp-baremetal cortexa53-3-zynqmp-freertos cortexr5-0-zynqmp-fsbl-baremetal cortexr5-0-zynqmp-baremetal cortexr5-0-zynqmp-freertos cortexr5-1-zynqmp-baremetal cortexr5-1-zynqmp-freertos microblaze-0-pmu" | ||
| 49 | # Alternatively trim the list to the minimum | ||
| 50 | #BBMULTICONFIG = " cortexa53-0-zynqmp-fsbl-baremetal microblaze-0-pmu" | ||
| 51 | |||
| 52 | |||
| 53 | For example, versal: | ||
| 54 | $ ./prestep/dt-processor.sh -c conf -s /proj/yocto/vmk180-sdt/system-top.dts -l conf/local.conf | ||
| 55 | |||
| 56 | The following will be written to the end of the conf/local.conf file: | ||
| 57 | |||
| 58 | # Each multiconfig will define it's own TMPDIR, this is the new default based | ||
| 59 | # on BASE_TMPDIR for the Linux build | ||
| 60 | TMPDIR = "${BASE_TMPDIR}/tmp" | ||
| 61 | |||
| 62 | # Use the newly generated MACHINE | ||
| 63 | MACHINE = "xlnx-versal-vmk180-rev1-1-x-ebm-01-reva" | ||
| 64 | |||
| 65 | # All of the TMPDIRs must be in a common parent directory. This is defined | ||
| 66 | # as BASE_TMPDIR. | ||
| 67 | # Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere, such as /tmp | ||
| 68 | BASE_TMPDIR ?= "${TOPDIR}" | ||
| 69 | |||
| 70 | # The following is the full set of multiconfigs for this configuration | ||
| 71 | # A large list can cause a slow parse. | ||
| 72 | BBMULTICONFIG = " cortexa72-0-versal-baremetal cortexa72-0-versal-freertos cortexa72-1-versal-baremetal cortexa72-1-versal-freertos microblaze-0-pmc microblaze-0-psm cortexr5-0-versal-baremetal cortexr5-0-versal-freertos cortexr5-1-versal-baremetal cortexr5-1-versal-freertos" | ||
| 73 | # Alternatively trim the list to the minimum | ||
| 74 | #BBMULTICONFIG = " microblaze-0-pmc microblaze-0-psm" | ||
| 75 | |||
| 76 | |||
| 77 | You can now EXIT THE NEW SHELL return the build environment for the remaining steps. | ||
| 78 | |||
| 79 | * Bitbake Performance Note | ||
| 80 | |||
| 81 | Each BBMULTICONFIG value requires all of the recipes to be parsed for that | ||
| 82 | configuration. Thus each multiconfig will add more parsing time. A long list | ||
| 83 | can lead to a very slow parse (many minutes). To speed up parsing, it is | ||
| 84 | suggested that you trim this down to only the configurations you require. | ||
| 85 | A minimum configuration is included with the generated configuration. | ||
| 86 | |||
| 87 | * Build your project | ||
| 88 | |||
| 89 | You should now be able to build your project normally. See the Yocto Project | ||
| 90 | documentation if you have questions on how to work with the multiconfig | ||
| 91 | recipes. The following is a simple build for testing. | ||
| 92 | |||
| 93 | In the original build shell | ||
| 94 | Build your Linux sytem: | ||
| 95 | $ bitbake petalinux-image-minimal | ||
| 96 | |||
| 97 | The output will be in tmp/deploy/images/... | ||
| 98 | |||
| 99 | If the system is QEMU capable execute QEMU using: | ||
| 100 | $ runqemu nographic slirp core-image-minimal | ||
| 101 | |||
| 102 | To terminate qemu, usually the command is ctrl-a x | ||
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 deleted file mode 100755 index 004bf258..00000000 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh +++ /dev/null | |||
| @@ -1,1254 +0,0 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | # Copyright (c) 2021-2022 Xilinx Inc | ||
| 4 | # Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. | ||
| 5 | # | ||
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 7 | # of this software and associated documentation files (the "Software"), to deal | ||
| 8 | # in the Software without restriction, including without limitation the rights | ||
| 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 10 | # copies of the Software, and to permit persons to whom the Software is | ||
| 11 | # furnished to do so, subject to the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be included in | ||
| 14 | # all copies or substantial portions of the Software. | ||
| 15 | # | ||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | # THE SOFTWARE. | ||
| 23 | |||
| 24 | # This script configures the Yocto Project build system for use with the System | ||
| 25 | # Device Tree workflow when building for a Xilinx FPGA, such as the ZynqMP or | ||
| 26 | # Versal. | ||
| 27 | |||
| 28 | error() { echo "ERROR: $1" >&2; exit 1; } | ||
| 29 | |||
| 30 | warn() { echo "WARNING: $1"; } | ||
| 31 | |||
| 32 | info() { echo "INFO: $1"; } | ||
| 33 | |||
| 34 | usage() { | ||
| 35 | cat <<EOF | ||
| 36 | $0 | ||
| 37 | -c <config_dir> Location of the build conf directory | ||
| 38 | -s <system_dts> Path to system dts | ||
| 39 | [-d <domain_file>] Path to domain file (.yml/.dts) | ||
| 40 | [-o <overlay_dts>] Generate overlay dts | ||
| 41 | [-e <external_fpga>] Apply a partial overlay | ||
| 42 | [-m <machine_conf>] The name of the machine .conf to generate | ||
| 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) | ||
| 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 | ||
| 47 | [-O <overrides>] Optional, can add additional overrides to the generated machine | ||
| 48 | [-p <psu_init_path>] Path to psu_init files, defaults to system_dts path | ||
| 49 | [-i <pdi_path>] Path to the pdi file | ||
| 50 | [-l <config_file>] write local.conf changes to this file | ||
| 51 | [-P <petalinux_schema>] Path to petalinux schema file | ||
| 52 | |||
| 53 | EOF | ||
| 54 | exit | ||
| 55 | } | ||
| 56 | |||
| 57 | parse_args() { | ||
| 58 | [ $# -eq 0 ] && usage | ||
| 59 | [ $1 = "--help" ] && usage | ||
| 60 | |||
| 61 | while getopts ":c:s:d:o:e:m:D:l:hP:p:i:t:v:r:O:" opt; do | ||
| 62 | case ${opt} in | ||
| 63 | c) config_dir=$OPTARG ;; | ||
| 64 | s) system_dts=$OPTARG ;; | ||
| 65 | o) overlay_dts=$OPTARG ;; | ||
| 66 | d) domain_file=$OPTARG ;; | ||
| 67 | e) external_fpga=$OPTARG ;; | ||
| 68 | m) mach_conf=$OPTARG ; mach_conf=${mach_conf%%.conf} ;; | ||
| 69 | D) dts_path=$OPTARG ;; | ||
| 70 | t) machine=$OPTARG ;; | ||
| 71 | v) soc_variant=$OPTARG ;; | ||
| 72 | r) incmachine=$OPTARG ;; | ||
| 73 | O) overrides=$OPTARG ;; | ||
| 74 | p) psu_init_path=$OPTARG ;; | ||
| 75 | i) pdi_path=$OPTARG ;; | ||
| 76 | l) localconf=$OPTARG ;; | ||
| 77 | P) petalinux_schema=$OPTARG ;; | ||
| 78 | h) usage ;; | ||
| 79 | :) error "Missing argument for -$OPTARG" ;; | ||
| 80 | \?) error "Invalid option -$OPTARG" ;; | ||
| 81 | esac | ||
| 82 | done | ||
| 83 | |||
| 84 | [ -z "${config_dir}" ] && error "You must specify the path to the build conf directory with -c" | ||
| 85 | [ -z "${system_dts}" ] && error "You must specify the path to the system device tree with -s" | ||
| 86 | [ -f "${config_dir}/local.conf" ] || error "Invalid config dir: ${config_dir}" | ||
| 87 | [ -f "${system_dts}" ] || error "Unable to find: ${system_dts}" | ||
| 88 | system_dts=$(realpath ${system_dts}) | ||
| 89 | if [ -z "$psu_init_path" ]; then | ||
| 90 | psu_init_path=$(dirname ${system_dts}) | ||
| 91 | else | ||
| 92 | psu_init_path=$(realpath ${psu_init_path}) | ||
| 93 | fi | ||
| 94 | if [ -z "$pdi_path" ]; then | ||
| 95 | pdi_path=$(dirname ${system_dts}) | ||
| 96 | else | ||
| 97 | pdi_path=$(realpath ${pdi_path}) | ||
| 98 | fi | ||
| 99 | if [ -n "$domain_file" ]; then | ||
| 100 | domain_file=$(realpath ${domain_file}) | ||
| 101 | fi | ||
| 102 | |||
| 103 | } | ||
| 104 | |||
| 105 | detect_machine() { | ||
| 106 | if [ -z "${machine}" ]; then | ||
| 107 | if [ -n "${deviceid}" ]; then | ||
| 108 | case ${deviceid} in | ||
| 109 | # ZynqMP variants | ||
| 110 | xczu*cg) | ||
| 111 | machine="zynqmp" | ||
| 112 | soc_variant="cg" ;; | ||
| 113 | xczu*dr) | ||
| 114 | machine="zynqmp" | ||
| 115 | soc_variant="dr" ;; | ||
| 116 | xczu*eg) | ||
| 117 | machine="zynqmp" | ||
| 118 | soc_variant="eg" ;; | ||
| 119 | xczu*ev) | ||
| 120 | machine="zynqmp" | ||
| 121 | soc_variant="ev" ;; | ||
| 122 | # Versal variants | ||
| 123 | xcvm*) | ||
| 124 | machine="versal" | ||
| 125 | soc_variant="prime" ;; | ||
| 126 | xcvc*) | ||
| 127 | machine="versal" | ||
| 128 | soc_variant="ai-core" ;; | ||
| 129 | xcve*) | ||
| 130 | machine="versal" | ||
| 131 | soc_variant="ai-edge" ;; | ||
| 132 | xcvn*) | ||
| 133 | machine="versal" | ||
| 134 | soc_variant="net" ;; | ||
| 135 | xcvp*) | ||
| 136 | machine="versal" | ||
| 137 | soc_variant="premium" ;; | ||
| 138 | xcvh*) | ||
| 139 | machine="versal" | ||
| 140 | soc_variant="hbm" ;; | ||
| 141 | # Special Case Starter Kit SOMs | ||
| 142 | xck26) | ||
| 143 | if [ -z "${incmachine}" ]; then | ||
| 144 | incmachine="k26-smk.conf" | ||
| 145 | fi | ||
| 146 | machine="zynqmp" | ||
| 147 | soc_variant="ev" ;; | ||
| 148 | xck24) | ||
| 149 | if [ -z "${incmachine}" ]; then | ||
| 150 | incmachine="k24-smk.conf" | ||
| 151 | fi | ||
| 152 | machine="zynqmp" | ||
| 153 | soc_variant="eg" ;; | ||
| 154 | esac | ||
| 155 | else | ||
| 156 | # Identify the system type first using PSM/PMC/PMU | ||
| 157 | while read -r cpu core domain cpu_name os_hint; do | ||
| 158 | case ${cpu} in | ||
| 159 | pmu-microblaze) | ||
| 160 | machine="zynqmp" ;; | ||
| 161 | pmc-microblaze | psm-microblaze) | ||
| 162 | machine="versal" ;; | ||
| 163 | esac | ||
| 164 | done <${cpulist} | ||
| 165 | fi | ||
| 166 | fi | ||
| 167 | |||
| 168 | # Machine not provided and we cannot identify.. | ||
| 169 | [ -z ${machine} ] && \ | ||
| 170 | error "Unable to autodetect machine type, use -t to specify the machine." | ||
| 171 | |||
| 172 | case ${machine} in | ||
| 173 | zynqmp | versal) : ;; | ||
| 174 | *) error "Invalid machine type ${machine}; please choose zynqmp or versal" | ||
| 175 | esac | ||
| 176 | |||
| 177 | [ -z ${soc_variant} ] && \ | ||
| 178 | warn "Unable to autodetect soc variant, use -v to specify a variant." | ||
| 179 | } | ||
| 180 | |||
| 181 | dump_cpus() { | ||
| 182 | prefix="$1" | ||
| 183 | while read -r cpu core domain cpu_name os_hint; do | ||
| 184 | case ${cpu} in | ||
| 185 | \#*) ;; | ||
| 186 | \[*) ;; | ||
| 187 | pmu-microblaze) echo "${prefix}zynqmp-pmu ${cpu_name}" ;; | ||
| 188 | pmc-microblaze) echo "${prefix}versal-plm ${cpu_name}" ;; | ||
| 189 | psm-microblaze) echo "${prefix}versal-psm ${cpu_name}" ;; | ||
| 190 | xlnx,microblaze) echo "${prefix}microblaze ${core} ${cpu_name}";; | ||
| 191 | arm,*) echo "${prefix}${cpu/,/ } ${core} ${cpu_name}";; | ||
| 192 | *) echo "${prefix}${cpu} ${core} ${cpu_name}";; | ||
| 193 | esac | ||
| 194 | done <${cpulist} | ||
| 195 | } | ||
| 196 | |||
| 197 | cortex_a53_linux() { | ||
| 198 | info "cortex-a53 for Linux [ $1 ]" | ||
| 199 | |||
| 200 | if [ "$1" = "None" ]; then | ||
| 201 | dts_file="cortexa53-${machine}-linux.dts" | ||
| 202 | system_conf=${dts_file} | ||
| 203 | conf_file="" | ||
| 204 | else | ||
| 205 | mc_name=cortexa53-${machine}-$1-linux | ||
| 206 | dts_file="${mc_name}.dts" | ||
| 207 | multiconf="${multiconf} ${mc_name}" | ||
| 208 | conf_file=multiconfig/${mc_name}.conf | ||
| 209 | fi | ||
| 210 | |||
| 211 | # Check if it is overlay dts otherwise just create linux dts | ||
| 212 | ( | ||
| 213 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 214 | if [ "${overlay_dts}" = "true" ]; then | ||
| 215 | if [ "${external_fpga}" = "true" ]; then | ||
| 216 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt ${machine} full \ | ||
| 217 | || error "lopper failed" | ||
| 218 | else | ||
| 219 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} "${system_dts}" -- xlnx_overlay_dt ${machine} partial \ | ||
| 220 | || error "lopper failed" | ||
| 221 | fi | ||
| 222 | dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi || error "dtc failed" | ||
| 223 | elif [ -n "${domain_file}" ]; then | ||
| 224 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ | ||
| 225 | -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" \ | ||
| 226 | -i "${lops_dir}/lop-domain-linux-a53.dts" \ | ||
| 227 | -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ | ||
| 228 | "${system_dts}" "${dts_file}" \ | ||
| 229 | || error "lopper failed" | ||
| 230 | else | ||
| 231 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a53-imux.dts" \ | ||
| 232 | -i "${lops_dir}/lop-domain-linux-a53.dts" \ | ||
| 233 | -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ | ||
| 234 | "${system_dts}" "${dts_file}" \ | ||
| 235 | || error "lopper failed" | ||
| 236 | fi | ||
| 237 | rm -f pl.dtsi lop-a53-imux.dts.dtb lop-domain-linux-a53.dts.dtb lop-domain-linux-a53-prune.dts.dtb | ||
| 238 | ) | ||
| 239 | |||
| 240 | if [ -z "${conf_file}" ]; then | ||
| 241 | return $? | ||
| 242 | fi | ||
| 243 | |||
| 244 | ## Generate a multiconfig | ||
| 245 | cat <<EOF >"${conf_file}" | ||
| 246 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 247 | |||
| 248 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 249 | EOF | ||
| 250 | } | ||
| 251 | |||
| 252 | a53_fsbl_done=0 | ||
| 253 | cortex_a53_baremetal() { | ||
| 254 | if [ "$1" = "fsbl" ]; then | ||
| 255 | [ ${a53_fsbl_done} = 1 ] && return | ||
| 256 | info "cortex-a53 FSBL baremetal configuration" | ||
| 257 | else | ||
| 258 | info "cortex-a53 baremetal configuration for core $2 [ $1 ]" | ||
| 259 | fi | ||
| 260 | |||
| 261 | suffix=""; lto="-nolto" | ||
| 262 | if [ "$1" != "None" ]; then | ||
| 263 | suffix="-$1"; lto="" | ||
| 264 | fi | ||
| 265 | |||
| 266 | mc_name="cortexa53-$2-${machine}${suffix}-baremetal" | ||
| 267 | dts_file="${mc_name}.dts" | ||
| 268 | multiconf="${multiconf} ${mc_name}" | ||
| 269 | conf_file="multiconfig/${mc_name}.conf" | ||
| 270 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 271 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 272 | yocto_distro="xilinx-standalone${lto}" | ||
| 273 | if [ "$1" = "fsbl" ]; then | ||
| 274 | fsbl_mcdepends="mc::${mc_name}:fsbl-firmware:do_deploy" | ||
| 275 | fsbl_deploy_dir="\${BASE_TMPDIR}/tmp-${mc_name}/deploy/images/\${MACHINE}" | ||
| 276 | multiconf_min="${multiconf_min} ${mc_name}" | ||
| 277 | a53_fsbl_done=1 | ||
| 278 | fi | ||
| 279 | |||
| 280 | # Build device tree | ||
| 281 | ( | ||
| 282 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 283 | if [ -n "${domain_file}" ]; then | ||
| 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}" \ | ||
| 286 | || error "lopper failed" | ||
| 287 | else | ||
| 288 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a53-imux.dts" \ | ||
| 289 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 290 | fi | ||
| 291 | rm -f lop-a53-imux.dts.dtb | ||
| 292 | ) | ||
| 293 | |||
| 294 | # Build baremetal multiconfig | ||
| 295 | if [ -n "${domain_file}" ]; then | ||
| 296 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 297 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 298 | || error "lopper failed" | ||
| 299 | else | ||
| 300 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 301 | || error "lopper failed" | ||
| 302 | fi | ||
| 303 | |||
| 304 | mv libxil.conf "${libxil}" | ||
| 305 | mv distro.conf "${features}" | ||
| 306 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 307 | |||
| 308 | if [ "$1" = "fsbl" ]; then | ||
| 309 | if [ ! -e "${psu_init_path}/psu_init.c" ]; then | ||
| 310 | warn "Warning: Unable to find psu_init.c in ${psu_init_path}" | ||
| 311 | fi | ||
| 312 | if [ ! -e "${psu_init_path}/psu_init.h" ]; then | ||
| 313 | warn "Warning: Unable to find psu_init.h in ${psu_init_path}" | ||
| 314 | fi | ||
| 315 | |||
| 316 | cat <<EOF >"${conf_file}" | ||
| 317 | PSU_INIT_PATH = "${psu_init_path}" | ||
| 318 | EOF | ||
| 319 | else | ||
| 320 | cat /dev/null >"${conf_file}" | ||
| 321 | fi | ||
| 322 | cat <<EOF >>"${conf_file}" | ||
| 323 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 324 | |||
| 325 | ESW_MACHINE = "$3" | ||
| 326 | DEFAULTTUNE = "cortexa53" | ||
| 327 | |||
| 328 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 329 | |||
| 330 | DISTRO = "${yocto_distro}" | ||
| 331 | EOF | ||
| 332 | } | ||
| 333 | |||
| 334 | cortex_a53_freertos() { | ||
| 335 | info "cortex-a53 FreeRTOS configuration for core $2 [ $1 ]" | ||
| 336 | |||
| 337 | suffix="" | ||
| 338 | [ "$1" != "None" ] && suffix="-$1" | ||
| 339 | |||
| 340 | mc_name="cortexa53-$2-${machine}${suffix}-freertos" | ||
| 341 | dts_file="${mc_name}.dts" | ||
| 342 | multiconf="${multiconf} ${mc_name}" | ||
| 343 | conf_file="multiconfig/${mc_name}.conf" | ||
| 344 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 345 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 346 | |||
| 347 | # Build device tree | ||
| 348 | ( | ||
| 349 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 350 | if [ -n "${domain_file}" ]; then | ||
| 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}" \ | ||
| 353 | || error "lopper failed" | ||
| 354 | else | ||
| 355 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a53-imux.dts" \ | ||
| 356 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 357 | fi | ||
| 358 | rm -f lop-a53-imux.dts.dtb | ||
| 359 | ) | ||
| 360 | |||
| 361 | # Build baremetal multiconfig | ||
| 362 | if [ -n "${domain_file}" ]; then | ||
| 363 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 364 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" || error "lopper failed" | ||
| 365 | else | ||
| 366 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 367 | || error "lopper failed" | ||
| 368 | fi | ||
| 369 | |||
| 370 | mv libxil.conf "${libxil}" | ||
| 371 | mv distro.conf "${features}" | ||
| 372 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 373 | |||
| 374 | cat <<EOF >"${conf_file}" | ||
| 375 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 376 | |||
| 377 | ESW_MACHINE = "$3" | ||
| 378 | DEFAULTTUNE = "cortexa53" | ||
| 379 | |||
| 380 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 381 | |||
| 382 | DISTRO = "xilinx-freertos" | ||
| 383 | EOF | ||
| 384 | } | ||
| 385 | |||
| 386 | cortex_a72_linux() { | ||
| 387 | info "cortex-a72 for Linux [ $1 ]" | ||
| 388 | |||
| 389 | # Find the first file ending in .pdi | ||
| 390 | full_pdi_path=$(ls ${pdi_path}/*.pdi 2>/dev/null | head -n 1) | ||
| 391 | if [ -z "${full_pdi_path}" ]; then | ||
| 392 | error "Unable to find a pdi file in ${pdi_path}, use the -i option to point to the directory containing a .pdi file" | ||
| 393 | full_pdi_path="__PATH TO PDI FILE HERE__" | ||
| 394 | elif [ "${full_pdi_path}" != "$(ls ${pdi_path}/*.pdi 2>/dev/null)" ]; then | ||
| 395 | warn "Warning: multiple PDI files found, using first found $(basename ${full_pdi_path})." | ||
| 396 | fi | ||
| 397 | |||
| 398 | if [ "$1" = "None" ]; then | ||
| 399 | dts_file="cortexa72-${machine}-linux.dts" | ||
| 400 | system_conf=${dts_file} | ||
| 401 | conf_file="" | ||
| 402 | else | ||
| 403 | mc_name="cortexa72-${machine}-$1-linux" | ||
| 404 | dts_file="${mc_name}.dts" | ||
| 405 | multiconf="${multiconf} ${mc_name}" | ||
| 406 | conf_file=multiconfig/${mc_name}.conf | ||
| 407 | fi | ||
| 408 | |||
| 409 | ( | ||
| 410 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 411 | # Check if it is overlay dts otherwise just create linux dts | ||
| 412 | if [ "${overlay_dts}" = "true" ]; then | ||
| 413 | # As there is no partial support on Versal, As per fpga manager implementation there is | ||
| 414 | # a flag "external_fpga" which says apply overlay without loading the bit file. | ||
| 415 | if [ "${external_fpga}" = "true" ]; then | ||
| 416 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- xlnx_overlay_dt \ | ||
| 417 | ${machine} full external_fpga || error "lopper failed" | ||
| 418 | else | ||
| 419 | # If there is no external_fpga flag, then the default is full | ||
| 420 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} "${system_dts}" -- xlnx_overlay_dt \ | ||
| 421 | ${machine} full || error "lopper failed" | ||
| 422 | fi | ||
| 423 | dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi || error "dtc failed" | ||
| 424 | elif [ -n "${domain_file}" ]; then | ||
| 425 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ | ||
| 426 | -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" \ | ||
| 427 | -i "${lops_dir}/lop-domain-a72.dts" \ | ||
| 428 | -i "${lops_dir}/lop-domain-a72-prune.dts" \ | ||
| 429 | "${system_dts}" "${dts_file}" \ | ||
| 430 | || error "lopper failed" | ||
| 431 | else | ||
| 432 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a72-imux.dts" \ | ||
| 433 | -i "${lops_dir}/lop-domain-a72.dts" \ | ||
| 434 | -i "${lops_dir}/lop-domain-a72-prune.dts" \ | ||
| 435 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 436 | fi | ||
| 437 | rm -f pl.dtsi lop-a72-imux.dts.dtb lop-domain-a72.dts.dtb lop-domain-a72-prune.dts.dtb | ||
| 438 | ) | ||
| 439 | |||
| 440 | if [ -z "${conf_file}" ]; then | ||
| 441 | return $? | ||
| 442 | fi | ||
| 443 | |||
| 444 | ## Generate a multiconfig | ||
| 445 | cat <<EOF >"${conf_file}" | ||
| 446 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 447 | |||
| 448 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 449 | EOF | ||
| 450 | } | ||
| 451 | |||
| 452 | cortex_a72_baremetal() { | ||
| 453 | info "cortex-a72 baremetal configuration for core $2 [ $1 ]" | ||
| 454 | |||
| 455 | suffix="" | ||
| 456 | [ "$1" != "None" ] && suffix="-$1" | ||
| 457 | |||
| 458 | mc_name="cortexa72-$2-${machine}${suffix}-baremetal" | ||
| 459 | dts_file="${mc_name}.dts" | ||
| 460 | multiconf="${multiconf} ${mc_name}" | ||
| 461 | conf_file="multiconfig/${mc_name}.conf" | ||
| 462 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 463 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 464 | |||
| 465 | # Build device tree | ||
| 466 | ( | ||
| 467 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 468 | if [ -n "${domain_file}" ]; then | ||
| 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}" \ | ||
| 471 | || error "lopper failed" | ||
| 472 | else | ||
| 473 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a72-imux.dts" \ | ||
| 474 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 475 | fi | ||
| 476 | rm -f lop-a72-imux.dts.dtb | ||
| 477 | ) | ||
| 478 | |||
| 479 | # Build baremetal multiconfig | ||
| 480 | if [ -n "${domain_file}" ]; then | ||
| 481 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 482 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" || error "lopper failed" | ||
| 483 | else | ||
| 484 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 485 | || error "lopper failed" | ||
| 486 | fi | ||
| 487 | |||
| 488 | mv libxil.conf "${libxil}" | ||
| 489 | mv distro.conf "${features}" | ||
| 490 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 491 | |||
| 492 | cat <<EOF >"${conf_file}" | ||
| 493 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 494 | |||
| 495 | ESW_MACHINE = "$3" | ||
| 496 | DEFAULTTUNE = "cortexa72" | ||
| 497 | |||
| 498 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 499 | |||
| 500 | DISTRO = "xilinx-standalone-nolto" | ||
| 501 | EOF | ||
| 502 | } | ||
| 503 | |||
| 504 | cortex_a72_freertos() { | ||
| 505 | info "cortex-a72 FreeRTOS configuration for core $2 [ $1 ]" | ||
| 506 | |||
| 507 | suffix="" | ||
| 508 | [ "$1" != "None" ] && suffix="-$1" | ||
| 509 | |||
| 510 | mc_name="cortexa72-$2-${machine}${suffix}-freertos" | ||
| 511 | dts_file="${mc_name}.dts" | ||
| 512 | multiconf="${multiconf} ${mc_name}" | ||
| 513 | conf_file="multiconfig/${mc_name}.conf" | ||
| 514 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 515 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 516 | |||
| 517 | # Build device tree | ||
| 518 | ( | ||
| 519 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 520 | if [ -n "${domain_file}" ]; then | ||
| 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}" \ | ||
| 523 | || error "lopper failed" | ||
| 524 | else | ||
| 525 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a72-imux.dts" \ | ||
| 526 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 527 | fi | ||
| 528 | rm -f lop-a72-imux.dts.dtb | ||
| 529 | ) | ||
| 530 | |||
| 531 | # Build baremetal multiconfig | ||
| 532 | if [ -n "${domain_file}" ]; then | ||
| 533 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 534 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" || error "lopper failed" | ||
| 535 | else | ||
| 536 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 537 | || error "lopper failed" | ||
| 538 | fi | ||
| 539 | |||
| 540 | mv libxil.conf "${libxil}" | ||
| 541 | mv distro.conf "${features}" | ||
| 542 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 543 | |||
| 544 | cat <<EOF >"${conf_file}" | ||
| 545 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 546 | |||
| 547 | ESW_MACHINE = "$3" | ||
| 548 | DEFAULTTUNE = "cortexa72" | ||
| 549 | |||
| 550 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 551 | |||
| 552 | DISTRO = "xilinx-freertos" | ||
| 553 | EOF | ||
| 554 | } | ||
| 555 | |||
| 556 | r5_fsbl_done=0 | ||
| 557 | cortex_r5_baremetal() { | ||
| 558 | if [ "$1" = "fsbl" ]; then | ||
| 559 | [ ${r5_fsbl_done} = 1 ] && return | ||
| 560 | info "cortex-r5 FSBL baremetal configuration" | ||
| 561 | else | ||
| 562 | info "cortex-r5 baremetal configuration for core $2 [ $1 ]" | ||
| 563 | fi | ||
| 564 | |||
| 565 | suffix=""; lto="-nolto" | ||
| 566 | if [ "$1" != "None" ]; then | ||
| 567 | suffix="-$1"; lto="" | ||
| 568 | fi | ||
| 569 | |||
| 570 | mc_name="cortexr5-$2-${machine}${suffix}-baremetal" | ||
| 571 | dts_file="${mc_name}.dts" | ||
| 572 | multiconf="${multiconf} ${mc_name}" | ||
| 573 | conf_file="multiconfig/${mc_name}.conf" | ||
| 574 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 575 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 576 | yocto_distro="xilinx-standalone${lto}" | ||
| 577 | |||
| 578 | if [ "$1" = "fsbl" ]; then | ||
| 579 | r5fsbl_mcdepends="mc::${mc_name}:fsbl-firmware:do_deploy" | ||
| 580 | r5fsbl_deploy_dir="\${BASE_TMPDIR}/tmp-${mc_name}/deploy/images/\${MACHINE}" | ||
| 581 | r5_fsbl_done=1 | ||
| 582 | fi | ||
| 583 | |||
| 584 | # Build device tree | ||
| 585 | ( | ||
| 586 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 587 | if [ -n "$domain_file" ]; then | ||
| 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}" \ | ||
| 590 | || error "lopper failed" | ||
| 591 | else | ||
| 592 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-r5-imux.dts" \ | ||
| 593 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 594 | fi | ||
| 595 | rm -f lop-r5-imux.dts.dtb | ||
| 596 | ) | ||
| 597 | |||
| 598 | # Build baremetal multiconfig | ||
| 599 | if [ -n "${domain_file}" ]; then | ||
| 600 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 601 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" || error "lopper failed" | ||
| 602 | else | ||
| 603 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 604 | || error "lopper failed" | ||
| 605 | fi | ||
| 606 | |||
| 607 | mv libxil.conf "${libxil}" | ||
| 608 | mv distro.conf "${features}" | ||
| 609 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 610 | |||
| 611 | if [ "$1" = "fsbl" ]; then | ||
| 612 | if [ ! -e "${psu_init_path}/psu_init.c" ]; then | ||
| 613 | warn "Warning: Unable to find psu_init.c in ${psu_init_path}" | ||
| 614 | fi | ||
| 615 | if [ ! -e "${psu_init_path}/psu_init.h" ]; then | ||
| 616 | warn "Warning: Unable to find psu_init.h in ${psu_init_path}" | ||
| 617 | fi | ||
| 618 | |||
| 619 | cat <<EOF >"${conf_file}" | ||
| 620 | PSU_INIT_PATH = "${psu_init_path}" | ||
| 621 | EOF | ||
| 622 | else | ||
| 623 | cat /dev/null >"${conf_file}" | ||
| 624 | fi | ||
| 625 | cat <<EOF >>"${conf_file}" | ||
| 626 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 627 | |||
| 628 | ESW_MACHINE = "$3" | ||
| 629 | DEFAULTTUNE = "cortexr5" | ||
| 630 | |||
| 631 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 632 | |||
| 633 | DISTRO = "$yocto_distro" | ||
| 634 | EOF | ||
| 635 | } | ||
| 636 | |||
| 637 | cortex_r5_freertos() { | ||
| 638 | info "cortex-r5 FreeRTOS configuration for core $2 [ $1 ]" | ||
| 639 | |||
| 640 | suffix="" | ||
| 641 | [ "$1" != "None" ] && suffix="-$1" | ||
| 642 | |||
| 643 | mc_name="cortexr5-$2-${machine}${suffix}-freertos" | ||
| 644 | dts_file="${mc_name}.dts" | ||
| 645 | multiconf="${multiconf} ${mc_name}" | ||
| 646 | conf_file="multiconfig/${mc_name}.conf" | ||
| 647 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 648 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 649 | |||
| 650 | # Build device tree | ||
| 651 | ( | ||
| 652 | cd ${dts_path} || error "Unable to cd to ${dts_path} dir" | ||
| 653 | if [ -n "$domain_file" ]; then | ||
| 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}" \ | ||
| 656 | || error "lopper failed" | ||
| 657 | else | ||
| 658 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-r5-imux.dts" \ | ||
| 659 | "${system_dts}" "${dts_file}" || error "lopper failed" | ||
| 660 | fi | ||
| 661 | rm -f lop-r5-imux.dts.dtb | ||
| 662 | ) | ||
| 663 | |||
| 664 | # Build baremetal multiconfig | ||
| 665 | if [ -n "${domain_file}" ]; then | ||
| 666 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 667 | -- baremetaldrvlist_xlnx $3 "${embeddedsw}" || error "lopper failed" | ||
| 668 | else | ||
| 669 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $3 "${embeddedsw}" \ | ||
| 670 | || error "lopper failed" | ||
| 671 | fi | ||
| 672 | |||
| 673 | mv libxil.conf "${libxil}" | ||
| 674 | mv distro.conf "${features}" | ||
| 675 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 676 | |||
| 677 | cat <<EOF >"${conf_file}" | ||
| 678 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 679 | |||
| 680 | ESW_MACHINE = "$3" | ||
| 681 | DEFAULTTUNE = "cortexr5" | ||
| 682 | |||
| 683 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 684 | |||
| 685 | DISTRO = "xilinx-freertos" | ||
| 686 | EOF | ||
| 687 | } | ||
| 688 | |||
| 689 | # Generate microblaze tunings | ||
| 690 | microblaze_done=0 | ||
| 691 | process_microblaze() { | ||
| 692 | [ ${microblaze_done} = 1 ] && return | ||
| 693 | |||
| 694 | info "Generating microblaze processor tunes" | ||
| 695 | |||
| 696 | mkdir -p machine/include/${mach_conf} | ||
| 697 | ( | ||
| 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}" \ | ||
| 700 | || error "lopper failed" | ||
| 701 | rm -f lop-microblaze-yocto.dts.dtb | ||
| 702 | ) >machine/include/${mach_conf}/microblaze.inc | ||
| 703 | |||
| 704 | echo "require conf/machine/include/xilinx-microblaze.inc" >> machine/include/${mach_conf}/microblaze.inc | ||
| 705 | |||
| 706 | microblaze_done=1 | ||
| 707 | } | ||
| 708 | |||
| 709 | # pmu-microblaze is ALWAYS baremetal, no domain | ||
| 710 | pmu-microblaze() { | ||
| 711 | info "Microblaze ZynqMP PMU" | ||
| 712 | |||
| 713 | process_microblaze | ||
| 714 | |||
| 715 | mc_name="microblaze-0-pmu" | ||
| 716 | dts_file="${mc_name}.dts" | ||
| 717 | multiconf="${multiconf} ${mc_name}" | ||
| 718 | multiconf_min="${multiconf_min} ${mc_name}" | ||
| 719 | conf_file="multiconfig/${mc_name}.conf" | ||
| 720 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 721 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 722 | |||
| 723 | pmu_mcdepends="mc::${mc_name}:pmu-firmware:do_deploy" | ||
| 724 | pmu_firmware_deploy_dir="\${BASE_TMPDIR}/tmp-${mc_name}/deploy/images/\${MACHINE}" | ||
| 725 | |||
| 726 | # Build device tree | ||
| 727 | ( | ||
| 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" | ||
| 730 | ) | ||
| 731 | |||
| 732 | # Build baremetal multiconfig | ||
| 733 | if [ -n "${domain_file}" ]; then | ||
| 734 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 735 | -- baremetaldrvlist_xlnx $1 "${embeddedsw}" || error "lopper failed" | ||
| 736 | else | ||
| 737 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $1 "${embeddedsw}" \ | ||
| 738 | || error "lopper failed" | ||
| 739 | fi | ||
| 740 | |||
| 741 | mv libxil.conf "${libxil}" | ||
| 742 | mv distro.conf "${features}" | ||
| 743 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 744 | |||
| 745 | cat <<EOF >"${conf_file}" | ||
| 746 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 747 | |||
| 748 | ESW_MACHINE = "$1" | ||
| 749 | |||
| 750 | DEFAULTTUNE = "microblaze-pmu" | ||
| 751 | |||
| 752 | TARGET_CFLAGS += "-DPSU_PMU=1U" | ||
| 753 | |||
| 754 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 755 | |||
| 756 | DISTRO = "xilinx-standalone" | ||
| 757 | EOF | ||
| 758 | } | ||
| 759 | |||
| 760 | # pmc-microblaze is ALWAYS baremetal, no domain | ||
| 761 | pmc-microblaze() { | ||
| 762 | info "Microblaze Versal PMC" | ||
| 763 | |||
| 764 | process_microblaze | ||
| 765 | |||
| 766 | mc_name="microblaze-0-pmc" | ||
| 767 | dts_file="${mc_name}.dts" | ||
| 768 | multiconf="${multiconf} ${mc_name}" | ||
| 769 | multiconf_min="${multiconf_min} ${mc_name}" | ||
| 770 | conf_file="multiconfig/${mc_name}.conf" | ||
| 771 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 772 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 773 | |||
| 774 | plm_mcdepends="mc::${mc_name}:plm-firmware:do_deploy" | ||
| 775 | plm_deploy_dir="\${BASE_TMPDIR}/tmp-${mc_name}/deploy/images/\${MACHINE}" | ||
| 776 | |||
| 777 | # Build device tree | ||
| 778 | ( | ||
| 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" | ||
| 781 | ) | ||
| 782 | |||
| 783 | # Build baremetal multiconfig | ||
| 784 | if [ -n "${domain_file}" ]; then | ||
| 785 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 786 | -- baremetaldrvlist_xlnx $1 "${embeddedsw}" || error "lopper failed" | ||
| 787 | else | ||
| 788 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $1 "${embeddedsw}" \ | ||
| 789 | || error "lopper failed" | ||
| 790 | fi | ||
| 791 | |||
| 792 | mv libxil.conf "${libxil}" | ||
| 793 | mv distro.conf "${features}" | ||
| 794 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 795 | |||
| 796 | cat <<EOF >"${conf_file}" | ||
| 797 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 798 | |||
| 799 | ESW_MACHINE = "$1" | ||
| 800 | |||
| 801 | DEFAULTTUNE = "microblaze-pmc" | ||
| 802 | |||
| 803 | TARGET_CFLAGS += "-DVERSAL_PLM=1" | ||
| 804 | |||
| 805 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 806 | |||
| 807 | DISTRO = "xilinx-standalone" | ||
| 808 | EOF | ||
| 809 | } | ||
| 810 | |||
| 811 | # psm-microblaze is ALWAYS baremetal, no domain | ||
| 812 | psm-microblaze() { | ||
| 813 | info "Microblaze Versal PSM" | ||
| 814 | |||
| 815 | process_microblaze | ||
| 816 | |||
| 817 | mc_name="microblaze-0-psm" | ||
| 818 | dts_file="${mc_name}.dts" | ||
| 819 | multiconf="${multiconf} ${mc_name}" | ||
| 820 | multiconf_min="${multiconf_min} ${mc_name}" | ||
| 821 | conf_file="multiconfig/${mc_name}.conf" | ||
| 822 | libxil="machine/include/${mach_conf}/${mc_name}-libxil.conf" | ||
| 823 | features="machine/include/${mach_conf}/${mc_name}-features.conf" | ||
| 824 | |||
| 825 | psm_mcdepends="mc::${mc_name}:psm-firmware:do_deploy" | ||
| 826 | psm_firmware_deploy_dir="\${BASE_TMPDIR}/tmp-${mc_name}/deploy/images/\${MACHINE}" | ||
| 827 | |||
| 828 | # Build device tree | ||
| 829 | ( | ||
| 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" | ||
| 832 | ) | ||
| 833 | |||
| 834 | # Build baremetal multiconfig | ||
| 835 | if [ -n "${domain_file}" ]; then | ||
| 836 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dts}" \ | ||
| 837 | -- baremetaldrvlist_xlnx $1 "${embeddedsw}" || error "lopper failed" | ||
| 838 | else | ||
| 839 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f "${system_dts}" -- baremetaldrvlist_xlnx $1 "${embeddedsw}" \ | ||
| 840 | || error "lopper failed" | ||
| 841 | fi | ||
| 842 | |||
| 843 | mv libxil.conf "${libxil}" | ||
| 844 | mv distro.conf "${features}" | ||
| 845 | sed -i ${features} -e "s,DISTRO_FEATURES,MACHINE_FEATURES," | ||
| 846 | |||
| 847 | cat <<EOF >"${conf_file}" | ||
| 848 | CONFIG_DTFILE = "${dts_file_path}/${dts_file}" | ||
| 849 | |||
| 850 | ESW_MACHINE = "$1" | ||
| 851 | |||
| 852 | DEFAULTTUNE = "microblaze-psm" | ||
| 853 | |||
| 854 | TARGET_CFLAGS += "-DVERSAL_psm=1" | ||
| 855 | |||
| 856 | TMPDIR = "\${BASE_TMPDIR}/tmp-${mc_name}" | ||
| 857 | |||
| 858 | DISTRO = "xilinx-standalone" | ||
| 859 | EOF | ||
| 860 | } | ||
| 861 | |||
| 862 | generate_machine() { | ||
| 863 | info "Generating machine conf file" | ||
| 864 | conf_file="machine/${mach_conf}.conf" | ||
| 865 | |||
| 866 | # Machine include file | ||
| 867 | if [ -z ${incmachine} ]; then | ||
| 868 | if [ -n "${soc_variant}" ]; then | ||
| 869 | incmachine="${machine}-${soc_variant}-generic.conf" | ||
| 870 | else | ||
| 871 | incmachine="${machine}-generic.conf" | ||
| 872 | fi | ||
| 873 | fi | ||
| 874 | |||
| 875 | mkdir -p machine | ||
| 876 | # Generate header | ||
| 877 | cat <<EOF >"${conf_file}" | ||
| 878 | #@TYPE: Machine | ||
| 879 | #@NAME: ${mach_conf} | ||
| 880 | #@DESCRIPTION: ${model} | ||
| 881 | |||
| 882 | #### Preamble | ||
| 883 | MACHINEOVERRIDES =. "\${@['', '${mach_conf}:']['${mach_conf}' != '\${MACHINE}']}" | ||
| 884 | #### Regular settings follow | ||
| 885 | |||
| 886 | EOF | ||
| 887 | |||
| 888 | if [ -n "${overrides}" ]; then | ||
| 889 | cat <<EOF >>"${conf_file}" | ||
| 890 | MACHINEOVERRIDES .= ":${overrides}" | ||
| 891 | |||
| 892 | EOF | ||
| 893 | fi | ||
| 894 | |||
| 895 | if [ "${machine}" == "zynqmp" ]; then | ||
| 896 | cat <<EOF >>"${conf_file}" | ||
| 897 | TUNEFILE[microblaze-pmu] = "conf/machine/include/${mach_conf}/microblaze.inc" | ||
| 898 | EOF | ||
| 899 | elif [ "${machine}" == "versal" ]; then | ||
| 900 | cat <<EOF >>"${conf_file}" | ||
| 901 | TUNEFILE[microblaze-pmc] = "conf/machine/include/${mach_conf}/microblaze.inc" | ||
| 902 | TUNEFILE[microblaze-psm] = "conf/machine/include/${mach_conf}/microblaze.inc" | ||
| 903 | EOF | ||
| 904 | fi | ||
| 905 | |||
| 906 | sysdt_path=$(dirname ${system_dts}) | ||
| 907 | sysdt_base=$(basename ${system_dts}) | ||
| 908 | cat <<EOF >>"${conf_file}" | ||
| 909 | |||
| 910 | # Set the default (linux) domain device tree | ||
| 911 | CONFIG_DTFILE ?= "${dts_file_path}/${system_conf}" | ||
| 912 | CONFIG_DTFILE[vardepsexclude] += "TOPDIR" | ||
| 913 | |||
| 914 | require conf/machine/${incmachine} | ||
| 915 | |||
| 916 | # System Device Tree does not use HDF_MACHINE | ||
| 917 | HDF_MACHINE = "" | ||
| 918 | |||
| 919 | # Set the system device trees | ||
| 920 | SYSTEM_DTFILE_DIR = "${sysdt_path}" | ||
| 921 | SYSTEM_DTFILE = "\${SYSTEM_DTFILE_DIR}/${sysdt_base}" | ||
| 922 | SYSTEM_DTFILE[vardepsexclude] += "SYSTEM_DTFILE_DIR" | ||
| 923 | |||
| 924 | # Load the dynamic machine features | ||
| 925 | include conf/machine/include/${mach_conf}/\${BB_CURRENT_MC}-features.conf | ||
| 926 | LIBXIL_CONFIG = "conf/machine/include/${mach_conf}/\${BB_CURRENT_MC}-libxil.conf" | ||
| 927 | |||
| 928 | EOF | ||
| 929 | |||
| 930 | if [ -n "${fsbl_mcdepends}" ]; then | ||
| 931 | cat <<EOF >>"${conf_file}" | ||
| 932 | # First Stage Boot Loader | ||
| 933 | FSBL_DEPENDS = "" | ||
| 934 | FSBL_MCDEPENDS = "${fsbl_mcdepends}" | ||
| 935 | FSBL_DEPLOY_DIR = "${fsbl_deploy_dir}" | ||
| 936 | |||
| 937 | EOF | ||
| 938 | fi | ||
| 939 | if [ -n "${r5fsbl_mcdepends}" ]; then | ||
| 940 | cat <<EOF >>"${conf_file}" | ||
| 941 | # Cortex-R5 First Stage Boot Loader | ||
| 942 | R5FSBL_DEPENDS = "" | ||
| 943 | R5FSBL_MCDEPENDS = "${r5fsbl_mcdepends}" | ||
| 944 | R5FSBL_DEPLOY_DIR = "${r5fsbl_deploy_dir}" | ||
| 945 | |||
| 946 | EOF | ||
| 947 | fi | ||
| 948 | if [ -n "${pmu_mcdepends}" ]; then | ||
| 949 | cat <<EOF >>"${conf_file}" | ||
| 950 | # PMU Firware | ||
| 951 | PMU_DEPENDS = "" | ||
| 952 | PMU_MCDEPENDS = "${pmu_mcdepends}" | ||
| 953 | PMU_FIRMWARE_DEPLOY_DIR = "${pmu_firmware_deploy_dir}" | ||
| 954 | |||
| 955 | EOF | ||
| 956 | fi | ||
| 957 | if [ -n "${plm_mcdepends}" ]; then | ||
| 958 | cat <<EOF >>"${conf_file}" | ||
| 959 | # Platform Loader and Manager | ||
| 960 | PLM_DEPENDS = "" | ||
| 961 | PLM_MCDEPENDS = "${plm_mcdepends}" | ||
| 962 | PLM_DEPLOY_DIR = "${plm_deploy_dir}" | ||
| 963 | |||
| 964 | EOF | ||
| 965 | fi | ||
| 966 | if [ -n "${psm_mcdepends}" ]; then | ||
| 967 | cat <<EOF >>"${conf_file}" | ||
| 968 | # PSM Firmware | ||
| 969 | PSM_DEPENDS = "" | ||
| 970 | PSM_MCDEPENDS = "${psm_mcdepends}" | ||
| 971 | PSM_FIRMWARE_DEPLOY_DIR = "${psm_firmware_deploy_dir}" | ||
| 972 | |||
| 973 | EOF | ||
| 974 | fi | ||
| 975 | |||
| 976 | if [ -n "${full_pdi_path}" ]; then | ||
| 977 | pdi_path_dir=$(dirname ${full_pdi_path}) | ||
| 978 | pdi_path_base=$(basename ${full_pdi_path}) | ||
| 979 | cat <<EOF >>"${conf_file}" | ||
| 980 | # Versal PDI | ||
| 981 | PDI_PATH_DIR = "${pdi_path_dir}" | ||
| 982 | PDI_PATH = "\${PDI_PATH_DIR}/${pdi_path_base}" | ||
| 983 | PDI_PATH[vardepsexclude] += "PDI_PATH_DIR" | ||
| 984 | |||
| 985 | EOF | ||
| 986 | fi | ||
| 987 | |||
| 988 | cat <<EOF >>"${conf_file}" | ||
| 989 | # Exclude BASE_TMPDIR from hash calculations | ||
| 990 | BB_HASHEXCLUDE_COMMON:append = " BASE_TMPDIR" | ||
| 991 | |||
| 992 | # Update bootbin to use proper device tree | ||
| 993 | BIF_PARTITION_IMAGE[device-tree] = "\${RECIPE_SYSROOT}/boot/devicetree/\${@os.path.basename(d.getVar('CONFIG_DTFILE').replace('.dts', '.dtb'))}" | ||
| 994 | # Remap boot files to ensure the right device tree is listed first | ||
| 995 | IMAGE_BOOT_FILES =+ "devicetree/\${@os.path.basename(d.getVar('CONFIG_DTFILE').replace('.dts', '.dtb'))}" | ||
| 996 | |||
| 997 | #### No additional settings should be after the Postamble | ||
| 998 | #### Postamble | ||
| 999 | PACKAGE_EXTRA_ARCHS:append = "\${@['', ' ${mach_conf//-/_}']['${mach_conf}' != "\${MACHINE}"]}" | ||
| 1000 | EOF | ||
| 1001 | } | ||
| 1002 | |||
| 1003 | parse_cpus() { | ||
| 1004 | gen_linux_dts="None" | ||
| 1005 | while read -r cpu core domain cpu_name os_hint; do | ||
| 1006 | # Skip commented lines and WARNINGs | ||
| 1007 | case ${cpu} in | ||
| 1008 | \#* | \[WARNING\]:) continue ;; | ||
| 1009 | esac | ||
| 1010 | |||
| 1011 | case ${cpu} in | ||
| 1012 | |||
| 1013 | arm,cortex-a53) | ||
| 1014 | # We need a base cortex_a53_baremetal for the FSBL | ||
| 1015 | if [ "${core}" == 0 ]; then | ||
| 1016 | cortex_a53_baremetal fsbl ${core} ${cpu_name} | ||
| 1017 | fi | ||
| 1018 | if [ "${os_hint}" == "None" ]; then | ||
| 1019 | if [ "${gen_linux_dts}" == "None" ]; then | ||
| 1020 | cortex_a53_linux "${domain}" | ||
| 1021 | gen_linux_dts="True" | ||
| 1022 | fi | ||
| 1023 | cortex_a53_baremetal "${domain}" ${core} ${cpu_name} | ||
| 1024 | cortex_a53_freertos "${domain}" ${core} ${cpu_name} | ||
| 1025 | else | ||
| 1026 | case "${os_hint}" in | ||
| 1027 | linux*) | ||
| 1028 | if [ "${gen_linux_dts}" == "None" ]; then | ||
| 1029 | cortex_a53_linux "${domain}" | ||
| 1030 | gen_linux_dts="True" | ||
| 1031 | fi | ||
| 1032 | ;; | ||
| 1033 | baremetal*) | ||
| 1034 | cortex_a53_baremetal "${domain}" ${core} ${cpu_name};; | ||
| 1035 | freertos*) | ||
| 1036 | cortex_a53_freertos "${domain}" ${core} ${cpu_name};; | ||
| 1037 | *) | ||
| 1038 | warn "cortex-a53 for unknown OS (${os_hint}), parsing baremetal. ${domain}" | ||
| 1039 | cortex_a53_baremetal "${domain}" | ||
| 1040 | esac | ||
| 1041 | fi | ||
| 1042 | ;; | ||
| 1043 | |||
| 1044 | arm,cortex-a72) | ||
| 1045 | if [ "${os_hint}" == "None" ]; then | ||
| 1046 | if [ "${gen_linux_dts}" == "None" ]; then | ||
| 1047 | cortex_a72_linux "${domain}" | ||
| 1048 | gen_linux_dts="True" | ||
| 1049 | fi | ||
| 1050 | cortex_a72_baremetal "${domain}" ${core} ${cpu_name} | ||
| 1051 | cortex_a72_freertos "${domain}" ${core} ${cpu_name} | ||
| 1052 | else | ||
| 1053 | case "${os_hint}" in | ||
| 1054 | linux*) | ||
| 1055 | if [ "${gen_linux_dts}" == "None" ]; then | ||
| 1056 | cortex_a72_linux "${domain}" | ||
| 1057 | gen_linux_dts="True" | ||
| 1058 | fi | ||
| 1059 | ;; | ||
| 1060 | baremetal*) | ||
| 1061 | cortex_a72_baremetal "${domain}" ${core} ${cpu_name};; | ||
| 1062 | freertos*) | ||
| 1063 | cortex_a72_freertos "${domain}" ${core} ${cpu_name};; | ||
| 1064 | *) | ||
| 1065 | warn "cortex-a72 for unknown OS (${os_hint}), parsing baremetal. ${domain}" | ||
| 1066 | cortex_a72_baremetal "${domain}" | ||
| 1067 | esac | ||
| 1068 | fi | ||
| 1069 | ;; | ||
| 1070 | arm,cortex-r5) | ||
| 1071 | if [ "${os_hint}" == "None" ]; then | ||
| 1072 | # We need a base cortex_r5_baremetal for the FSBL for ZynqMP platform | ||
| 1073 | [ "${machine}" = "zynqmp" ] && cortex_r5_baremetal fsbl ${core} ${cpu_name} | ||
| 1074 | cortex_r5_baremetal "${domain}" ${core} ${cpu_name} | ||
| 1075 | cortex_r5_freertos "${domain}" ${core} ${cpu_name} | ||
| 1076 | else | ||
| 1077 | case "${os_hint}" in | ||
| 1078 | baremetal*) | ||
| 1079 | cortex_r5_baremetal "${domain}" ${core} ${cpu_name};; | ||
| 1080 | freertos*) | ||
| 1081 | cortex_r5_freertos "${domain}" ${core} ${cpu_name};; | ||
| 1082 | *) | ||
| 1083 | warn "cortex-r5 for unknown OS (${os_hint}), parsing baremetal. ${domain}" | ||
| 1084 | cortex_r5_baremetal "${domain}" | ||
| 1085 | esac | ||
| 1086 | fi | ||
| 1087 | ;; | ||
| 1088 | |||
| 1089 | xlnx,microblaze) | ||
| 1090 | process_microblaze | ||
| 1091 | case "${os_hint}" in | ||
| 1092 | None | baremetal*) | ||
| 1093 | warn "Microblaze for Baremetal ${domain} not yet implemented" ;; | ||
| 1094 | Linux) | ||
| 1095 | warn "Microblaze for Linux ${domain} not yet implemented" ;; | ||
| 1096 | *) | ||
| 1097 | warn "Microblaze for unknown OS (${os_hint}), not yet implemented. ${domain}" ;; | ||
| 1098 | esac | ||
| 1099 | ;; | ||
| 1100 | |||
| 1101 | pmu-microblaze) | ||
| 1102 | pmu-microblaze ${cpu_name};; | ||
| 1103 | |||
| 1104 | pmc-microblaze) | ||
| 1105 | pmc-microblaze ${cpu_name};; | ||
| 1106 | |||
| 1107 | psm-microblaze) | ||
| 1108 | psm-microblaze ${cpu_name};; | ||
| 1109 | *) | ||
| 1110 | warn "Unknown CPU ${cpu}" | ||
| 1111 | |||
| 1112 | esac | ||
| 1113 | done <${cpulist} | ||
| 1114 | } | ||
| 1115 | |||
| 1116 | gen_local_conf() { | ||
| 1117 | cat << EOF >> $1 | ||
| 1118 | |||
| 1119 | # Avoid errors in some baremetal configs as these layers may be present | ||
| 1120 | # but are not used. Note the following lines are optional and can be | ||
| 1121 | # safetly disabled. | ||
| 1122 | SKIP_META_VIRT_SANITY_CHECK = "1" | ||
| 1123 | SKIP_META_SECURITY_SANITY_CHECK = "1" | ||
| 1124 | SKIP_META_TPM_SANITY_CHECK = "1" | ||
| 1125 | |||
| 1126 | # Each multiconfig will define it's own TMPDIR, this is the new default based | ||
| 1127 | # on BASE_TMPDIR for the Linux build | ||
| 1128 | TMPDIR = "\${BASE_TMPDIR}/tmp" | ||
| 1129 | |||
| 1130 | # Use the newly generated MACHINE | ||
| 1131 | MACHINE = "${mach_conf}" | ||
| 1132 | |||
| 1133 | # All of the TMPDIRs must be in a common parent directory. This is defined | ||
| 1134 | # as BASE_TMPDIR. | ||
| 1135 | # Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere, such as /tmp | ||
| 1136 | BASE_TMPDIR ?= "\${TOPDIR}" | ||
| 1137 | |||
| 1138 | # The following is the full set of multiconfigs for this configuration | ||
| 1139 | # A large list can cause a slow parse. | ||
| 1140 | #BBMULTICONFIG ?= "${multiconf}" | ||
| 1141 | # Alternatively trim the list to the minimum | ||
| 1142 | BBMULTICONFIG = "${multiconf_min}" | ||
| 1143 | EOF | ||
| 1144 | } | ||
| 1145 | |||
| 1146 | gen_petalinux_conf() { | ||
| 1147 | cd "${config_dir}" || exit | ||
| 1148 | ( | ||
| 1149 | if [ "$machine" == "zynqmp" ]; then | ||
| 1150 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} "${system_dts}" -- petalinuxconfig_xlnx psu_cortexa53_0 ${petalinux_schema} \ | ||
| 1151 | || error "lopper failed" | ||
| 1152 | else | ||
| 1153 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} "${system_dts}" -- petalinuxconfig_xlnx psv_cortexa72_0 ${petalinux_schema} \ | ||
| 1154 | || error "lopper failed" | ||
| 1155 | fi | ||
| 1156 | ) | ||
| 1157 | } | ||
| 1158 | parse_args "$@" | ||
| 1159 | |||
| 1160 | lopper=$(command -v lopper) | ||
| 1161 | lopper_dir=$(dirname "${lopper}") | ||
| 1162 | lops_dir=$(ls -d $(dirname "${lopper_dir}")/lib/python*/site-packages/lopper/lops | head -n 1) | ||
| 1163 | embeddedsw=$(dirname "${lopper_dir}")/share/embeddedsw | ||
| 1164 | system_conf="" | ||
| 1165 | multiconf="" | ||
| 1166 | |||
| 1167 | [ -z "${lopper}" ] && error "Unable to find lopper, please source the prestep environment" | ||
| 1168 | |||
| 1169 | cpulist=$(mktemp) | ||
| 1170 | |||
| 1171 | priordir=$(pwd) | ||
| 1172 | cd "${config_dir}" || exit | ||
| 1173 | mkdir -p dts multiconfig machine/include | ||
| 1174 | # Get mach_conf name and model name | ||
| 1175 | ( | ||
| 1176 | cd dts || error "Unable to cd to dts dir" | ||
| 1177 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-machine-name.dts" "${system_dts}" \ | ||
| 1178 | /dev/null > ${cpulist} || error "lopper failed" | ||
| 1179 | rm -f "lop-machine-name.dts.dtb" | ||
| 1180 | ) | ||
| 1181 | read local_mach_conf deviceid model < ${cpulist} | ||
| 1182 | if [ -z "${mach_conf}" ]; then | ||
| 1183 | mach_conf=${local_mach_conf} | ||
| 1184 | fi | ||
| 1185 | |||
| 1186 | if [ -z "${dts_path}" ]; then | ||
| 1187 | dts_path=${local_mach_conf} | ||
| 1188 | fi | ||
| 1189 | # Is it relative? If so, relative to conf/dts | ||
| 1190 | if [ "${dts_path##/}" = "${dts_path}" ]; then | ||
| 1191 | dts_path="dts/${dts_path}" | ||
| 1192 | else | ||
| 1193 | dts_path=$(realpath ${dts_path}) | ||
| 1194 | fi | ||
| 1195 | # Convert the DTS_PATH into something we can put in a config file | ||
| 1196 | if [ "${dts_path##/}" = "${dts_path}" ]; then | ||
| 1197 | dts_file_path="\${TOPDIR}/conf/${dts_path}" | ||
| 1198 | else | ||
| 1199 | dts_file_path="${dts_path}" | ||
| 1200 | fi | ||
| 1201 | |||
| 1202 | # Generate CPU list | ||
| 1203 | ( | ||
| 1204 | cd dts || error "Unable to cd to dts dir" | ||
| 1205 | LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-xilinx-id-cpus.dts" "${system_dts}" \ | ||
| 1206 | /dev/null > ${cpulist} || error "lopper failed" | ||
| 1207 | rm -f "lop-xilinx-id-cpus.dts.dtb" | ||
| 1208 | ) | ||
| 1209 | |||
| 1210 | detect_machine | ||
| 1211 | # Now that we know the machine name, we can create the directory | ||
| 1212 | mkdir -p machine/include/${mach_conf} | ||
| 1213 | mkdir -p ${dts_path} | ||
| 1214 | |||
| 1215 | echo "System Configuration:" | ||
| 1216 | echo "MODEL = \"${model}\"" | ||
| 1217 | echo "MACHINE = \"${mach_conf}\"" | ||
| 1218 | echo "DEVICE_ID = \"${deviceid}\"" | ||
| 1219 | echo "SOC_FAMILY = \"${machine}\"" | ||
| 1220 | echo "SOC_VARIANT = \"${soc_variant}\"" | ||
| 1221 | echo "CPUs:" | ||
| 1222 | dump_cpus " = " | ||
| 1223 | echo | ||
| 1224 | |||
| 1225 | info "Generating configuration..." | ||
| 1226 | parse_cpus | ||
| 1227 | |||
| 1228 | generate_machine | ||
| 1229 | |||
| 1230 | cd ${priordir} | ||
| 1231 | if [ -z "${localconf}" ]; then | ||
| 1232 | echo | ||
| 1233 | echo "To enable this, add the following to your local.conf:" | ||
| 1234 | echo | ||
| 1235 | tmpfile=$(mktemp) | ||
| 1236 | gen_local_conf ${tmpfile} | ||
| 1237 | cat $tmpfile | ||
| 1238 | rm $tmpfile | ||
| 1239 | else | ||
| 1240 | echo | ||
| 1241 | echo "Configuration for local.conf written to ${localconf}" | ||
| 1242 | echo | ||
| 1243 | gen_local_conf ${localconf} | ||
| 1244 | fi | ||
| 1245 | |||
| 1246 | if [ -n "${petalinux_schema}" ]; then | ||
| 1247 | echo | ||
| 1248 | echo "Generating petalinux config file:" | ||
| 1249 | echo | ||
| 1250 | gen_petalinux_conf | ||
| 1251 | fi | ||
| 1252 | |||
| 1253 | # Cleanup our temp file | ||
| 1254 | rm -rf ${cpulist} ${config_dir}/CMakeLists.txt ${config_dir}/DRVLISTConfig.cmake | ||
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb b/meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb deleted file mode 100644 index dc7d647a..00000000 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | DESCRIPTION = "Xilinx Device Tree based configuration generator" | ||
| 2 | LICENSE = "MIT" | ||
| 3 | |||
| 4 | SRC_URI += " \ | ||
| 5 | file://dt-processor.sh \ | ||
| 6 | file://README-setup \ | ||
| 7 | " | ||
| 8 | |||
| 9 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 10 | |||
| 11 | TOOLCHAIN_TARGET_TASK = "" | ||
| 12 | |||
| 13 | TOOLCHAIN_HOST_TASK = "\ | ||
| 14 | nativesdk-sdk-provides-dummy \ | ||
| 15 | nativesdk-lopper \ | ||
| 16 | nativesdk-xilinx-lops \ | ||
| 17 | nativesdk-esw-conf \ | ||
| 18 | " | ||
| 19 | |||
| 20 | MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}" | ||
| 21 | PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}" | ||
| 22 | PACKAGE_ARCHS = "" | ||
| 23 | TARGET_ARCH = "none" | ||
| 24 | TARGET_OS = "none" | ||
| 25 | |||
| 26 | SDK_PACKAGE_ARCHS += "buildtools-dummy-${SDKPKGSUFFIX}" | ||
| 27 | |||
| 28 | TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-xilinx-nativesdk-prestep-${DISTRO_VERSION}" | ||
| 29 | |||
| 30 | SDK_TITLE = "Device Tree setup tools" | ||
| 31 | |||
| 32 | RDEPENDS = "${TOOLCHAIN_HOST_TASK}" | ||
| 33 | |||
| 34 | EXCLUDE_FROM_WORLD = "1" | ||
| 35 | |||
| 36 | inherit populate_sdk | ||
| 37 | inherit toolchain-scripts-base | ||
| 38 | inherit nopackages | ||
| 39 | |||
| 40 | deltask install | ||
| 41 | deltask populate_sysroot | ||
| 42 | |||
| 43 | do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}" | ||
| 44 | |||
| 45 | REAL_MULTIMACH_TARGET_SYS = "none" | ||
| 46 | |||
| 47 | # Needed to ensure README-setup and dt-processor.sh are available | ||
| 48 | addtask do_populate_sdk after do_unpack | ||
| 49 | |||
| 50 | create_sdk_files:append () { | ||
| 51 | |||
| 52 | install -m 0644 ${WORKDIR}/README-setup ${SDK_OUTPUT}/${SDKPATH}/. | ||
| 53 | install -m 0755 ${WORKDIR}/dt-processor.sh ${SDK_OUTPUT}/${SDKPATH}/. | ||
| 54 | |||
| 55 | rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-* | ||
| 56 | rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-* | ||
| 57 | rm -f ${SDK_OUTPUT}/${SDKPATH}/version-* | ||
| 58 | |||
| 59 | # Generate new (mini) sdk-environment-setup file | ||
| 60 | script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}} | ||
| 61 | touch $script | ||
| 62 | echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script | ||
| 63 | echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script | ||
| 64 | echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script | ||
| 65 | echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script | ||
| 66 | |||
| 67 | toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS} | ||
| 68 | |||
| 69 | cat >> $script <<EOF | ||
| 70 | if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then | ||
| 71 | for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do | ||
| 72 | . \$envfile | ||
| 73 | done | ||
| 74 | fi | ||
| 75 | # We have to unset this else it can confuse oe-selftest and other tools | ||
| 76 | # which may also use the overlapping namespace. | ||
| 77 | unset OECORE_NATIVE_SYSROOT | ||
| 78 | EOF | ||
| 79 | |||
| 80 | if [ "${SDKMACHINE}" = "i686" ]; then | ||
| 81 | echo 'export NO32LIBS="0"' >>$script | ||
| 82 | echo 'echo "$BB_ENV_PASSTHROUGH_ADDITIONS" | grep -q "NO32LIBS"' >>$script | ||
| 83 | echo '[ $? != 0 ] && export BB_ENV_PASSTHROUGH_ADDITIONS="NO32LIBS $BB_ENV_PASSTHROUGH_ADDITIONS"' >>$script | ||
| 84 | fi | ||
| 85 | } | ||
| 86 | |||
| 87 | # buildtools-tarball doesn't need config site | ||
| 88 | TOOLCHAIN_NEED_CONFIGSITE_CACHE = "" | ||
| 89 | |||
| 90 | # The recipe doesn't need any default deps | ||
| 91 | INHIBIT_DEFAULT_DEPS = "1" | ||
