aboutsummaryrefslogtreecommitdiffstats
path: root/meta-xilinx-bsp/README.building.md
blob: b127db3637eeaf6c43b046f2a08f4bba61b23294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Build Instructions
==================

The following instructions require OE-Core meta and BitBake. Poky provides these
components, however they can be acquired separately.

Initialize a build using the `oe-init-build-env` script. Once initialized
configure `bblayers.conf` by adding the `meta-xilinx-bsp` and
`meta-xilinx-contrib` layer. e.g.:

	BBLAYERS ?= " \
		<path to layer>/oe-core/meta \
		<path to layer>/meta-xilinx-bsp \
		<path to layer>/meta-xilinx-standalone \
		<path to layer>/meta-xilinx-contrib \
		"

meta-xilinx-standalone layer provides recipes which enable building baremetal
toolchain for PMU firmware. This layer is required for ZU+ devices which
depends on PMU firmware

meta-xilinx-contrib is a contribution layer and is optional.

To build a specific target BSP configure the associated machine in `local.conf`:

	MACHINE ?= "zc702-zynq7"

Build the target file system image using `bitbake`:

	$ bitbake core-image-minimal

Once complete the images for the target machine will be available in the output
directory `tmp/deploy/images/<machine name>/`.

Using SPL flow to build ZU+
------------------------------

The pmufw needs a "configuration object" to know what it should do, and it
expects to receive it at runtime.

With the U-Boot SPL workflow there's no FSBL, and passing a cfg obj to pmufw is
just not implemented in U-Boot

To work around this problem a small patch has been developed so that
pm_cfg_obj.c is linked into pmufw and loaded directly, without waiting for it
from the outside. Find the original patch on the meta-topic layer [1] and the
patch updated for pmufw 2018.x here [2].

[1]
https://github.com/topic-embedded-products/meta-topic/blob/master/recipes-bsp/pmu-firmware/pmu-firmware_2017.%25.bbappend

[2]
https://github.com/lucaceresoli/zynqmp-pmufw-builder/blob/master/0001-Load-XPm_ConfigObject-at-boot.patch


Using multiconfig to build ZU+
------------------------------

multiconfig dependency has to be added in image file or local.conf.
For example in core-image-minimal you will need  
do_image[mcdepends] = "multiconfig:zcu102:pmu:pmu-firmware:do_deploy"

Add conf/multiconfig in the build directory and create pmu.conf and zcu102.conf

Add the following in pmu.conf:  
	MACHINE="zynqmp-pmu"  
	DISTRO="xilinx-standalone"  
    	GCCVERSION="7.%"  
    	TMPDIR="${TOPDIR}/pmutmp"  

Add the following in zcu102.conf:  
	MACHINE="zcu102-zynqmp"  
    	DISTRO="poky"  

In local.conf multiconfig is enabled by: BBMULTICONFIG ?= "zcu102 pmu"

bitbake multiconfig:zcu102:core-image-minimal  

More information about multiconfig:
https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#dev-building-images-for-multiple-targets-using-multiple-configurations

Workaround:  
There is additional workaround required in u-boot-xlnx recipe. Add the below dependency  
do_compile[mcdepends] = "multiconfig:zcu102:pmu:pmu-firmware:do_deploy"


Additional Information
----------------------

For more complete details on setting up and using Yocto/OE refer to the Yocto
Project Quick Start guide available at:
	http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html