Margarita Glushkin | 3856c6f | 2023-05-24 16:37:56 +0300 | [diff] [blame^] | 1 | .. _nuvoton: |
| 2 | |
| 3 | ####### |
| 4 | NUVOTON |
| 5 | ####### |
| 6 | |
| 7 | The instructions here will tell how to build and run OP-TEE OS |
| 8 | for Nuvoton platform standalone (not as a part of openbmc image). |
| 9 | |
| 10 | |
| 11 | .. _nuvoton_build_instructions: |
| 12 | |
| 13 | Build instructions |
| 14 | ****************** |
| 15 | |
| 16 | ================= |
| 17 | Pre-requirements: |
| 18 | ================= |
| 19 | |
| 20 | #. Install prerequisites according to the :ref:`prerequisites` page.` |
| 21 | |
| 22 | #. Download the latest IGPS from the Nuvoton Israel GitHub repository |
| 23 | |
| 24 | .. code-block:: bash |
| 25 | |
| 26 | $ git clone https://github.com/Nuvoton-Israel/igps-npcm8xx |
| 27 | |
| 28 | #. Download and extract the latest Linux based Arm GNU Toolchain |
| 29 | for aarch64 bare-metal target, for example, 12.2 |
| 30 | |
| 31 | .. code-block:: bash |
| 32 | |
| 33 | $ cd /opt |
| 34 | $ wget https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz?rev=28d5199f6db34e5980aae1062e5a6703&hash=D87D4B558F0A2247B255BA15C32A94A9F354E6A8 |
| 35 | $ tar xvf arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz |
| 36 | |
| 37 | #. Add the Arm GNU Toolchain binary to the $PATH |
| 38 | |
| 39 | .. code-block:: bash |
| 40 | |
| 41 | $ cd ~ |
| 42 | $ vi .bashrc |
| 43 | export PATH=$PATH:/opt/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf/bin |
| 44 | |
| 45 | #. Clone the latest OP-TEE OS code from the GitHub repository |
| 46 | |
| 47 | .. code-block:: bash |
| 48 | |
| 49 | $ git clone https://github.com/OP-TEE/optee_os.git |
| 50 | $ cd optee_os |
| 51 | |
| 52 | ============== |
| 53 | Build process: |
| 54 | ============== |
| 55 | |
| 56 | #. build OP-TEE OS for Nuvoton platform |
| 57 | |
| 58 | .. code-block:: bash |
| 59 | |
| 60 | $ make CROSS_COMPILE64=aarch64-none-elf- PLATFORM=nuvoton -j $(nproc) |
| 61 | |
| 62 | Note: you can use additional debug flag for compilation to get debug prints to console |
| 63 | |
| 64 | .. code-block:: bash |
| 65 | |
| 66 | $ make CROSS_COMPILE64=aarch64-none-elf- PLATFORM=nuvoton CFG_NPCM_DEBUG=y -j $(nproc) |
| 67 | |
| 68 | #. Update binary input files in IGPS |
| 69 | |
| 70 | .. code-block:: bash |
| 71 | |
| 72 | $ cd ../igps-npcm8xx/py_scripts |
| 73 | $ python ./UpdateInputsBinaries_Arbel_A1_EB.py |
| 74 | |
| 75 | #. Copy the compiled out/arm-plat-nuvoton/core/tee.bin file into IGPS_3.8.6/py_scripts/ImageGeneration/inputs |
| 76 | |
| 77 | #. Generate new image file |
| 78 | |
| 79 | .. code-block:: bash |
| 80 | |
| 81 | $ python ./GenerateAll.py |
| 82 | |
| 83 | #. Program the new image to flash: |
| 84 | |
| 85 | .. code-block:: bash |
| 86 | |
| 87 | $ python ./ProgramAll_Secure.py |
| 88 | |
| 89 | #. After programming, enable terminal connection to the ArbelEVB, |
| 90 | and if you compiled with the ``CFG_NPCM_DEBUG=y`` flag, |
| 91 | you will see OP-TEE version before U-Boot console trace messages, |
| 92 | for example: |
| 93 | |
| 94 | I/TC: >================================================ |
| 95 | I/TC: OP-TEE OS Version 3.21.0-1127-gaf809d0ab-dev (gcc version 12.2 (Arm GNU Toolchain 12.2.Rel1)) #1 Thu May 18 05:24:18 UTC 2023 aarch64 |
| 96 | I/TC: >================================================ |