blob: e173f244b4795dfcfa9e980703f8e4693660c27f [file] [log] [blame]
Patrick Williams2390b1b2022-11-03 13:47:49 -05001..
2 # Copyright (c) 2022, Arm Limited.
3 #
4 # SPDX-License-Identifier: MIT
5
6##########
7User Guide
8##########
9
10Notice
11------
Patrick Williams7784c422022-11-17 07:29:11 -060012The Corstone-1000 software stack uses the `Yocto Project <https://www.yoctoproject.org/>`__ to build
13a tiny Linux distribution suitable for the Corstone-1000 platform (kernel and initramfs filesystem less than 5 MB on the flash).
14The Yocto Project relies on the `Bitbake <https://docs.yoctoproject.org/bitbake.html#bitbake-documentation>`__
Patrick Williams2390b1b2022-11-03 13:47:49 -050015tool as its build tool. Please see `Yocto Project documentation <https://docs.yoctoproject.org/>`__
16for more information.
17
18
19Prerequisites
20-------------
Andrew Geissler517393d2023-01-13 08:55:19 -060021These instructions assume your host PC is running Ubuntu Linux 18.04 or 20.04 LTS, with at least 32GB of free disk space and 16GB of RAM as minimum requirement. The following instructions expect that you are using a bash shell. All the paths stated in this document are absolute paths.
Patrick Williams2390b1b2022-11-03 13:47:49 -050022
23The following prerequisites must be available on the host system. To resolve these dependencies, run:
24
25::
26
27 sudo apt-get update
28 sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
29 build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
30 xz-utils debianutils iputils-ping python3-git libegl1-mesa libsdl1.2-dev \
31 xterm zstd liblz4-tool picocom
32 sudo apt-get upgrade libstdc++6
33
34Provided components
35-------------------
Patrick Williams7784c422022-11-17 07:29:11 -060036Within the Yocto Project, each component included in the Corstone-1000 software stack is specified as
37a `bitbake recipe <https://docs.yoctoproject.org/bitbake/2.2/bitbake-user-manual/bitbake-user-manual-intro.html#recipes>`__.
38The recipes specific to the Corstone-1000 BSP are located at:
Patrick Williams2390b1b2022-11-03 13:47:49 -050039``<_workspace>/meta-arm/meta-arm-bsp/``.
40
Patrick Williams7784c422022-11-17 07:29:11 -060041The Yocto machine config files for the Corstone-1000 FVP and FPGA targets are:
Patrick Williams2390b1b2022-11-03 13:47:49 -050042
43 - ``<_workspace>/meta-arm/meta-arm-bsp/conf/machine/include/corstone1000.inc``
44 - ``<_workspace>/meta-arm/meta-arm-bsp/conf/machine/corstone1000-fvp.conf``
45 - ``<_workspace>/meta-arm/meta-arm-bsp/conf/machine/corstone1000-mps3.conf``
46
47*****************
48Software for Host
49*****************
50
51Trusted Firmware-A
52==================
53Based on `Trusted Firmware-A <https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git>`__
54
55+----------+---------------------------------------------------------------------------------------------------+
56| bbappend | <_workspace>/meta-arm/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.7.bbappend |
57+----------+---------------------------------------------------------------------------------------------------+
58| Recipe | <_workspace>/meta-arm/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.7.bb |
59+----------+---------------------------------------------------------------------------------------------------+
60
61OP-TEE
62======
63Based on `OP-TEE <https://git.trustedfirmware.org/OP-TEE/optee_os.git>`__
64
65+----------+------------------------------------------------------------------------------------+
66| bbappend | <_workspace>/meta-arm/meta-arm-bsp/recipes-security/optee/optee-os_3.18.0.bbappend |
67+----------+------------------------------------------------------------------------------------+
68| Recipe | <_workspace>/meta-arm/meta-arm/recipes-security/optee/optee-os_3.18.0.bb |
69+----------+------------------------------------------------------------------------------------+
70
71U-Boot
72=======
73Based on `U-Boot <https://gitlab.com/u-boot>`__
74
75+----------+---------------------------------------------------------------------+
76| bbappend | <_workspace>/meta-arm/meta-arm/recipes-bsp/u-boot/u-boot_%.bbappend |
77+----------+---------------------------------------------------------------------+
78| Recipe | <_workspace>/poky/meta/recipes-bsp/u-boot/u-boot_2022.07.bb |
79+----------+---------------------------------------------------------------------+
80
81Linux
82=====
83The distro is based on the `poky-tiny <https://wiki.yoctoproject.org/wiki/Poky-Tiny>`__
84distribution which is a Linux distribution stripped down to a minimal configuration.
85
86The provided distribution is based on busybox and built using muslibc. The
Patrick Williams7784c422022-11-17 07:29:11 -060087recipe responsible for building a tiny version of Linux is listed below.
Patrick Williams2390b1b2022-11-03 13:47:49 -050088
89+-----------+----------------------------------------------------------------------------------------------+
90| bbappend | <_workspace>/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto_%.bbappend |
91+-----------+----------------------------------------------------------------------------------------------+
92| Recipe | <_workspace>/poky/meta/recipes-kernel/linux/linux-yocto_5.19.bb |
93+-----------+----------------------------------------------------------------------------------------------+
94| defconfig | <_workspace>/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig |
95+-----------+----------------------------------------------------------------------------------------------+
96
Patrick Williams7784c422022-11-17 07:29:11 -060097External System Tests
98=======================
99Based on `Corstone-1000/applications <https://git.gitlab.arm.com/arm-reference-solutions/corstone1000/applications>`__
100
101+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
102| Recipe | <_workspace>/meta-arm/meta-arm-bsp/recipes-test/corstone1000-external-sys-tests/corstone1000-external-sys-tests_1.0.bb |
103+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
104
105The recipe provides the systems-comms-tests command run in Linux and used for testing the External System.
106
Patrick Williams2390b1b2022-11-03 13:47:49 -0500107**************************************************
108Software for Boot Processor (a.k.a Secure Enclave)
109**************************************************
110Based on `Trusted Firmware-M <https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git>`__
111
112+----------+-------------------------------------------------------------------------------------------------+
113| bbappend | <_workspace>/meta-arm/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend |
114+----------+-------------------------------------------------------------------------------------------------+
115| Recipe | <_workspace>/meta-arm/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.6.0.bb |
116+----------+-------------------------------------------------------------------------------------------------+
117
Patrick Williams7784c422022-11-17 07:29:11 -0600118**************************************************
119Software for the External System
120**************************************************
121
122RTX
123====
124Based on `RTX RTOS <https://git.gitlab.arm.com/arm-reference-solutions/corstone1000/external_system/rtx>`__
125
126+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
127| Recipe | <_workspace>/meta-arm/meta-arm-bsp/recipes-bsp/external-system/external-system_0.1.0.bb |
128+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
129
Patrick Williams2390b1b2022-11-03 13:47:49 -0500130Building the software stack
131---------------------------
132Create a new folder that will be your workspace and will henceforth be referred
133to as ``<_workspace>`` in these instructions. To create the folder, run:
134
135::
136
137 mkdir <_workspace>
138 cd <_workspace>
139
Patrick Williams7784c422022-11-17 07:29:11 -0600140Corstone-1000 software is based on the Yocto Project which uses kas and bitbake
Patrick Williams2390b1b2022-11-03 13:47:49 -0500141commands to build the stack. To install kas tool, run:
142
143::
144
145 pip3 install kas
146
Andrew Geissler517393d2023-01-13 08:55:19 -0600147If 'kas' command is not found in command-line, please make sure the user installation directories are visible on $PATH. If you have sudo rights, try 'sudo pip3 install kas'.
148
Patrick Williams2390b1b2022-11-03 13:47:49 -0500149In the top directory of the workspace ``<_workspace>``, run:
150
151::
152
Andrew Geissler517393d2023-01-13 08:55:19 -0600153 git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.23
Patrick Williams2390b1b2022-11-03 13:47:49 -0500154
Patrick Williams7784c422022-11-17 07:29:11 -0600155To build a Corstone-1000 image for MPS3 FPGA, run:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500156
157::
158
159 kas build meta-arm/kas/corstone1000-mps3.yml
160
Patrick Williams7784c422022-11-17 07:29:11 -0600161Alternatively, to build a Corstone-1000 image for FVP, run:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500162
163::
164
165 kas build meta-arm/kas/corstone1000-fvp.yml
166
167The initial clean build will be lengthy, given that all host utilities are to
168be built as well as the target images. This includes host executables (python,
169cmake, etc.) and the required toolchain(s).
170
171Once the build is successful, all output binaries will be placed in the following folders:
172 - ``<_workspace>/build/tmp/deploy/images/corstone1000-fvp/`` folder for FVP build;
173 - ``<_workspace>/build/tmp/deploy/images/corstone1000-mps3/`` folder for FPGA build.
174
Patrick Williams7784c422022-11-17 07:29:11 -0600175Everything apart from the Secure Enclave ROM firmware and External System firmware, is bundled into a single binary, the
176``corstone1000-image-corstone1000-{mps3,fvp}.wic.nopt`` file.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500177
Patrick Williams7784c422022-11-17 07:29:11 -0600178The output binaries run in the Corstone-1000 platform are the following:
179 - The Secure Enclave ROM firmware: ``<_workspace>/build/tmp/deploy/images/corstone1000-{mps3,fvp}/bl1.bin``
180 - The External System firmware: ``<_workspace>/build/tmp/deploy/images/corstone1000-{mps3,fvp}/es_flashfw.bin``
181 - The flash image: ``<_workspace>/build/tmp/deploy/images/corstone1000-{mps3,fvp}/corstone1000-image-corstone1000-{mps3,fvp}.wic.nopt``
Patrick Williams2390b1b2022-11-03 13:47:49 -0500182
183Flash the firmware image on FPGA
184--------------------------------
185
Patrick Williams7784c422022-11-17 07:29:11 -0600186The user should download the FPGA bit file image ``AN550: Arm® Corstone™-1000 for MPS3 Version 1``
187from `this link <https://developer.arm.com/tools-and-software/development-boards/fpga-prototyping-boards/download-fpga-images>`__
Patrick Williams2390b1b2022-11-03 13:47:49 -0500188and under the section ``Arm® Corstone™-1000 for MPS3``.
189
190The directory structure of the FPGA bundle is shown below.
191
192::
193
194 Boardfiles
195 ├── MB
196 │   ├── BRD_LOG.TXT
197 │   ├── HBI0309B
198 │   │   ├── AN550
199 │   │   │   ├── AN550_v1.bit
200 │   │   │   ├── an550_v1.txt
201 │   │   │   └── images.txt
202 │   │   ├── board.txt
203 │   │   └── mbb_v210.ebf
204 │   └── HBI0309C
205 │   ├── AN550
206 │   │   ├── AN550_v1.bit
207 │   │   ├── an550_v1.txt
208 │   │   └── images.txt
209 │   ├── board.txt
210 │   └── mbb_v210.ebf
211 ├── SOFTWARE
212 │   ├── ES0.bin
213 │   ├── SE.bin
214 │   └── an550_st.axf
215 └── config.txt
216
217Depending upon the MPS3 board version (printed on the MPS3 board) you should update the images.txt file
Andrew Geissler517393d2023-01-13 08:55:19 -0600218(in corresponding HBI0309x folder. Boardfiles/MB/HBI0309<board_revision>/AN550/images.txt) so that the file points to the images under SOFTWARE directory.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500219
Andrew Geissler517393d2023-01-13 08:55:19 -0600220The images.txt file that is compatible with the latest version of the software
221stack can be seen below;
Patrick Williams2390b1b2022-11-03 13:47:49 -0500222
223::
224
225 ;************************************************
226 ; Preload port mapping *
227 ;************************************************
228 ; PORT 0 & ADDRESS: 0x00_0000_0000 QSPI Flash (XNVM) (32MB)
229 ; PORT 0 & ADDRESS: 0x00_8000_0000 OCVM (DDR4 2GB)
230 ; PORT 1 Secure Enclave (M0+) ROM (64KB)
231 ; PORT 2 External System 0 (M3) Code RAM (256KB)
232 ; PORT 3 Secure Enclave OTP memory (8KB)
233 ; PORT 4 CVM (4MB)
234 ;************************************************
235
236 [IMAGES]
Patrick Williams7784c422022-11-17 07:29:11 -0600237 TOTALIMAGES: 3 ;Number of Images (Max: 32)
238
Patrick Williams2390b1b2022-11-03 13:47:49 -0500239 IMAGE0PORT: 1
240 IMAGE0ADDRESS: 0x00_0000_0000
241 IMAGE0UPDATE: RAM
242 IMAGE0FILE: \SOFTWARE\bl1.bin
Patrick Williams7784c422022-11-17 07:29:11 -0600243
Patrick Williams2390b1b2022-11-03 13:47:49 -0500244 IMAGE1PORT: 0
Patrick Williams7784c422022-11-17 07:29:11 -0600245 IMAGE1ADDRESS: 0x00_0010_0000
Patrick Williams2390b1b2022-11-03 13:47:49 -0500246 IMAGE1UPDATE: AUTOQSPI
247 IMAGE1FILE: \SOFTWARE\cs1000.bin
Patrick Williams7784c422022-11-17 07:29:11 -0600248
249 IMAGE2PORT: 2
250 IMAGE2ADDRESS: 0x00_0000_0000
251 IMAGE2UPDATE: RAM
252 IMAGE2FILE: \SOFTWARE\es0.bin
Patrick Williams2390b1b2022-11-03 13:47:49 -0500253
254OUTPUT_DIR = ``<_workspace>/build/tmp/deploy/images/corstone1000-mps3``
255
2561. Copy ``bl1.bin`` from OUTPUT_DIR directory to SOFTWARE directory of the FPGA bundle.
Patrick Williams7784c422022-11-17 07:29:11 -06002572. Copy ``es_flashfw.bin`` from OUTPUT_DIR directory to SOFTWARE directory of the FPGA bundle
258 and rename the binary to ``es0.bin``.
2593. Copy ``corstone1000-image-corstone1000-mps3.wic.nopt`` from OUTPUT_DIR directory to SOFTWARE
260 directory of the FPGA bundle and rename the wic.nopt image to ``cs1000.bin``.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500261
Patrick Williams7784c422022-11-17 07:29:11 -0600262
Patrick Williams2390b1b2022-11-03 13:47:49 -0500263**NOTE:** Renaming of the images are required because MCC firmware has
264limitation of 8 characters before .(dot) and 3 characters after .(dot).
265
266Now, copy the entire folder to board's SDCard and reboot the board.
267
268Running the software on FPGA
269----------------------------
270
Patrick Williams7784c422022-11-17 07:29:11 -0600271On the host machine, open 4 serial port terminals. In case of Linux machine it will
272be ttyUSB0, ttyUSB1, ttyUSB2, ttyUSB3 and it might be different on Windows machines.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500273
274 - ttyUSB0 for MCC, OP-TEE and Secure Partition
275 - ttyUSB1 for Boot Processor (Cortex-M0+)
276 - ttyUSB2 for Host Processor (Cortex-A35)
Patrick Williams7784c422022-11-17 07:29:11 -0600277 - ttyUSB3 for External System Processor (Cortex-M3)
Patrick Williams2390b1b2022-11-03 13:47:49 -0500278
Patrick Williams7784c422022-11-17 07:29:11 -0600279Run following commands to open serial port terminals on Linux:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500280
281::
282
283 sudo picocom -b 115200 /dev/ttyUSB0 # in one terminal
284 sudo picocom -b 115200 /dev/ttyUSB1 # in another terminal
285 sudo picocom -b 115200 /dev/ttyUSB2 # in another terminal.
Patrick Williams7784c422022-11-17 07:29:11 -0600286 sudo picocom -b 115200 /dev/ttyUSB3 # in another terminal.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500287
288Once the system boot is completed, you should see console
Patrick Williams7784c422022-11-17 07:29:11 -0600289logs on the serial port terminals. Once the HOST(Cortex-A35) is
Patrick Williams2390b1b2022-11-03 13:47:49 -0500290booted completely, user can login to the shell using
291**"root"** login.
292
Andrew Geissler517393d2023-01-13 08:55:19 -0600293If system does not boot and only the ttyUSB1 logs are visible, please follow the steps in `Clean Secure Flash Before Testing (applicable to FPGA only)`_ under `SystemReady-IR tests`_ section. The previous image used in FPGA (MPS3) might have filled the Secure Flash completely. The best practice is to clean the secure flash in this case.
294
295
Patrick Williams2390b1b2022-11-03 13:47:49 -0500296Running the software on FVP
297---------------------------
Patrick Williams2390b1b2022-11-03 13:47:49 -0500298
Patrick Williams7784c422022-11-17 07:29:11 -0600299An FVP (Fixed Virtual Platform) model of the Corstone-1000 platform must be available to run the
300Corstone-1000 FVP software image.
301
302A Yocto recipe is provided and allows to download the latest supported FVP version.
303
304The recipe is located at <_workspace>/meta-arm/meta-arm/recipes-devtools/fvp/fvp-corstone1000.bb
305
Andrew Geissler517393d2023-01-13 08:55:19 -0600306The latest supported Fixed Virtual Platform (FVP) version is 11.19_21 and is automatically downloaded and installed when using the runfvp command as detailed below. The FVP version can be checked by running the following command:
307
308::
309
310<_workspace>/meta-arm/scripts/runfvp <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- --version
Patrick Williams7784c422022-11-17 07:29:11 -0600311
312The FVP can also be manually downloaded from the `Arm Ecosystem FVPs`_ page. On this page, navigate
313to "Corstone IoT FVPs" section to download the Corstone-1000 platform FVP installer. Follow the
Patrick Williams2390b1b2022-11-03 13:47:49 -0500314instructions of the installer and setup the FVP.
315
Patrick Williams7784c422022-11-17 07:29:11 -0600316To run the FVP using the runfvp command, please run the following command:
317
318::
319
Patrick Williams2390b1b2022-11-03 13:47:49 -0500320<_workspace>/meta-arm/scripts/runfvp --terminals=xterm <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf
321
322When the script is executed, three terminal instances will be launched, one for the boot processor
323(aka Secure Enclave) processing element and two for the Host processing element. Once the FVP is
Patrick Williams7784c422022-11-17 07:29:11 -0600324executing, the Boot Processor will start to boot, wherein the relevant memory contents of the .wic.nopt
Patrick Williams2390b1b2022-11-03 13:47:49 -0500325file are copied to their respective memory locations within the model, enforce firewall policies
326on memories and peripherals and then, bring the host out of reset.
327
328The host will boot trusted-firmware-a, OP-TEE, U-Boot and then Linux, and present a login prompt
329(FVP host_terminal_0):
330
331::
Patrick Williams7784c422022-11-17 07:29:11 -0600332
Patrick Williams2390b1b2022-11-03 13:47:49 -0500333 corstone1000-fvp login:
334
335Login using the username root.
336
Patrick Williams7784c422022-11-17 07:29:11 -0600337The External System can be released out of reset on demand using the systems-comms-tests command.
338
339SystemReady-IR tests
Patrick Williams2390b1b2022-11-03 13:47:49 -0500340-------------------------
341
Patrick Williams7784c422022-11-17 07:29:11 -0600342*********************
343Testing steps
344*********************
345
Patrick Williams2390b1b2022-11-03 13:47:49 -0500346**NOTE**: Running the SystemReady-IR tests described below requires the user to
347work with USB sticks. In our testing, not all USB stick models work well with
348MPS3 FPGA. Here are the USB sticks models that are stable in our test
349environment.
350
351 - HP V165W 8 GB USB Flash Drive
352 - SanDisk Ultra 32GB Dual USB Flash Drive USB M3.0
353 - SanDisk Ultra 16GB Dual USB Flash Drive USB M3.0
354
355**NOTE**:
356Before running each of the tests in this chapter, the user should follow the
357steps described in following section "Clean Secure Flash Before Testing" to
358erase the SecureEnclave flash cleanly and prepare a clean board environment for
359the testing.
360
361Clean Secure Flash Before Testing (applicable to FPGA only)
Patrick Williams7784c422022-11-17 07:29:11 -0600362==================================================================
363
Patrick Williams2390b1b2022-11-03 13:47:49 -0500364To prepare a clean board environment with clean secure flash for the testing,
365the user should prepare an image that erases the secure flash cleanly during
366boot. Run following commands to build such image.
367
368::
369
370 cd <_workspace>
Andrew Geissler517393d2023-01-13 08:55:19 -0600371 git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.23
372 git clone https://git.gitlab.arm.com/arm-reference-solutions/systemready-patch.git -b CORSTONE1000-2022.11.23
Patrick Williams2390b1b2022-11-03 13:47:49 -0500373 cp -f systemready-patch/embedded-a/corstone1000/erase_flash/0001-arm-bsp-trusted-firmware-m-corstone1000-Clean-Secure.patch meta-arm
374 cd meta-arm
375 git apply 0001-arm-bsp-trusted-firmware-m-corstone1000-Clean-Secure.patch
376 cd ..
377 kas build meta-arm/kas/corstone1000-mps3.yml
378
379Replace the bl1.bin and cs1000.bin files on the SD card with following files:
380 - The ROM firmware: <_workspace>/build/tmp/deploy/images/corstone1000-mps3/bl1.bin
381 - The flash image: <_workspace>/build/tmp/deploy/images/corstone1000-mps3/corstone1000-image-corstone1000-mps3.wic.nopt
382
Patrick Williams7784c422022-11-17 07:29:11 -0600383Now reboot the board. This step erases the Corstone-1000 SecureEnclave flash
Andrew Geissler517393d2023-01-13 08:55:19 -0600384completely, the user should expect following message from TF-M log (can be seen
385in ttyUSB1):
Patrick Williams2390b1b2022-11-03 13:47:49 -0500386
387::
388
389 !!!SECURE FLASH HAS BEEN CLEANED!!!
390 NOW YOU CAN FLASH THE ACTUAL CORSTONE1000 IMAGE
391 PLEASE REMOVE THE LATEST ERASE SECURE FLASH PATCH AND BUILD THE IMAGE AGAIN
392
393Then the user should follow "Building the software stack" to build a clean
394software stack and flash the FPGA as normal. And continue the testing.
395
396Run SystemReady-IR ACS tests
Patrick Williams7784c422022-11-17 07:29:11 -0600397=============================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500398
Andrew Geissler517393d2023-01-13 08:55:19 -0600399ACS image contains two partitions. BOOT partition and RESULT partition.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500400Following packages are under BOOT partition
401
402 * SCT
403 * FWTS
404 * BSA uefi
405 * BSA linux
406 * grub
407 * uefi manual capsule application
408
Andrew Geissler517393d2023-01-13 08:55:19 -0600409RESULT partition is used to store the test results.
410PLEASE MAKE SURE THAT THE RESULT PARTITION IS EMPTY BEFORE YOU START THE TESTING. OTHERWISE THE TEST RESULTS
Patrick Williams2390b1b2022-11-03 13:47:49 -0500411WILL NOT BE CONSISTENT
412
413FPGA instructions for ACS image
Patrick Williams7784c422022-11-17 07:29:11 -0600414================================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500415
416This section describes how the user can build and run Architecture Compliance
Patrick Williams7784c422022-11-17 07:29:11 -0600417Suite (ACS) tests on Corstone-1000.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500418
419First, the user should download the `Arm SystemReady ACS repository <https://github.com/ARM-software/arm-systemready/>`__.
420This repository contains the infrastructure to build the Architecture
421Compliance Suite (ACS) and the bootable prebuilt images to be used for the
422certifications of SystemReady-IR. To download the repository, run command:
423
424::
425
426 cd <_workspace>
427 git clone https://github.com/ARM-software/arm-systemready.git -b v21.09_REL1.0
428
429Once the repository is successfully downloaded, the prebuilt ACS live image can be found in:
430 - ``<_workspace>/arm-systemready/IR/prebuilt_images/v21.07_0.9_BETA/ir_acs_live_image.img.xz``
431
432**NOTE**: This prebuilt ACS image includes v5.13 kernel, which doesn't provide
Patrick Williams7784c422022-11-17 07:29:11 -0600433USB driver support for Corstone-1000. The ACS image with newer kernel version
434and with full USB support for Corstone-1000 will be available in the next
Patrick Williams2390b1b2022-11-03 13:47:49 -0500435SystemReady release in this repository.
436
437Then, the user should prepare a USB stick with ACS image. In the given example here,
438we assume the USB device is ``/dev/sdb`` (the user should use ``lsblk`` command to
439confirm). Be cautious here and don't confuse your host PC's own hard drive with the
440USB drive. Run the following commands to prepare the ACS image in USB stick:
441
442::
443
Patrick Williams7784c422022-11-17 07:29:11 -0600444 cd <_workspace>/arm-systemready/IR/prebuilt_images/v21.07_0.9_BETA
Patrick Williams2390b1b2022-11-03 13:47:49 -0500445 unxz ir_acs_live_image.img.xz
446 sudo dd if=ir_acs_live_image.img of=/dev/sdb iflag=direct oflag=direct bs=1M status=progress; sync
447
448Once the USB stick with ACS image is prepared, the user should make sure that
449ensure that only the USB stick with the ACS image is connected to the board,
450and then boot the board.
451
Andrew Geissler517393d2023-01-13 08:55:19 -0600452The FPGA will reset multiple times during the test, and it might take approx. 24-36 hours to finish the test. At the end of test, the FPGA host terminal will halt showing a shell prompt. Once test is finished the result can be copied following above instructions.
453
Patrick Williams2390b1b2022-11-03 13:47:49 -0500454FVP instructions for ACS image and run
Patrick Williams7784c422022-11-17 07:29:11 -0600455============================================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500456
Patrick Williams7784c422022-11-17 07:29:11 -0600457Download ACS image from:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500458 - ``https://gitlab.arm.com/systemready/acs/arm-systemready/-/tree/linux-5.17-rc7/IR/prebuilt_images/v22.04_1.0-Linux-v5.17-rc7``
459
Patrick Williams7784c422022-11-17 07:29:11 -0600460Use the below command to run the FVP with ACS image support in the
Patrick Williams2390b1b2022-11-03 13:47:49 -0500461SD card.
462
463::
464
465 unxz ${<path-to-img>/ir_acs_live_image.img.xz}
466
Patrick Williams7784c422022-11-17 07:29:11 -0600467 tmux
468
Andrew Geissler517393d2023-01-13 08:55:19 -0600469 <_workspace>/meta-arm/scripts/runfvp <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- -C board.msd_mmc.p_mmc_file="${<path-to-img>/ir_acs_live_image.img}"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500470
471The test results can be fetched using following commands:
472
473::
474
475 sudo mkdir /mnt/test
476 sudo mount -o rw,offset=<offset_2nd_partition> <path-to-img>/ir_acs_live_image.img /mnt/test/
477 fdisk -lu <path-to-img>/ir_acs_live_image.img
478 -> Device Start End Sectors Size Type
Patrick Williams7784c422022-11-17 07:29:11 -0600479 <path-to-img>/ir_acs_live_image_modified.img1 2048 1050622 1048575 512M Microsoft basic data
480 <path-to-img>/ir_acs_live_image_modified.img2 1050624 1153022 102399 50M Microsoft basic data
Patrick Williams2390b1b2022-11-03 13:47:49 -0500481
482 -> <offset_2nd_partition> = 1050624 * 512 (sector size) = 537919488
483
484The FVP will reset multiple times during the test, and it might take up to 1 day to finish
485the test. At the end of test, the FVP host terminal will halt showing a shell prompt.
486Once test is finished, the FVP can be stoped, and result can be copied following above
487instructions.
488
489Common to FVP and FPGA
Patrick Williams7784c422022-11-17 07:29:11 -0600490===========================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500491
492U-Boot should be able to boot the grub bootloader from
493the 1st partition and if grub is not interrupted, tests are executed
494automatically in the following sequence:
495
496 - SCT
497 - UEFI BSA
498 - FWTS
499 - BSA Linux
500
Andrew Geissler517393d2023-01-13 08:55:19 -0600501The results can be fetched from the ``acs_results`` folder in the RESULT partition of the USB stick (FPGA) / SD Card (FVP).
Patrick Williams2390b1b2022-11-03 13:47:49 -0500502
Patrick Williams7784c422022-11-17 07:29:11 -0600503#####################################################
Patrick Williams2390b1b2022-11-03 13:47:49 -0500504
Patrick Williams7784c422022-11-17 07:29:11 -0600505Manual capsule update and ESRT checks
506---------------------------------------------------------------------
Patrick Williams2390b1b2022-11-03 13:47:49 -0500507
Patrick Williams7784c422022-11-17 07:29:11 -0600508The following section describes running manual capsule update with the ``direct`` method.
509
510The steps described in this section perform manual capsule update and show how to use the ESRT feature
511to retrieve the installed capsule details.
512
513For the following tests two capsules are needed to perform 2 capsule updates. A positive update and a negative update.
514
515A positive test case capsule which boots the platform correctly until the Linux prompt, and a negative test case with an
516incorrect capsule (corrupted or outdated) which fails to boot to the host software.
517
518Check the "Run SystemReady-IR ACS tests" section above to download and unpack the ACS image file
Patrick Williams2390b1b2022-11-03 13:47:49 -0500519 - ``ir_acs_live_image.img.xz``
520
Patrick Williams7784c422022-11-17 07:29:11 -0600521Download edk2 under <_workspace> :
Patrick Williams2390b1b2022-11-03 13:47:49 -0500522
523::
524
525 git clone https://github.com/tianocore/edk2.git
Patrick Williams2390b1b2022-11-03 13:47:49 -0500526
Patrick Williams7784c422022-11-17 07:29:11 -0600527*********************
528Generating Capsules
529*********************
530
531The capsule binary size (wic.nopt file) should be less than 15 MB.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500532
533Based on the user's requirement, the user can change the firmware version
534number given to ``--fw-version`` option (the version number needs to be >= 1).
535
Patrick Williams7784c422022-11-17 07:29:11 -0600536Generating FPGA Capsules
537========================
538
539::
540
541 <_workspace>/edk2/BaseTools/BinWrappers/PosixLike/GenerateCapsule -e -o \
542 cs1k_cap_mps3_v5 --fw-version 5 --lsv 0 --guid \
543 e2bb9c06-70e9-4b14-97a3-5a7913176e3f --verbose --update-image-index \
544 0 --verbose <_workspace>/build/tmp/deploy/images/corstone1000-mps3/corstone1000-image-corstone1000-mps3.wic.nopt
545
546::
547
548 <_workspace>/edk2/BaseTools/BinWrappers/PosixLike/GenerateCapsule -e -o \
549 cs1k_cap_mps3_v6 --fw-version 6 --lsv 0 --guid \
550 e2bb9c06-70e9-4b14-97a3-5a7913176e3f --verbose --update-image-index \
551 0 --verbose <_workspace>/build/tmp/deploy/images/corstone1000-mps3/corstone1000-image-corstone1000-mps3.wic.nopt
552
553Generating FVP Capsules
554========================
555
556::
557
558 <_workspace>/edk2/BaseTools/BinWrappers/PosixLike/GenerateCapsule -e -o \
559 cs1k_cap_fvp_v6 --fw-version 6 --lsv 0 --guid \
560 e2bb9c06-70e9-4b14-97a3-5a7913176e3f --verbose --update-image-index \
561 0 --verbose <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.wic.nopt
562
563::
564
565 <_workspace>/edk2/BaseTools/BinWrappers/PosixLike/GenerateCapsule -e -o \
566 cs1k_cap_fvp_v5 --fw-version 5 --lsv 0 --guid \
567 e2bb9c06-70e9-4b14-97a3-5a7913176e3f --verbose --update-image-index \
568 0 --verbose <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.wic.nopt
569
570*********************
571Copying Capsules
572*********************
573
574Copying the FPGA capsules
575=========================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500576
577The user should prepare a USB stick as explained in ACS image section (see above).
Patrick Williams7784c422022-11-17 07:29:11 -0600578Place the generated ``cs1k_cap`` files in the root directory of the boot partition
Patrick Williams2390b1b2022-11-03 13:47:49 -0500579in the USB stick. Note: As we are running the direct method, the ``cs1k_cap`` file
580should not be under the EFI/UpdateCapsule directory as this may or may not trigger
581the on disk method.
582
Patrick Williams7784c422022-11-17 07:29:11 -0600583::
Patrick Williams2390b1b2022-11-03 13:47:49 -0500584
Patrick Williams7784c422022-11-17 07:29:11 -0600585 sudo cp cs1k_cap_mps3_v6 <mounting path>/BOOT/
586 sudo cp cs1k_cap_mps3_v5 <mounting path>/BOOT/
587 sync
588
589Copying the FVP capsules
590========================
591
592First, mount the IR image:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500593
594::
595
Patrick Williams7784c422022-11-17 07:29:11 -0600596 sudo mkdir /mnt/test
597 sudo mount -o rw,offset=1048576 <path-to-img>/ir_acs_live_image.img /mnt/test
Patrick Williams2390b1b2022-11-03 13:47:49 -0500598
Patrick Williams7784c422022-11-17 07:29:11 -0600599Then, copy the capsules:
600
601::
602
603 sudo cp cs1k_cap_fvp_v6 /mnt/test/
604 sudo cp cs1k_cap_fvp_v5 /mnt/test/
605 sync
606
607Then, unmount the IR image:
608
609::
610
611 sudo umount /mnt/test
612
613**NOTE:**
Patrick Williams2390b1b2022-11-03 13:47:49 -0500614
615Size of first partition in the image file is calculated in the following way. The data is
616just an example and might vary with different ir_acs_live_image.img files.
617
618::
619
Patrick Williams7784c422022-11-17 07:29:11 -0600620 fdisk -lu <path-to-img>/ir_acs_live_image.img
621 -> Device Start End Sectors Size Type
622 <path-to-img>/ir_acs_live_image_modified.img1 2048 1050622 1048575 512M Microsoft basic data
623 <path-to-img>/ir_acs_live_image_modified.img2 1050624 1153022 102399 50M Microsoft basic data
Patrick Williams2390b1b2022-11-03 13:47:49 -0500624
Patrick Williams7784c422022-11-17 07:29:11 -0600625 -> <offset_1st_partition> = 2048 * 512 (sector size) = 1048576
Patrick Williams2390b1b2022-11-03 13:47:49 -0500626
Patrick Williams7784c422022-11-17 07:29:11 -0600627******************************
628Performing the capsule update
629******************************
630
631During this section we will be using the capsule with the higher version (cs1k_cap_<fvp/mps3>_v6) for the positive scenario
632and the capsule with the lower version (cs1k_cap_<fvp/mps3>_v5) for the negative scenario.
633
634Running the FVP with the IR prebuilt image
635==============================================
636
637Run the FVP with the IR prebuilt image:
638
639::
640
641 <_workspace>/meta-arm/scripts/runfvp --terminals=xterm <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- -C "board.msd_mmc.p_mmc_file ${<path-to-img>/ir_acs_live_image.img}"
642
643Running the FPGA with the IR prebuilt image
644==============================================
645
646Insert the prepared USB stick then Power cycle the MPS3 board.
647
648Executing capsule update for FVP and FPGA
649==============================================
650
651Reach u-boot then interrupt the boot to reach the EFI shell.
652
653::
654
655 Press ESC in 4 seconds to skip startup.nsh or any other key to continue.
656
657Then, type FS0: as shown below:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500658
659::
660
661 FS0:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500662
Patrick Williams7784c422022-11-17 07:29:11 -0600663In case of the positive scenario run the update with the higher version capsule as shown below:
664
665::
666
667 EFI/BOOT/app/CapsuleApp.efi cs1k_cap_<fvp/mps3>_v6
668
669After successfully updating the capsule the system will reset.
670
671In case of the negative scenario run the update with the lower version capsule as shown below:
672
673::
674
675 EFI/BOOT/app/CapsuleApp.efi cs1k_cap_<fvp/mps3>_v5
676
677The command above should fail and in the TF-M logs the following message should appear:
678
679::
680
681 ERROR: flash_full_capsule: version error
682
683Then, reboot manually:
684
685::
686
687 Shell> reset
688
689FPGA: Select Corstone-1000 Linux kernel boot
690==============================================
691
692Remove the USB stick before u-boot is reached so the Corstone-1000 kernel will be detected and used for booting.
693
694**NOTE:** Otherwise, the execution ends up in the ACS live image.
695
696FVP: Select Corstone-1000 Linux kernel boot
697==============================================
698
699Interrupt the u-boot shell.
700
701::
702
703 Hit any key to stop autoboot:
704
705Run the following commands in order to run the Corstone-1000 Linux kernel and being able to check the ESRT table.
706
707**NOTE:** Otherwise, the execution ends up in the ACS live image.
708
709::
710
711 $ run retrieve_kernel_load_addr
712 $ unzip $kernel_addr 0x90000000
713 $ loadm 0x90000000 $kernel_addr_r 0xf00000
714 $ bootefi $kernel_addr_r $fdtcontroladdr
715
716
717***********************
718Capsule update status
719***********************
720
721Positive scenario
722=================
Patrick Williams2390b1b2022-11-03 13:47:49 -0500723
724In the positive case scenario, the user should see following log in TF-M log,
725indicating the new capsule image is successfully applied, and the board boots
726correctly.
727
728::
729
730 ...
731 SysTick_Handler: counted = 10, expiring on = 360
732 SysTick_Handler: counted = 20, expiring on = 360
733 SysTick_Handler: counted = 30, expiring on = 360
734 ...
735 metadata_write: success: active = 1, previous = 0
736 accept_full_capsule: exit: fwu state is changed to regular
737 ...
738
739
Patrick Williams7784c422022-11-17 07:29:11 -0600740It's possible to check the content of the ESRT table after the system fully boots.
741
742In the Linux command-line run the following:
743
744::
745
746 # cd /sys/firmware/efi/esrt/entries/entry0
747 # cat *
748
749 0x0
750 e2bb9c06-70e9-4b14-97a3-5a7913176e3f
751 0
752 6
753 0
754 6
755 0
756
757.. line-block::
758 capsule_flags: 0x0
759 fw_class: e2bb9c06-70e9-4b14-97a3-5a7913176e3f
760 fw_type: 0
761 fw_version: 6
762 last_attempt_status: 0
763 last_attempt_version: 6
764 lowest_supported_fw_ver: 0
765
766
767Negative scenario
768=================
769
Andrew Geissler517393d2023-01-13 08:55:19 -0600770In the negative case scenario (rollback the capsule version), the user should
771see appropriate logs in the secure enclave terminal.
772
773::
774
775 ...
776 uefi_capsule_retrieve_images: image 0 at 0xa0000070, size=15654928
777 uefi_capsule_retrieve_images: exit
778 flash_full_capsule: enter: image = 0x0xa0000070, size = 15654928, version = 10
779 ERROR: flash_full_capsule: version error
780 private_metadata_write: enter: boot_index = 1
781 private_metadata_write: success
782 fmp_set_image_info:133 Enter
783 FMP image update: image id = 0
784 FMP image update: status = 1version=11 last_attempt_version=10.
785 fmp_set_image_info:157 Exit.
786 corstone1000_fwu_flash_image: exit: ret = -1
787 ...
788
789
790If capsule pass initial verification, but fails verifications performed during
791boot time, secure enclave will try new images predetermined number of times
792(defined in the code), before reverting back to the previous good bank.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500793
794::
795
796 ...
797 metadata_write: success: active = 0, previous = 1
798 fwu_select_previous: in regular state by choosing previous active bank
799 ...
800
Patrick Williams7784c422022-11-17 07:29:11 -0600801It's possible to check the content of the ESRT table after the system fully boots.
802
803In the Linux command-line run the following:
804
805::
806
807 # cd /sys/firmware/efi/esrt/entries/entry0
808 # cat *
809
810 0x0
811 e2bb9c06-70e9-4b14-97a3-5a7913176e3f
812 0
813 6
814 1
815 5
816 0
817
818.. line-block::
819 capsule_flags: 0x0
820 fw_class: e2bb9c06-70e9-4b14-97a3-5a7913176e3f
821 fw_type: 0
822 fw_version: 6
823 last_attempt_status: 1
824 last_attempt_version: 5
825 lowest_supported_fw_ver: 0
826
827Linux distros tests
828----------------------------------
829
830***************************************************************************************
831Debian/OpenSUSE install and boot (applicable to FPGA only)
832***************************************************************************************
Patrick Williams2390b1b2022-11-03 13:47:49 -0500833
Andrew Geissler517393d2023-01-13 08:55:19 -0600834To test Linux distro install and boot, the user should prepare two empty USB sticks (minimum size should be 4GB and formatted with FAT32).
Patrick Williams2390b1b2022-11-03 13:47:49 -0500835
836Download one of following Linux distro images:
837 - Debian installer image: https://cdimage.debian.org/cdimage/weekly-builds/arm64/iso-dvd/
838 - OpenSUSE Tumbleweed installer image: http://download.opensuse.org/ports/aarch64/tumbleweed/iso/
Patrick Williams7784c422022-11-17 07:29:11 -0600839 - The user should look for a DVD Snapshot like openSUSE-Tumbleweed-DVD-aarch64-Snapshot<date>-Media.iso
Patrick Williams2390b1b2022-11-03 13:47:49 -0500840
841Once the .iso file is downloaded, the .iso file needs to be flashed to your USB drive.
842
843In the given example here, we assume the USB device is ``/dev/sdb`` (the user
844should use `lsblk` command to confirm). Be cautious here and don't confuse your
845host PC's own hard drive with the USB drive. Then copy the contents of an iso
846file into the first USB stick, run:
847
848::
849
Andrew Geissler517393d2023-01-13 08:55:19 -0600850 sudo dd if=<path-to-iso_file> of=/dev/sdb iflag=direct oflag=direct status=progress bs=1M; sync;
Patrick Williams2390b1b2022-11-03 13:47:49 -0500851
852Boot the MSP3 board with the first USB stick connected. Open following minicom sessions:
853
854::
855
856 sudo picocom -b 115200 /dev/ttyUSB0 # in one terminal
857 sudo picocom -b 115200 /dev/ttyUSB2 # in another terminal.
858
Andrew Geissler517393d2023-01-13 08:55:19 -0600859Now plug in the second USB stick (once installation screen is visible), the distro installation process will start. The installation prompt can be seen in ttyUSB2. If installer does not start, please try to reboot the board with both USB sticks connected and repeat the process.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500860
Patrick Williams7784c422022-11-17 07:29:11 -0600861**NOTE:** Due to the performance limitation of Corstone-1000 MPS3 FPGA, the
Patrick Williams2390b1b2022-11-03 13:47:49 -0500862distro installation process can take up to 24 hours to complete.
863
864Once installation is complete, unplug the first USB stick and reboot the board.
865After successfully installing and booting the Linux distro, the user should see
866a login prompt:
867
868::
869
870 debian login:
871
872Login with the username root.
873
Patrick Williams7784c422022-11-17 07:29:11 -0600874**NOTE:** The Debian installer has a known issue "Install the GRUB bootloader - unable to install " and these are the steps to
875follow on the subsequent popups to solve the issue during the installation:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500876
Patrick Williams7784c422022-11-17 07:29:11 -06008771. Select "Continue", then "Continue" again on the next popup
8782. Scroll down and select "Execute a shell"
8793. Select "Continue"
8804. Enter the following command:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500881
882::
883
Patrick Williams7784c422022-11-17 07:29:11 -0600884 in-target grub-install --no-nvram --force-extra-removable
Patrick Williams2390b1b2022-11-03 13:47:49 -0500885
Patrick Williams7784c422022-11-17 07:29:11 -06008865. Enter the following command:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500887
888::
889
Patrick Williams7784c422022-11-17 07:29:11 -0600890 in-target update-grub
Patrick Williams2390b1b2022-11-03 13:47:49 -0500891
Patrick Williams7784c422022-11-17 07:29:11 -06008926. Enter the following command:
Patrick Williams2390b1b2022-11-03 13:47:49 -0500893
894::
895
Patrick Williams7784c422022-11-17 07:29:11 -0600896 exit
Patrick Williams2390b1b2022-11-03 13:47:49 -0500897
Patrick Williams7784c422022-11-17 07:29:11 -06008987. Select "Continue without boot loader", then select "Continue" on the next popup
8998. At this stage, the installation should proceed as normal.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500900
Patrick Williams7784c422022-11-17 07:29:11 -0600901***************************************************************************************
902OpenSUSE Raw image install and boot (applicable to FVP only)
903***************************************************************************************
Patrick Williams2390b1b2022-11-03 13:47:49 -0500904
905Steps to download openSUSE Tumbleweed raw image:
906 - Go to: http://download.opensuse.org/ports/aarch64/tumbleweed/appliances/
Patrick Williams7784c422022-11-17 07:29:11 -0600907 - The user should look for a Tumbleweed-ARM-JeOS-efi.aarch64-* Snapshot, for example, ``openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64-<date>-Snapshot<date>.raw.xz``
Patrick Williams2390b1b2022-11-03 13:47:49 -0500908
909Once the .raw.xz file is downloaded, the raw image file needs to be extracted:
910
911::
912
913 unxz <file-name.raw.xz>
914
915
916The above command will generate a file ending with extension .raw image. Now, use the following command
917to run FVP with raw image installation process.
918
919::
920
921<_workspace>/meta-arm/scripts/runfvp --terminals=xterm <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- -C board.msd_mmc.p_mmc_file="${openSUSE raw image file path}"
922
923After successfully installing and booting the Linux distro, the user should see
924a openSUSE login prompt.
925
926::
927
928 localhost login:
929
930Login with the username 'root' and password 'linux'.
931
Patrick Williams7784c422022-11-17 07:29:11 -0600932PSA API tests
933----------------------
934
935***************************************************************************************
936Run PSA API test commands (applicable to both FPGA and FVP)
937***************************************************************************************
938
939When running PSA API test commands (aka PSA Arch Tests) on MPS3 FPGA, the user should make sure there is no
940USB stick connected to the board. Power on the board and boot the board to
941Linux. Then, the user should follow the steps below to run the tests.
942
943When running the tests on the Corstone-1000 FVP, the user should follow the
944instructions in `Running the software on FVP`_ section to boot Linux in FVP
945host_terminal_0, and login using the username ``root``.
946
947First, load FF-A TEE kernel module:
948
949::
950
Andrew Geissler517393d2023-01-13 08:55:19 -0600951 insmod /lib/modules/5.19.14-yocto-standard/extra/arm-ffa-tee.ko
Patrick Williams7784c422022-11-17 07:29:11 -0600952
953Then, check whether the FF-A TEE driver is loaded correctly by using the following command:
954
955::
956
957 cat /proc/modules | grep arm_ffa_tee
958
959The output should be:
960
961::
962
963 arm_ffa_tee 16384 - - Live 0xffffffc0004f0000 (O)
964
965Now, run the PSA API tests in the following order:
966
967::
968
969 psa-iat-api-test
970 psa-crypto-api-test
971 psa-its-api-test
972 psa-ps-api-test
973
974External System tests
975-----------------------------------
976
977***************************************************************************************
978Running the External System test command (systems-comms-tests)
979***************************************************************************************
980
981Test 1: Releasing the External System out of reset
982===================================================
983
984Run this command in the Linux command-line:
985
986::
987
988 systems-comms-tests 1
989
990The output on the External System terminal should be:
991
992::
993
994 ___ ___
995 | / __|
996 |=== \___
997 |___ |___/
998 External System Cortex-M3 Processor
999 Running RTX RTOS
1000 v0.1.0_2022-10-19_16-41-32-8c9dca7
1001 MHUv2 module 'MHU0_H' started
1002 MHUv2 module 'MHU1_H' started
1003 MHUv2 module 'MHU0_SE' started
1004 MHUv2 module 'MHU1_SE' started
1005
1006Test 2: Communication
1007=============================================
1008
1009Test 2 releases the External System out of reset if not already done. Then, it performs communication between host and External System.
1010
1011After running Test 1, run this command in the Linux command-line:
1012
1013::
1014
1015 systems-comms-tests 2
1016
1017Additional output on the External System terminal will be printed:
1018
1019::
1020
1021 MHUv2: Message from 'MHU0_H': 0xabcdef1
1022 Received 'abcdef1' From Host MHU0
1023 CMD: Increment and return to sender...
1024 MHUv2: Message from 'MHU1_H': 0xabcdef1
1025 Received 'abcdef1' From Host MHU1
1026 CMD: Increment and return to sender...
1027
1028When running Test 2 the first, Test 1 will be run in the background.
1029
1030The output on the External System terminal should be:
1031
1032::
1033
1034 ___ ___
1035 | / __|
1036 |=== \___
1037 |___ |___/
1038 External System Cortex-M3 Processor
1039 Running RTX RTOS
1040 v0.1.0_2022-10-19_16-41-32-8c9dca7
1041 MHUv2 module 'MHU0_H' started
1042 MHUv2 module 'MHU1_H' started
1043 MHUv2 module 'MHU0_SE' started
1044 MHUv2 module 'MHU1_SE' started
1045 MHUv2: Message from 'MHU0_H': 0xabcdef1
1046 Received 'abcdef1' From Host MHU0
1047 CMD: Increment and return to sender...
1048 MHUv2: Message from 'MHU1_H': 0xabcdef1
1049 Received 'abcdef1' From Host MHU1
1050 CMD: Increment and return to sender...
1051
1052The output on the Host terminal should be:
1053
1054::
1055
1056 Received abcdf00 from es0mhu0
1057 Received abcdf00 from es0mhu1
1058
1059
1060Tests results
1061-----------------------------------
1062
Andrew Geissler517393d2023-01-13 08:55:19 -06001063As a reference for the end user, reports for various tests for `Corstone-1000 software (CORSTONE1000-2022.11.23) <https://git.yoctoproject.org/meta-arm/tag/?h=CORSTONE1000-2022.11.23>`__
Patrick Williams7784c422022-11-17 07:29:11 -06001064can be found in `here <https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-test-report/-/tree/master/embedded-a/corstone1000>`__.
1065
Patrick Williams2390b1b2022-11-03 13:47:49 -05001066Running the software on FVP on Windows
Patrick Williams7784c422022-11-17 07:29:11 -06001067---------------------------------------------------------------
1068
1069If the user needs to run the Corstone-1000 software on FVP on Windows. The user
Patrick Williams2390b1b2022-11-03 13:47:49 -05001070should follow the build instructions in this document to build on Linux host
1071PC, and copy the output binaries to the Windows PC where the FVP is located,
1072and launch the FVP binary.
1073
1074--------------
1075
Patrick Williams7784c422022-11-17 07:29:11 -06001076*Copyright (c) 2022, Arm Limited. All rights reserved.*
Patrick Williams2390b1b2022-11-03 13:47:49 -05001077
1078.. _Arm Ecosystem FVPs: https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps