blob: 3ba775e079e686fbe798538b2a74946e69572ae1 [file] [log] [blame]
Michael Grand7d61b052019-02-24 23:50:46 +01001.. _zynqmp_zcu102:
2
3#######################
4QEMU for ZynqMP zcu102
5#######################
6Instructions below show how to run OP-TEE using QEMU for ZynqMP zcu102 board.
7
8Setting up the toolchain
9************************
10This build chain heavily relies on Petalinux 2018.2 therefore the first step is
11to download and install the Petalinux 2018.2 toolchain from the Xilinx website
12(`Downloads`_). By default, the makefile considers that Petalinux is installed
13in ``/opt/Xilinx/petalinux_2018_2``. Then, you have to download the zcu102 BSP
14file from the Xilinx website (`Downloads`_).
15
16You may have to create a free Xilinx account to proceed with the two previous
17steps.
18
19Configuring and building
20************************
21First, create a new directory which will be used as root directory:
22
23.. code-block:: bash
24
25 $ mkdir -p ~/petalinux-optee
26 $ cd ~/petalinux-optee
27
28Then, copy the zcu102 BSP file into the newly created directory:
29
30.. code-block:: bash
31
32 $ cp ~/Downloads/xilinx-zcu102-v2018.2-final.bsp .
33
34Git clone the ``build`` repository of the OP-TEE project and source the
35Petalinux settings:
36
37.. code-block:: bash
38
39 $ git clone https://github.com/OP-TEE/build
40 $ cd ./build
41 $ source /opt/Xilinx/petalinux_2018_2/settings.sh
42
43Finally, use the following commands to create, patch, configure and build the
44Petalinux project. Petalinux is a powerful but very slow tool, each command may
45take a while according to the capabilities of your computer.
46
47.. code-block:: bash
48
49 $ make -f zynqmp.mk petalinux-create
50 $ make -f zynqmp.mk petalinux-config
51 $ make -f zynqmp.mk petalinux-build
52
53Once the last command ends up you are ready to run QEMU tool. Use the following
54command:
55
56.. code-block:: bash
57
58 $ make -f zynqmp.mk qemu
59
60QEMU will start and launch Petalinux distribution. At the end of the boot
61process, log in using username ``root`` and password ``root``. Start the OP-TEE
62Normal World service and run xtest:
63
64.. code-block:: bash
65
66 $ tee-supplicant -d
67 $ xtest
68
69You can close QEMU session at any time by typing ``Ctrl-A+C`` and entering the
70``quit`` command.
71
72QEMU for other ZynqMP boards
73******************************
74This makefile supports other ZynqMP boards:
75
76 * zcu104
77 * zcu106
78
79To use this makefile with these boards, you have to download corresponding BSP
80and add option ``PLATFORM=zcu104`` or ``PLATFORM=zcu106`` to each make command.
81
82.. code-block:: bash
83
84 $ make -f zynqmp.mk PLATFORM=zcu=106 petalinux-create
85 $ make -f zynqmp.mk PLATFORM=zcu=106 petalinux-config
86 $ make -f zynqmp.mk PLATFORM=zcu=106 petalinux-build
87 $ make -f zynqmp.mk PLATFORM=zcu=106 qemu
88
89Building a given version of OP-TEE
90**********************************
91By default, the lastest version of OP-TEE is built. If you wish you can build a
92given version of OP-TEE instead of the last one by using variable ``OPTEE_VER``
93with target ``petalinux-config``. See below an example where OP-TEE v3.4.0 is
94built.
95
96.. code-block:: bash
97
98 $ make -f zynqmp.mk petalinux-create
99 $ make -f zynqmp.mk OPTEE_VER=3.4.0 petalinux-config
100 $ make -f zynqmp.mk petalinux-build
101
102Customizing the Petalinux distribution
103**************************************
104You can customize the Petalinux project (i.e. kernel, rootfs, ...) as any
105standard Petalinux project. Just enter the project directory and type your
106commands. For additional information, refer to Petalinux Tool Documentation
107(`UG1144`_).
108
109.. _UG1144: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1144-petalinux-tools-reference-guide.pdf
110.. _Downloads: https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/2018-2.html