Michael Grand | 7d61b05 | 2019-02-24 23:50:46 +0100 | [diff] [blame^] | 1 | .. _zynqmp_zcu102: |
| 2 | |
| 3 | ####################### |
| 4 | QEMU for ZynqMP zcu102 |
| 5 | ####################### |
| 6 | Instructions below show how to run OP-TEE using QEMU for ZynqMP zcu102 board. |
| 7 | |
| 8 | Setting up the toolchain |
| 9 | ************************ |
| 10 | This build chain heavily relies on Petalinux 2018.2 therefore the first step is |
| 11 | to download and install the Petalinux 2018.2 toolchain from the Xilinx website |
| 12 | (`Downloads`_). By default, the makefile considers that Petalinux is installed |
| 13 | in ``/opt/Xilinx/petalinux_2018_2``. Then, you have to download the zcu102 BSP |
| 14 | file from the Xilinx website (`Downloads`_). |
| 15 | |
| 16 | You may have to create a free Xilinx account to proceed with the two previous |
| 17 | steps. |
| 18 | |
| 19 | Configuring and building |
| 20 | ************************ |
| 21 | First, 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 | |
| 28 | Then, 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 | |
| 34 | Git clone the ``build`` repository of the OP-TEE project and source the |
| 35 | Petalinux 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 | |
| 43 | Finally, use the following commands to create, patch, configure and build the |
| 44 | Petalinux project. Petalinux is a powerful but very slow tool, each command may |
| 45 | take 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 | |
| 53 | Once the last command ends up you are ready to run QEMU tool. Use the following |
| 54 | command: |
| 55 | |
| 56 | .. code-block:: bash |
| 57 | |
| 58 | $ make -f zynqmp.mk qemu |
| 59 | |
| 60 | QEMU will start and launch Petalinux distribution. At the end of the boot |
| 61 | process, log in using username ``root`` and password ``root``. Start the OP-TEE |
| 62 | Normal World service and run xtest: |
| 63 | |
| 64 | .. code-block:: bash |
| 65 | |
| 66 | $ tee-supplicant -d |
| 67 | $ xtest |
| 68 | |
| 69 | You can close QEMU session at any time by typing ``Ctrl-A+C`` and entering the |
| 70 | ``quit`` command. |
| 71 | |
| 72 | QEMU for other ZynqMP boards |
| 73 | ****************************** |
| 74 | This makefile supports other ZynqMP boards: |
| 75 | |
| 76 | * zcu104 |
| 77 | * zcu106 |
| 78 | |
| 79 | To use this makefile with these boards, you have to download corresponding BSP |
| 80 | and 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 | |
| 89 | Building a given version of OP-TEE |
| 90 | ********************************** |
| 91 | By default, the lastest version of OP-TEE is built. If you wish you can build a |
| 92 | given version of OP-TEE instead of the last one by using variable ``OPTEE_VER`` |
| 93 | with target ``petalinux-config``. See below an example where OP-TEE v3.4.0 is |
| 94 | built. |
| 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 | |
| 102 | Customizing the Petalinux distribution |
| 103 | ************************************** |
| 104 | You can customize the Petalinux project (i.e. kernel, rootfs, ...) as any |
| 105 | standard Petalinux project. Just enter the project directory and type your |
| 106 | commands. 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 |