summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2021-09-20 12:20:22 -0700
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2021-09-28 08:21:02 -0700
commit82d03b02f5929c673a9d1b6cdf139a59480dc793 (patch)
treee23cbe7d02a8f4c7edf2e473444f50471d5cff85
parent1b01972812d1044a37c9259a3bb2b9acf78bb4f9 (diff)
downloadmeta-xilinx-82d03b02f5929c673a9d1b6cdf139a59480dc793.tar.gz
meta-xilinx-setup: Bundle the configuration script
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
-rw-r--r--meta-xilinx-standalone-experimental/README.md22
-rw-r--r--meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup89
-rwxr-xr-xmeta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh679
-rw-r--r--meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb10
4 files changed, 800 insertions, 0 deletions
diff --git a/meta-xilinx-standalone-experimental/README.md b/meta-xilinx-standalone-experimental/README.md
index 3f15eeff..e49b01f2 100644
--- a/meta-xilinx-standalone-experimental/README.md
+++ b/meta-xilinx-standalone-experimental/README.md
@@ -9,6 +9,28 @@ this should be considered to be a preview release only. For instance,
9some components may not be buildable, expect APIs to change on various 9some components may not be buildable, expect APIs to change on various
10parts and pieces. 10parts and pieces.
11 11
12Build Instructions
13------------------
14Note: to use this layer you must REMOVE meta-xilinx-tools from your
15project. meta-xilinx-tools is not compatible with this experimental
16approach. You may also have to remove other layers that depend
17on meta-xilinx-tools, such as meta-som.
18
19To use the experimental version of the embedded software (firmware)
20as well as system configuration, you must build the 'meta-xilinx-setup'
21SDK. This SDK is passed a device tree, constructed from DTG++ and
22produces a number of configuration files.
23
24To build the setup SDK:
25
26MACHINE=qemux86-64 bitbake meta-xilinx-setup
27
28To install the setup SDK:
29
30./tmp/deploy/sdk/x86_64-xilinx-nativesdk-prestep-2021.2.sh -d prestep -y
31
32Then follow the instructions in the 'prestep/README-setup' file.
33
12 34
13Maintainers, Mailing list, Patches 35Maintainers, Mailing list, Patches
14================================== 36==================================
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup b/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup
new file mode 100644
index 00000000..4abaa9d5
--- /dev/null
+++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/README-setup
@@ -0,0 +1,89 @@
1Document Version: 20210920
2
3The Yocto Project setup for the new workflow is as follows. Be sure to read
4everything below, as the steps will be updated in the future if the
5setup script changes.
6
7The steps in this document expect that you have already built the setup
8(meta-xilinx-setup) SDK, and installed it.
9
10* Configure you local.conf
11
12The following items should be in your conf/local.conf. This ensures that
13the correct configurations are available, and the correct firmware version
14is selected for this workflow.
15
16# Add to the end of conf/local.conf:
17include conf/distro/include/yocto-uninative.inc
18INHERIT += "uninative"
19
20# Instruct the system to use the decoupling firmware sources,
21# add the following to the conf/local.conf:
22PREFERRED_VERSION_fsbl-firmware = "experimental%"
23PREFERRED_VERSION_pmu-firmware = "experimental%"
24PREFERRED_VERSION_plm-firmware = "experimental%"
25PREFERRED_VERSION_psm-firmware = "experimental%"
26
27* Run the setup script
28
29The setup environment should be run in a new shell (not the build shell)
30to ensure that you do not contaminate the environment for your build.
31
32We will assume below that the directory "prestep" was used for the SDK,
33however you may use any path you wish.
34
35# Source the SDK environment file
36. <build>/prestep/environment-setup-x86_64-petalinux-linux
37
38# Run the script from the same directory as this README
39<build>/prestep//dt-processor.sh <path_to_conf> <dtb>
40
41# For example, zynqmp:
42# <build>/prestep/dt-processor.sh <build>/conf <device-tree>/zu-sep13-sdt/system-top.dts
43#
44# Follow the instructions returned by the script!
45# Such as:
46#To enable this, add the following to your local.conf:
47#
48#require conf/cortexa53-zynqmp-linux.conf
49#SYSTEM_DTFILE = "/proj/yocto/zu-sep13-sdt/system-top.dts"
50#BBMULTICONFIG += " cortexa53-zynqmp-fsbl-baremetal cortexa53-zynqmp-baremetal cortexr5-zynqmp-baremetal microblaze-pmu"
51#FSBL_DEPENDS = ""
52#FSBL_MCDEPENDS = "mc::cortexa53-zynqmp-fsbl-baremetal:fsbl-firmware:do_deploy"
53#FSBL_DEPLOY_DIR = "${TOPDIR}/tmp-cortexa53-zynqmp-fsbl-baremetal/deploy/images/${MACHINE}"
54#PMU_DEPENDS = ""
55#PMU_MCDEPENDS = "mc::microblaze-pmu:pmu-firmware:do_deploy"
56#PMU_FIRMWARE_DEPLOY_DIR = "${TOPDIR}/tmp-microblaze-pmu/deploy/images/${MACHINE}"
57#
58# OR
59#
60# Versal:
61# <build>/prestep/dt-processor.sh <build>/conf <device-tree>/vck190-sdt/system-top.dts
62#
63# Follow the instructions returned by the script!
64# Such as:
65#To enable this, add the following to your local.conf:
66#
67#require conf/cortexa72-versal-linux.conf
68#SYSTEM_DTFILE = "/proj/yocto/vck190-sdt/system-top.dts"
69#BBMULTICONFIG += " cortexa72-versal-baremetal microblaze-pmc microblaze-psm cortexr5-versal-baremetal"
70#PLM_DEPENDS = ""
71#PLM_MCDEPENDS = "mc::microblaze-pmc:plm-firmware:do_deploy"
72#PLM_DEPLOY_DIR = "${TOPDIR}/tmp-microblaze-pmc/deploy/images/${MACHINE}"
73#PSM_DEPENDS = ""
74#PSM_MCDEPENDS = "mc::microblaze-psm:psm-firmware:do_deploy"
75#PSM_FIRMWARE_DEPLOY_DIR = "${TOPDIR}/tmp-microblaze-psm/deploy/images/${MACHINE}"
76#PDI_PATH = "__PATH TO PDI FILE HERE__"
77
78# NOTE: On versal, you MUST specify the PDI file as directed by the instructions.
79# such as: PDI_PATH = "__PATH TO PDI FILE HERE__"
80# Use the full path to the corresponding PDI file, such as:
81PDI_PATH = "/proj/yocto/vck190-sdt/base-design.pdi"
82
83# _EXIT THE NEW SHELL_ return the build environment
84
85### In the original build shell
86# Build your Linux sytem:
87bitbake petalinux-image-minimal
88
89# The output will be in tmp/deploy/images/...
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
new file mode 100755
index 00000000..5d1118ff
--- /dev/null
+++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
@@ -0,0 +1,679 @@
1#! /bin/bash
2
3if [ $# -lt 2 ]; then
4 echo "Usage:"
5 echo " $0 <conf_dir> <system_dtb> [<machine_type>]"
6 echo
7 echo " conf_dir - location for the build conf directory"
8 echo " system_dtb - Full patch to the system dtb"
9 echo " machine_type - zynq, zynqmp or versal"
10 echo
11 exit 1
12fi
13
14if [ ! -f $1/local.conf ]; then
15 echo "$1 does not look like a conf directory."
16 exit 1
17fi
18conf_dir=$1
19
20if [ ! -f $2 ]; then
21 echo "Unable to find $2." >&2
22 exit 1
23fi
24dtb=$2
25
26# We'll autodetect if blank (later)
27machine=$3
28
29lopper=$(which lopper.py)
30
31if [ -z "$lopper" ]; then
32 echo "Unable to find lopper.py, did you source the prestep environment file?" >&2
33 exit 1
34fi
35
36lops_dir=$(dirname $(dirname $lopper))/share/lopper/lops
37embeddedsw=$(dirname $(dirname $lopper))/share/embeddedsw
38
39system_conf=""
40multiconf=""
41
42detect_machine() {
43 # Lets identify the system type first. We can use PSM/PMC/PMU for this...
44 while read cpu domain os_hint ; do
45 case ${cpu} in
46 pmu-microblaze)
47 machine="zynqmp"
48 return
49 ;;
50 pmc-microblaze | psm-microblaze)
51 machine="versal"
52 return
53 ;;
54 esac
55 done < cpu-list.tmp
56 echo "ERROR: Unable to auto-detect the machine type."
57 exit 1
58}
59
60cortex_a53_linux() {
61 if [ $1 = "None" ]; then
62 dtb_file="cortexa53-${machine}-linux.dtb"
63 system_conf=conf/cortexa53-${machine}-linux.conf
64 conf_file=cortexa53-${machine}-linux.conf
65 else
66 dtb_file="cortexa53-${machine}-${1}-linux.dtb"
67 multiconf="${multiconf} cortexa53-${machine}-linux"
68 conf_file=multiconfig/cortexa53-${machine}-${1}-linux.conf
69 fi
70
71 mkdir -p dtb
72 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a53-imux.dts -i ${lops_dir}/lop-domain-linux-a53.dts ${dtb} ${dtb_file} && rm -f lop-a53-imux.dts.dtb lop-domain-linux-a53.dts.dtb)
73
74 cat << EOF > ${conf_file}
75CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
76MACHINE = "${machine}-generic"
77# Override the SYSTEM_DTFILE for Linux builds
78SYSTEM_DTFILE = "${CONFIG_DTFILE}"
79# We don't want the kernel to build us a device-tree
80KERNEL_DEVICETREE_${machine}-generic = ""
81# We need u-boot to use the one we passed in
82DEVICE_TREE_NAME_pn-u-boot-zynq-scr = "\${@os.path.basename(d.getVar('CONFIG_DTFILE'))}"
83# Update bootbin to use proper device tree
84BIF_PARTITION_IMAGE[device-tree] = "\${RECIPE_SYSROOT}/boot/devicetree/\${@os.path.basename(d.getVar('CONFIG_DTFILE'))}"
85EOF
86}
87
88fsbl_done=0
89cortex_a53_baremetal() {
90 if [ $1 = "fsbl" -a $fsbl_done != 0 ]; then
91 return
92 elif [ $1 = "fsbl" ] ; then
93 echo "Building FSBL baremetal configuration"
94 fsbl_done=1
95 fi
96 if [ $1 = "None" ]; then
97 dtb_file="cortexa53-${machine}-baremetal.dtb"
98 multiconf="${multiconf} cortexa53-${machine}-baremetal"
99 conf_file="multiconfig/cortexa53-${machine}-baremetal.conf"
100 libxil="multiconfig/includes/cortexa53-${machine}-libxil.conf"
101 distro="multiconfig/includes/cortexa53-${machine}-distro.conf"
102 yocto_distro="xilinx-standalone-nolto"
103 else
104 dtb_file="cortexa53-${machine}-${1}-baremetal.dtb"
105 multiconf="${multiconf} cortexa53-${machine}-${1}-baremetal"
106 conf_file="multiconfig/cortexa53-${machine}-${1}-baremetal.conf"
107 libxil="multiconfig/includes/cortexa53-${machine}-${1}-libxil.conf"
108 distro="multiconfig/includes/cortexa53-${machine}-${1}-distro.conf"
109 yocto_distro="xilinx-standalone"
110 fi
111 if [ $1 = "fsbl" ]; then
112 fsbl_mcdepends="mc::${dtb_file%%.dtb}:fsbl-firmware:do_deploy"
113 fsbl_deploy_dir="\${TOPDIR}/tmp-${dtb_file%%.dtb}/deploy/images/\${MACHINE}"
114 fi
115
116 # Build device tree
117 mkdir -p dtb
118 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a53-imux.dts ${dtb} ${dtb_file} && rm -f lop-a53-imux.dts.dtb)
119
120 # Build baremetal multiconfig
121 mkdir -p multiconfig/includes
122 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexa53-${machine} $embeddedsw
123 mv libxil.conf ${libxil}
124 mv distro.conf ${distro}
125 cat << EOF > ${conf_file}
126CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
127ESW_MACHINE = "cortexa53-${machine}"
128DEFAULTTUNE = "cortexa53"
129
130TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
131
132DISTRO = "$yocto_distro"
133
134LIBXIL_CONFIG = "conf/${libxil}"
135require conf/${distro}
136EOF
137}
138
139cortex_a53_freertos() {
140 if [ $1 = "None" ]; then
141 dtb_file="cortexa53-${machine}-freertos.dtb"
142 multiconf="${multiconf} cortexa53-${machine}-freertos"
143 conf_file="multiconfig/cortexa53-${machine}-freertos.conf"
144 libxil="multiconfig/includes/cortexa53-${machine}-libxil.conf"
145 distro="multiconfig/includes/cortexa53-${machine}-distro.conf"
146 else
147 dtb_file="cortexa53-${machine}-${1}-freertos.dtb"
148 multiconf="${multiconf} cortexa53-${machine}-${1}-freertos"
149 conf_file="multiconfig/cortexa53-${machine}-${1}-freertos.conf"
150 libxil="multiconfig/includes/cortexa53-${machine}-${1}-libxil.conf"
151 distro="multiconfig/includes/cortexa53-${machine}-${1}-distro.conf"
152 fi
153
154 # Build device tree
155 mkdir -p dtb
156 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a53-imux.dts ${dtb} ${dtb_file} && rm -f lop-a53-imux.dts.dtb)
157
158 # Build baremetal multiconfig
159 mkdir -p multiconfig/includes
160 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexa53-${machine} $embeddedsw
161 mv libxil.conf ${libxil}
162 mv distro.conf ${distro}
163 cat << EOF > ${conf_file}
164CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
165ESW_MACHINE = "cortexa53-${machine}"
166DEFAULTTUNE = "cortexa53"
167
168TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
169
170DISTRO = "xilinx-freertos"
171
172LIBXIL_CONFIG = "conf/${libxil}"
173require conf/${distro}
174EOF
175}
176
177cortex_a72_linux() {
178 if [ $1 = "None" ]; then
179 dtb_file="cortexa72-${machine}-linux.dtb"
180 system_conf=conf/cortexa72-${machine}-linux.conf
181 conf_file=cortexa72-${machine}-linux.conf
182 else
183 dtb_file="cortexa72-${machine}-${1}-linux.dtb"
184 multiconf="${multiconf} cortexa72-${machine}-linux"
185 conf_file=multiconfig/cortexa72-${machine}-${1}-linux.conf
186 fi
187
188 mkdir -p dtb
189 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a72-imux.dts -i ${lops_dir}/lop-domain-a72.dts ${dtb} ${dtb_file} && rm -f lop-a72-imux.dts.dtb lop-domain-a72.dts.dtb)
190
191 cat << EOF > ${conf_file}
192CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
193MACHINE = "${machine}-generic"
194# Override the SYSTEM_DTFILE for Linux builds
195SYSTEM_DTFILE = "${CONFIG_DTFILE}"
196# We don't want the kernel to build us a device-tree
197KERNEL_DEVICETREE_${machine}-generic = ""
198# We need u-boot to use the one we passed in
199DEVICE_TREE_NAME_pn-u-boot-zynq-scr = "\${@os.path.basename(d.getVar('CONFIG_DTFILE'))}"
200# Update bootbin to use proper device tree
201BIF_PARTITION_IMAGE[device-tree] = "\${RECIPE_SYSROOT}/boot/devicetree/\${@os.path.basename(d.getVar('CONFIG_DTFILE'))}"
202EOF
203}
204
205cortex_a72_baremetal() {
206 if [ $1 = "None" ]; then
207 dtb_file="cortexa72-${machine}-baremetal.dtb"
208 multiconf="${multiconf} cortexa72-${machine}-baremetal"
209 conf_file="multiconfig/cortexa72-${machine}-baremetal.conf"
210 libxil="multiconfig/includes/cortexa72-${machine}-libxil.conf"
211 distro="multiconfig/includes/cortexa72-${machine}-distro.conf"
212 else
213 dtb_file="cortexa72-${machine}-${1}-baremetal.dtb"
214 multiconf="${multiconf} cortexa72-${machine}-${1}-baremetal"
215 conf_file="multiconfig/cortexa72-${machine}-${1}-baremetal.conf"
216 libxil="multiconfig/includes/cortexa72-${machine}-${1}-libxil.conf"
217 distro="multiconfig/includes/cortexa72-${machine}-${1}-distro.conf"
218 fi
219
220 # Build device tree
221 mkdir -p dtb
222 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a72-imux.dts ${dtb} ${dtb_file} && rm -f lop-a72-imux.dts.dtb)
223
224 # Build baremetal multiconfig
225 mkdir -p multiconfig/includes
226 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexa72-${machine} $embeddedsw
227 mv libxil.conf ${libxil}
228 mv distro.conf ${distro}
229 cat << EOF > ${conf_file}
230CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
231ESW_MACHINE = "cortexa72-${machine}"
232DEFAULTTUNE = "cortexa72"
233
234TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
235
236DISTRO = "xilinx-standalone-nolto"
237
238LIBXIL_CONFIG = "conf/${libxil}"
239require conf/${distro}
240EOF
241}
242
243cortex_a72_freertos() {
244 if [ $1 = "None" ]; then
245 dtb_file="cortexa72-${machine}-freertos.dtb"
246 multiconf="${multiconf} cortexa72-${machine}-freertos"
247 conf_file="multiconfig/cortexa72-${machine}-freertos.conf"
248 libxil="multiconfig/includes/cortexa72-${machine}-libxil.conf"
249 distro="multiconfig/includes/cortexa72-${machine}-distro.conf"
250 else
251 dtb_file="cortexa72-${machine}-${1}-freertos.dtb"
252 multiconf="${multiconf} cortexa72-${machine}-${1}-freertos"
253 conf_file="multiconfig/cortexa72-${machine}-${1}-freertos.conf"
254 libxil="multiconfig/includes/cortexa72-${machine}-${1}-libxil.conf"
255 distro="multiconfig/includes/cortexa72-${machine}-${1}-distro.conf"
256 fi
257
258 # Build device tree
259 mkdir -p dtb
260 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-a72-imux.dts ${dtb} ${dtb_file} && rm -f lop-a72-imux.dts.dtb)
261
262 # Build baremetal multiconfig
263 mkdir -p multiconfig/includes
264 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexa72-${machine} $embeddedsw
265 mv libxil.conf ${libxil}
266 mv distro.conf ${distro}
267 cat << EOF > ${conf_file}
268CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
269ESW_MACHINE = "cortexa72-${machine}"
270DEFAULTTUNE = "cortexa72"
271
272TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
273
274DISTRO = "xilinx-freertos"
275
276LIBXIL_CONFIG = "conf/${libxil}"
277require conf/${distro}
278EOF
279}
280
281cortex_r5_baremetal() {
282 if [ $1 = "None" ]; then
283 dtb_file="cortexr5-${machine}-baremetal.dtb"
284 multiconf="${multiconf} cortexr5-${machine}-baremetal"
285 conf_file="multiconfig/cortexr5-${machine}-baremetal.conf"
286 libxil="multiconfig/includes/cortexr5-${machine}-libxil.conf"
287 distro="multiconfig/includes/cortexr5-${machine}-distro.conf"
288 else
289 dtb_file="cortexr5-${machine}-${1}-baremetal.dtb"
290 multiconf="${multiconf} cortexr5-${machine}-${1}-baremetal"
291 conf_file="multiconfig/cortexr5-${machine}-${1}-baremetal.conf"
292 libxil="multiconfig/includes/cortexr5-${machine}-${1}-libxil.conf"
293 distro="multiconfig/includes/cortexr5-${machine}-${1}-distro.conf"
294 fi
295
296 # Build device tree
297 mkdir -p dtb
298 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-r5-imux.dts ${dtb} ${dtb_file} && rm -f lop-r5-imux.dts.dtb)
299
300 # Build baremetal multiconfig
301 mkdir -p multiconfig/includes
302 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexr5-${machine} $embeddedsw
303 mv libxil.conf ${libxil}
304 mv distro.conf ${distro}
305 cat << EOF > ${conf_file}
306CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
307ESW_MACHINE = "cortexr5-${machine}"
308DEFAULTTUNE = "cortexr5f"
309
310TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
311
312DISTRO = "xilinx-standalone-nolto"
313
314LIBXIL_CONFIG = "conf/${libxil}"
315require conf/${distro}
316EOF
317}
318
319cortex_r5_freertos() {
320 if [ $1 = "None" ]; then
321 dtb_file="cortexr5-${machine}-freertos.dtb"
322 multiconf="${multiconf} cortexr5-${machine}-freertos"
323 conf_file="multiconfig/cortexr5-${machine}-freertos.conf"
324 libxil="multiconfig/includes/cortexr5-${machine}-libxil.conf"
325 distro="multiconfig/includes/cortexr5-${machine}-distro.conf"
326 else
327 dtb_file="cortexr5-${machine}-${1}-freertos.dtb"
328 multiconf="${multiconf} cortexr5-${machine}-${1}-freertos"
329 conf_file="multiconfig/cortexr5-${machine}-${1}-freertos.conf"
330 libxil="multiconfig/includes/cortexr5-${machine}-${1}-libxil.conf"
331 distro="multiconfig/includes/cortexr5-${machine}-${1}-distro.conf"
332 fi
333
334 # Build device tree
335 mkdir -p dtb
336 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${lops_dir}/lop-r5-imux.dts ${dtb} ${dtb_file} && rm -f lop-r5-imux.dts.dtb)
337
338 # Build baremetal multiconfig
339 mkdir -p multiconfig/includes
340 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx cortexr5-${machine} $embeddedsw
341 mv libxil.conf ${libxil}
342 mv distro.conf ${distro}
343 cat << EOF > ${conf_file}
344CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
345ESW_MACHINE = "cortexr5-${machine}"
346DEFAULTTUNE = "cortexr5f"
347
348TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
349
350DISTRO = "xilinx-freertos"
351
352LIBXIL_CONFIG = "conf/${libxil}"
353require conf/${distro}
354EOF
355}
356
357# Generate microblaze tunings
358microblaze_done=0
359# Generate microblaze tunings
360microblaze_done=0
361process_microblaze() {
362 if [ ${microblaze_done} = 0 ]; then
363 echo -n "Generating microblaze processor tunes..."
364 # Process microblaze
365 mkdir -p dtb
366 (cd dtb ; lopper.py -f --enhanced -i ${lops_dir}/lop-microblaze-yocto.dts ${dtb} && rm -f lop-microblaze-yocto.dts.dtb) > microblaze.conf
367 microblaze_done=1
368 echo "...done"
369 fi
370}
371
372# pmu-microblaze is ALWAYS baremetal, no domain
373pmu-microblaze() {
374 dtb_file="microblaze-pmu.dtb"
375 multiconf="${multiconf} microblaze-pmu"
376 conf_file="multiconfig/microblaze-pmu.conf"
377 libxil="multiconfig/includes/microblaze-pmu-libxil.conf"
378 distro="multiconfig/includes/microblaze-pmu-distro.conf"
379
380 pmu_mcdepends="mc::${dtb_file%%.dtb}:pmu-firmware:do_deploy"
381 pmu_firmware_deploy_dir="\${TOPDIR}/tmp-${dtb_file%%.dtb}/deploy/images/\${MACHINE}"
382
383 # Build device tree
384 mkdir -p dtb
385 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f ${dtb} ${dtb_file})
386
387 # Build baremetal multiconfig
388 mkdir -p multiconfig/includes
389 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx microblaze-pmu $embeddedsw
390 mv libxil.conf ${libxil}
391 mv distro.conf ${distro}
392 cat << EOF > ${conf_file}
393CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
394ESW_MACHINE = "microblaze-pmu"
395
396require conf/microblaze.conf
397DEFAULTTUNE = "microblaze"
398TUNE_FEATURES_tune-microblaze_forcevariable = "\${TUNE_FEATURES_tune-pmu-microblaze}"
399
400TARGET_CFLAGS += "-DPSU_PMU=1U"
401
402TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
403
404DISTRO = "xilinx-standalone"
405
406LIBXIL_CONFIG = "conf/${libxil}"
407require conf/${distro}
408EOF
409}
410
411# pmc-microblaze is ALWAYS baremetal, no domain
412pmc-microblaze() {
413 dtb_file="microblaze-pmc.dtb"
414 multiconf="${multiconf} microblaze-pmc"
415 conf_file="multiconfig/microblaze-pmc.conf"
416 libxil="multiconfig/includes/microblaze-pmc-libxil.conf"
417 distro="multiconfig/includes/microblaze-pmc-distro.conf"
418
419 plm_mcdepends="mc::${dtb_file%%.dtb}:plm-firmware:do_deploy"
420 plm_deploy_dir="\${TOPDIR}/tmp-${dtb_file%%.dtb}/deploy/images/\${MACHINE}"
421
422 # Build device tree
423 mkdir -p dtb
424 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f ${dtb} ${dtb_file})
425
426 # Build baremetal multiconfig
427 mkdir -p multiconfig/includes
428 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx microblaze-plm $embeddedsw
429 mv libxil.conf ${libxil}
430 mv distro.conf ${distro}
431 cat << EOF > ${conf_file}
432CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
433ESW_MACHINE = "microblaze-plm"
434
435require conf/microblaze.conf
436DEFAULTTUNE = "microblaze"
437TUNE_FEATURES_tune-microblaze_forcevariable = "\${TUNE_FEATURES_tune-pmc-microblaze}"
438
439TARGET_CFLAGS += "-DVERSAL_PLM=1"
440
441TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
442
443DISTRO = "xilinx-standalone"
444
445LIBXIL_CONFIG = "conf/${libxil}"
446require conf/${distro}
447EOF
448}
449
450# psm-microblaze is ALWAYS baremetal, no domain
451psm-microblaze() {
452 dtb_file="microblaze-psm.dtb"
453 multiconf="${multiconf} microblaze-psm"
454 conf_file="multiconfig/microblaze-psm.conf"
455 libxil="multiconfig/includes/microblaze-psm-libxil.conf"
456 distro="multiconfig/includes/microblaze-psm-distro.conf"
457
458 psm_mcdepends="mc::${dtb_file%%.dtb}:psm-firmware:do_deploy"
459 psm_firmware_deploy_dir="\${TOPDIR}/tmp-${dtb_file%%.dtb}/deploy/images/\${MACHINE}"
460
461 # Build device tree
462 mkdir -p dtb
463 (cd dtb ; LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f ${dtb} ${dtb_file})
464
465 # Build baremetal multiconfig
466 mkdir -p multiconfig/includes
467 lopper.py -f ${dtb} -- baremetaldrvlist_xlnx microblaze-psm $embeddedsw
468 mv libxil.conf ${libxil}
469 mv distro.conf ${distro}
470 cat << EOF > ${conf_file}
471CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
472ESW_MACHINE = "microblaze-psm"
473
474require conf/microblaze.conf
475DEFAULTTUNE = "microblaze"
476TUNE_FEATURES_tune-microblaze_forcevariable = "\${TUNE_FEATURES_tune-psm-microblaze}"
477
478TARGET_CFLAGS += "-DVERSAL_psm=1"
479
480TMPDIR = "\${TOPDIR}/tmp-${dtb_file%%.dtb}"
481
482DISTRO = "xilinx-standalone"
483
484LIBXIL_CONFIG = "conf/${libxil}"
485require conf/${distro}
486EOF
487}
488
489parse_cpus() {
490 while read cpu domain os_hint ; do
491 case ${cpu} in
492 \#* | \[WARNING\]:) continue ;;
493 esac
494 if [ ${domain} != "None" ]; then
495 echo "Warning: Domains are not yet supported, the generated DTB may be incorrect. ${domain}"
496 fi
497 case ${cpu} in
498 arm,cortex-a53)
499 # We need a base cortex_a53_baremetl for the FSBL
500 cortex_a53_baremetal fsbl
501 if [ ${os_hint} == "None" ]; then
502 echo "cortex-a53 for Linux"
503 cortex_a53_linux ${domain}
504 echo "cortex-a53 for Baremetal"
505 cortex_a53_baremetal ${domain}
506 echo "cortex-a53 for Freertos"
507 cortex_a53_freertos ${domain}
508 else
509 case ${os_hint} in
510 linux*)
511 echo "cortex-a53 for Linux ${domain}"
512 cortex_a53_linux ${domain}
513 ;;
514 baremetal*)
515 echo "cortex-a53 for Baremetal ${domain}"
516 cortex_a53_baremetal ${domain}
517 ;;
518 freertos*)
519 echo "cortex-a53 for Freertos ${domain}"
520 cortex_a53_freertos ${domain}
521 ;;
522 *)
523 echo "Warning: cortex-a53 for unknown OS (${os_hint}), parsing baremetal. ${domain}"
524 cortex_a53_baremetal ${domain}
525 ;;
526 esac
527 fi
528 ;;
529 arm,cortex-a72)
530 if [ ${os_hint} == "None" ]; then
531 echo "cortex-a72 for Linux"
532 cortex_a72_linux ${domain}
533 echo "cortex-a72 for Baremetal"
534 cortex_a72_baremetal ${domain}
535 echo "cortex-a72 for Freertos"
536 cortex_a72_freertos ${domain}
537 else
538 case ${os_hint} in
539 linux*)
540 echo "cortex-a72 for Linux ${domain}"
541 cortex_a72_linux ${domain}
542 ;;
543 baremetal*)
544 echo "cortex-a72 for Baremetal ${domain}"
545 cortex_a72_baremetal ${domain}
546 ;;
547 freertos*)
548 echo "cortex-a72 for Freertos ${domain}"
549 cortex_a72_freertos ${domain}
550 ;;
551 *)
552 echo "Warning: cortex-a72 for unknown OS (${os_hint}), parsing baremetal. ${domain}"
553 cortex_a72_baremetal ${domain}
554 ;;
555 esac
556 fi
557 ;;
558 arm,cortex-r5)
559 if [ ${os_hint} == "None" ]; then
560 echo "cortex-r5 for Baremetal"
561 cortex_r5_baremetal ${domain}
562 echo "cortex-r5 for Freertos"
563 cortex_r5_freertos ${domain}
564 else
565 case ${os_hint} in
566 baremetal*)
567 echo "cortex-r5 for Baremetal ${domain}"
568 cortex_r5_baremetal ${domain}
569 ;;
570 freertos*)
571 echo "cortex-r5 for Freertos ${domain}"
572 cortex_r5_freertos ${domain}
573 ;;
574 *)
575 echo "Warning: cortex-r5 for unknown OS (${os_hint}), parsing baremetal. ${domain}"
576 cortex_r5_baremetal ${domain}
577 ;;
578 esac
579 fi
580 ;;
581 xlnx,microblaze)
582 process_microblaze
583 case ${os_hint} in
584 None | baremetal*)
585 echo "Warning: Microblaze for Baremetal ${domain} not yet implemented"
586 ;;
587 Linux)
588 echo "Warning: Microblaze for Linux ${domain} not yet implemented"
589 ;;
590 *)
591 echo "Warning: Microblaze for unknown OS (${os_hint}), not yet implemented. ${domain}"
592 ;;
593 esac
594 ;;
595 pmu-microblaze)
596 process_microblaze
597 echo "Microblaze ZynqMP pmu"
598 pmu-microblaze
599 ;;
600 pmc-microblaze)
601 process_microblaze
602 echo "Microblaze Versal pmc"
603 pmc-microblaze
604 ;;
605 psm-microblaze)
606 process_microblaze
607 echo "Microblaze Versal psm"
608 psm-microblaze
609 ;;
610 *)
611 echo "Unknown CPU ${cpu}"
612 ;;
613 esac
614 done < cpu-list.tmp
615}
616
617# Generate CPU list
618cd ${conf_dir}
619mkdir -p dtb
620(cd dtb ; lopper.py -f --enhanced -i ${lops_dir}/lop-xilinx-id-cpus.dts ${dtb} /dev/null && rm -f lop-xilinx-id-cpus.dts.dtb) > cpu-list.tmp
621
622if [ -z ${machine} ]; then
623 detect_machine
624 echo "Autodetected machine ${machine}"
625else
626 echo "Machine ${machine}"
627fi
628
629case ${machine} in
630 zynqmp | versal) : ;;
631 *)
632 echo "ERROR: Unknown machine type ${machine}"
633 exit 1
634 ;;
635esac
636
637echo
638echo "Generating configuration..."
639
640parse_cpus
641
642echo "...done"
643echo
644echo
645
646# Cleanup our temp file
647rm cpu-list.tmp
648
649echo "To enable this, add the following to your local.conf:"
650echo
651if [ -n "${system_conf}" ]; then
652 echo "require ${system_conf}"
653fi
654echo 'SYSTEM_DTFILE = "'${dtb}'"'
655echo 'BBMULTICONFIG += "'${multiconf}'"'
656if [ -n "${fsbl_mcdepends}" ]; then
657 echo 'FSBL_DEPENDS = ""'
658 echo 'FSBL_MCDEPENDS = "'${fsbl_mcdepends}'"'
659 echo 'FSBL_DEPLOY_DIR = "'${fsbl_deploy_dir}'"'
660fi
661if [ -n "${pmu_mcdepends}" ]; then
662 echo 'PMU_DEPENDS = ""'
663 echo 'PMU_MCDEPENDS = "'${pmu_mcdepends}'"'
664 echo 'PMU_FIRMWARE_DEPLOY_DIR = "'${pmu_firmware_deploy_dir}'"'
665fi
666if [ -n "${plm_mcdepends}" ]; then
667 echo 'PLM_DEPENDS = ""'
668 echo 'PLM_MCDEPENDS = "'${plm_mcdepends}'"'
669 echo 'PLM_DEPLOY_DIR = "'${plm_deploy_dir}'"'
670fi
671if [ -n "${psm_mcdepends}" ]; then
672 echo 'PSM_DEPENDS = ""'
673 echo 'PSM_MCDEPENDS = "'${psm_mcdepends}'"'
674 echo 'PSM_FIRMWARE_DEPLOY_DIR = "'${psm_firmware_deploy_dir}'"'
675fi
676if [ "${machine}" = "versal" ]; then
677 echo 'PDI_PATH = "__PATH TO PDI FILE HERE__"'
678fi
679echo
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
index e9ccd07e..86d988c6 100644
--- a/meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb
+++ b/meta-xilinx-standalone-experimental/recipes-core/meta/meta-xilinx-setup.bb
@@ -1,6 +1,13 @@
1DESCRIPTION = "Xilinx Device Tree based configuration generator" 1DESCRIPTION = "Xilinx Device Tree based configuration generator"
2LICENSE = "MIT" 2LICENSE = "MIT"
3 3
4SRC_URI += " \
5 file://dt-processor.sh \
6 file://README-setup \
7"
8
9LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
10
4TOOLCHAIN_TARGET_TASK ?= "" 11TOOLCHAIN_TARGET_TASK ?= ""
5 12
6TOOLCHAIN_HOST_TASK ?= "\ 13TOOLCHAIN_HOST_TASK ?= "\
@@ -39,6 +46,9 @@ do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
39REAL_MULTIMACH_TARGET_SYS = "none" 46REAL_MULTIMACH_TARGET_SYS = "none"
40 47
41create_sdk_files_append () { 48create_sdk_files_append () {
49 install -m 0644 ${WORKDIR}/README-setup ${SDK_OUTPUT}/${SDKPATH}/.
50 install -m 0755 ${WORKDIR}/dt-processor.sh ${SDK_OUTPUT}/${SDKPATH}/.
51
42 rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-* 52 rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
43 rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-* 53 rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
44 rm -f ${SDK_OUTPUT}/${SDKPATH}/version-* 54 rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*