diff --git a/.codeclimate.yml b/.codeclimate.yml index 82612386e47331b31b1f49fb43613650d5ac0190..2439de43f8ebf66d9899aad386c83b1e2c7e4147 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its +# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its # affiliates # # SPDX-License-Identifier: MIT @@ -28,7 +28,7 @@ plugins: - "**.cfg" - "documentation/Makefile" - "**.patch" - dict_path: "qa-checks/cassini-bsp-dictionary" + dict_path: ".dictionary" yamllint: enabled: true oelint-adv: diff --git a/qa-checks/cassini-bsp-dictionary b/.dictionary similarity index 84% rename from qa-checks/cassini-bsp-dictionary rename to .dictionary index e99b969200f30d0355a899de464180e831a28b9a..8138390c01b7a3bbd8ea2921ff5dd2e4e301b470 100644 --- a/qa-checks/cassini-bsp-dictionary +++ b/.dictionary @@ -5,11 +5,14 @@ alsa AUTOFS AUTOFS4 +AUTOQSPI +AUTORUN backend bmap bmaptool bootimg bootloader +bsp buildable BUILDIN cassini @@ -22,6 +25,7 @@ configfile corstone cpio crypto +dialout distro DISTROOVERRIDES efidisk @@ -32,6 +36,7 @@ FILESEXTRAPATHS flashfw fstype FSTYPES +fvps gcsections gettext gitlab @@ -46,11 +51,14 @@ LAYERSERIES LAYERSERIES_COMPAT LIBC Linaro +linuxboot mandatoryvar mdev meta-cassini-bsp mickledore +minicom modutils +MPS3 msdos mtrace multiconfig @@ -63,29 +71,46 @@ netbase networkd no_cloud nooelint +OCVM +oe-core opkg optee packagegroup +picocom posix +protobuf ptable +qa +QSPI readlink +README requireinclude requirenotfound RPROVIDER SAST scarthgap SDHC +se sourceparams +sp srcurifile suggestedvar tarbz2 +TF-A THISDIR +TOTALIMAGES udev unitdir +unpackdir +upstreamed usbgadget usbhost +util +utils VIRT wchar WIDEC +workdir +XNVM xtests -zeroconf \ No newline at end of file +zeroconf diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67857c5af4b9dbc5b02f039a987ab7d8388b239b..ccb73af7b0390248da73d0f75d6bd99bf96347f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,15 +13,16 @@ variables: META_CASSINI_TARGET_BRANCH: value: none description: Comma separated list of meta-cassini branch to trigger - (none, main, nanbield-dev, mickledore-dev, kirkstone-dev) + (none, main, scarthgap-dev, nanbield-dev, + mickledore-dev, kirkstone-dev) META_CASSINI_BUILD_IMAGE: value: all-images description: Comma separated list of images to build (none, all-images, greengrass, k3s) META_CASSINI_BUILD_PLATFORM: - value: corstone1000-fvp, n1sdp + value: corstone1000-fvp description: Comma separated list of platforms to build - (none, corstone1000-fvp, n1sdp) + (none, corstone1000-fvp) META_CASSINI_FORCE_TESTS: value: none description: Comma separated list of tests that must be run @@ -39,14 +40,19 @@ include: trigger-meta-cassini: inherit: - variables: false + variables: + - META_CASSINI_TARGET_BRANCH + - META_CASSINI_BUILD_IMAGE + - META_CASSINI_BUILD_PLATFORM + - META_CASSINI_FORCE_TESTS stage: Build rules: - !reference [".build-image:rules:skip-target-build", rules] - !reference [".build-image:rules:set-target-branch", rules] - !reference [".build-image:rules:common", rules] - - !reference [".build-image:rules:n1sdp", rules] - !reference [".build-image:rules:corstone1000", rules] + - !reference [".build-image:rules:manual", rules] + - !reference [".build-image:rules:ci-patterns", rules] trigger: project: $META_CASSINI_PROJECT branch: $META_CASSINI_TARGET_BRANCH diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 54201604c0ade657f7b88374a128f0c5e5b51ea8..8da67b0262e3367d3ee78142ecb02dc0e91a1791 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -7,35 +7,29 @@ .if-merge-request-or-push: &if-merge-request-or-push if: '$CI_MERGE_REQUEST_IID || $CI_PIPELINE_SOURCE == "push"' +.if-manual: &if-manual + if: '$CI_PIPELINE_SOURCE == "web"' + .if-no-target-project: &if-no-target-project if: '$META_CASSINI_PROJECT == "" || $META_CASSINI_PROJECT == null' # Changes patterns +.ci-patterns: &ci-patterns + - ".gitlab-ci.yml" + - ".gitlab/ci/rules.yml" + .build-common: &build-common - - "grub/**/*" - - "meta-security/**/*" - "conf/layer.conf" -.build-n1sdp: &build-n1sdp - - "conf/machine/include/n1sdp-cassini-extra-settings.inc" - - "meta-arm/meta-arm-bsp/recipes-security/**/*" - .build-corstone1000: &build-corstone1000 - "conf/machine/include/corstone1000-*-cassini-extra-settings.inc" - "conf/multiconfig/firmware.conf" - - "meta-arm/meta-arm-bsp/recipes-bsp/u-boot/**/*" + - "meta-arm/meta-arm-bsp/recipes-bsp/**/*" - "meta-arm/meta-arm-bsp/recipes-core/**/*" - "meta-arm/meta-arm-bsp/recipes-kernel/**/*" - "meta-arm/meta-arm-bsp/wic/*" # Build rules -.build-image:rules:n1sdp: - rules: - - <<: *if-merge-request-or-push - changes: *build-n1sdp - variables: - META_CASSINI_BUILD_PLATFORM: 'n1sdp' - .build-image:rules:corstone1000: rules: - <<: *if-merge-request-or-push @@ -48,13 +42,27 @@ - <<: *if-merge-request-or-push changes: *build-common variables: - META_CASSINI_BUILD_PLATFORM: 'n1sdp, corstone1000-fvp' + META_CASSINI_BUILD_PLATFORM: 'corstone1000-fvp' + +.build-image:rules:ci-patterns: + rules: + - <<: *if-merge-request-or-push + changes: *ci-patterns + variables: + META_CASSINI_BUILD_PLATFORM: 'none' + +.build-image:rules:manual: + rules: + - <<: *if-manual .build-image:rules:set-target-branch: rules: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"' variables: META_CASSINI_TARGET_BRANCH: 'main' + - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "scarthgap"' + variables: + META_CASSINI_TARGET_BRANCH: 'scarthgap-dev' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "nanbield"' variables: META_CASSINI_TARGET_BRANCH: 'nanbield-dev' diff --git a/Dangerfile b/Dangerfile index bd2dd49bb2efb193becdbd6eccb22d220fc5c1b8..6fda6d7c5f14f13a34a2e3b99fa7cb6225626b08 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its +# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its # affiliates # # SPDX-License-Identifier: MIT @@ -10,7 +10,7 @@ require 'embed-a-dangerfiles' Embed_A::Dangerfiles.for_project(self) do |dangerfiles| # Import all plugins from the gem dangerfiles.import_plugins - helper.config.dict_path = "qa-checks/cassini-bsp-dictionary" + helper.config.dict_path = ".dictionary" # Import all rules from the gem dangerfiles.import_dangerfiles end diff --git a/LICENSE.rst b/LICENSE.rst new file mode 100644 index 0000000000000000000000000000000000000000..fcd3a4db08b59ec47279e50272c663a689f021f0 --- /dev/null +++ b/LICENSE.rst @@ -0,0 +1,45 @@ +####### +License +####### + +The software is provided under the MIT license (below). + +:: + + Copyright 2024 Arm Limited and/or its affiliates + + open-source-office@arm.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +**************** +SPDX Identifiers +**************** + +Individual files contain the following tags instead of the full license text. + +:: + + SPDX-FileCopyrightText: Copyright + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/README b/README deleted file mode 100644 index 42a870ad84ea6a4a19a172129855148724a0c1ae..0000000000000000000000000000000000000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. -# -# SPDX-License-Identifier: MIT - -See ../README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1722c6d4dfd8cb19572d84be08eb333642e462a8 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ + + +# Cassini BSP + +## Introduction + +This Yocto layer is used by +[meta-cassini](https://gitlab.com/Linaro/cassini/meta-cassini). + +It modifies some Arm-maintained machine definitions and recipes from +[meta-arm-bsp](https://git.yoctoproject.org/meta-arm/tree/meta-arm-bsp) so that +they can be used to build and boot Cassini distro images. + +Currently supported platforms include: +* Corstone-1000 FVP (corstone1000-fvp) +* Corstone-1000 for MPS3 (corstone1000-mps3) + +At any given point in time, this repository may hold recipes, append-files, +config fragments, and/or out-of-tree patches which either: +- have not been upstreamed yet +- cannot be upstreamed (they are Cassini specific or otherwise inappropriate) + +For more details, see the Cassini documentation +[here](https://cassini.readthedocs.io/en/latest/index.html) + +Contributions to this repository are not accepted at this time + +## Repository License + +The repository's standard license is the MIT license, under which most of the +repository's content is provided. Exceptions to this standard license relate to +files that represent modifications to externally licensed works (for example, +patch files). These files may therefore be included in the repository under +alternative licenses in order to be compliant with the licensing requirements of +the associated external works. + +License details may be found in the [local license file](LICENSE.rst), or as +part of the project documentation. + +## Reporting Issues + +Please report problems using GitLab's "Issues" feature. + +## Reporting Security Issues + +If you find any security vulnerabilities, please do not report them via GitLab +Instead, send an email to the security team at psirt@arm.com stating that you +may have found a security vulnerability in meta-cassini-bsp. + +## Maintainer(s) + +* Adam Johnston + +## Disclaimer + +Arm reference solutions are Arm public example software projects that track and +pull upstream components, incorporating their respective security fixes +published over time. Arm partners are responsible for ensuring that the +components they use contain all the required security fixes, if and when they +deploy a product derived from Arm reference solutions. diff --git a/documentation/developer_manual/corstone1000.rst b/documentation/developer_manual/corstone1000.rst new file mode 100644 index 0000000000000000000000000000000000000000..2e0884ab1445f475caafcf1cece62d0ea0fb424c --- /dev/null +++ b/documentation/developer_manual/corstone1000.rst @@ -0,0 +1,19 @@ +.. + # SPDX-FileCopyrightText: Copyright (c) 2023, Linaro Limited. + # + # SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its + # affiliates + # + # SPDX-License-Identifier: MIT + +Corstone-1000 for MPS3 +====================== + + * **Corresponding value for** ``MACHINE`` **variable**: ``corstone1000-mps3`` + * **Target Platform Config**: ``kas/corstone1000-mps3.yml`` + + To read documentation about the Corstone-1000, see the + |Arm Corstone-1000 Technical Overview|_. + + For more information about the software stack for the Corstone-1000, see + |Arm Corstone-1000 Software|_. diff --git a/documentation/developer_manual/corstone1000fvp.rst b/documentation/developer_manual/corstone1000fvp.rst new file mode 100644 index 0000000000000000000000000000000000000000..9fd4d58fd72be3d67a62b16cb805b058d06f81c5 --- /dev/null +++ b/documentation/developer_manual/corstone1000fvp.rst @@ -0,0 +1,22 @@ +.. + # SPDX-FileCopyrightText: Copyright (c) 2023, Linaro Limited. + # + # SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its + # affiliates + # + # SPDX-License-Identifier: MIT + +Corstone-1000 FVP +================= + + * **Corresponding value for** ``MACHINE`` **variable**: ``corstone1000-fvp`` + * **Target Platform Config**: ``kas/corstone1000-fvp.yml`` + + To read documentation about the Corstone-1000, see the + |Arm Corstone-1000 Technical Overview|_. + + For more information about the software stack for the Corstone-1000, see + |Arm Corstone-1000 Software|_. + + To read documentation about the Corstone-1000 FVP, see the + |Fast Models Fixed Virtual Platforms (FVP) Reference Guide|_. diff --git a/documentation/user_manual/corstone1000.rst b/documentation/user_manual/corstone1000.rst new file mode 100644 index 0000000000000000000000000000000000000000..b6e66d81ed64fe719faea2578fb6679f5a7ae753 --- /dev/null +++ b/documentation/user_manual/corstone1000.rst @@ -0,0 +1,184 @@ +.. + # SPDX-FileCopyrightText: Copyright (c) 2023, Linaro Limited. + # + # SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its + # affiliates + # + # SPDX-License-Identifier: MIT + +############################################### +Getting Started with Arm Corstone-1000 for MPS3 +############################################### + +This document explains how to build, deploy, and boot the Cassini distro on the +Arm Corstone-1000 for MPS3. + +**NOTE:** Requires a micro SD card (at least 4 GB) and a USB drive (at +least 16 GB) + +.. note:: + Due to performance limitations, K3S is not currently supported on + the Arm Corstone-1000 for MPS3. + +***** +Build +***** + +The kas configuration file ``kas/corstone1000-mps3.yml`` +can be used to build images which target the Corstone-1000 for MPS3. + +******************** +Building MPS3 images +******************** + +To build Corstone-1000 MPS3 images: + + .. code-block:: console + + kas build --update kas/cassini.yml:kas/corstone1000-mps3.yml + +This will produce a Corstone-1000 firmware image here: + + ``build/tmp/deploy/images/corstone1000-mps3/corstone1000-flash-firmware-image-corstone1000-mps3.wic`` + +And a Cassini distribution image here: + + ``build/tmp/deploy/images/corstone1000-mps3/cassini-image-base-corstone1000-mps3.rootfs.wic.gz`` + + ``build/tmp/deploy/images/corstone1000-mps3/cassini-image-base-corstone1000-mps3.rootfs.wic.bmap`` + +*************************************************** +Prepare the firmware image for FPGA (Micro SD card) +*************************************************** + +The user should download the FPGA bit file image from `this link `__ +and under the section ``AN550: Arm® Corstone™-1000 for MPS3 Version 2.0``. + +Only copy the current directory structure shown below on to the Micro SD Card. + +.. code-block:: console + + config.txt + MB + ├── BRD_LOG.TXT + ├── HBI0309B + │ ├── AN550 + │ │ ├── AN550_v2.bit + │ │ ├── an550_v2.txt + │ │ └── images.txt + │ ├── board.txt + │ └── mbb_v210.ebf + └── HBI0309C + ├── AN550 + │ ├── AN550_v2.bit + │ ├── an550_v2.txt + │ └── images.txt + ├── board.txt + └── mbb_v210.ebf + SOFTWARE + ├── an550_st.axf + ├── bl1.bin + ├── cs1000.bin + └── ES0.bin + +To configure the board to boot automatically when powered on, edit +``./config.txt`` and change the value of ``AUTORUN`` from ``FALSE`` +to ``TRUE``. + +Depending upon the MPS3 board version (printed on the MPS3 board HBI0309B or HBI0309C) you should +update the ``./AN550/images.txt`` file so that the file points to the images under SOFTWARE directory. + +Here is an example + +.. code-block:: console + + ;************************************************ + ; Preload port mapping * + ;************************************************ + ; PORT 0 & ADDRESS: 0x00_0000_0000 QSPI Flash (XNVM) (32MB) + ; PORT 0 & ADDRESS: 0x00_8000_0000 OCVM (DDR4 2GB) + ; PORT 1 Secure Enclave (M0+) ROM (64KB) + ; PORT 2 External System 0 (M3) Code RAM (256KB) + ; PORT 3 Secure Enclave OTP memory (8KB) + ; PORT 4 CVM (4MB) + ;************************************************ + + [IMAGES] + TOTALIMAGES: 3 ;Number of Images (Max: 32) + + IMAGE0PORT: 1 + IMAGE0ADDRESS: 0x00_0000_0000 + IMAGE0UPDATE: RAM + IMAGE0FILE: \SOFTWARE\bl1.bin + + IMAGE1PORT: 0 + IMAGE1ADDRESS: 0x00_0000_0000 + IMAGE1UPDATE: AUTOQSPI + IMAGE1FILE: \SOFTWARE\cs1000.bin + + IMAGE2PORT: 2 + IMAGE2ADDRESS: 0x00_0000_0000 + IMAGE2UPDATE: RAM + IMAGE2FILE: \SOFTWARE\es0.bin + +The binaries are present in OUTPUT_DIR = ``<_workspace>/build/tmp/deploy/images/corstone1000-mps3`` directory. + +1. Copy ``bl1.bin`` from OUTPUT_DIR to SOFTWARE directory of the Micro SD card. +2. Copy ``corstone1000-flash-firmware-image-corstone1000-mps3.wic`` from OUTPUT_DIR directory to SOFTWARE + directory of the Micro SD card and rename the wic image to ``cs1000.bin``. +3. Copy ``es_flashfw.bin`` from OUTPUT_DIR directory to SOFTWARE directory of the Micro SD + card and rename to ``es0.bin``. + +**NOTE:** Renaming of the images are required because MCC firmware has +limitation of 8 characters before .(dot) and 3 characters after .(dot). + +********************************************* +Prepare the distro image for FPGA (USB image) +********************************************* + +Use the ``lsblk`` command to determine USB drive and bmap tool to copy the cassini distro to it. + +.. code-block:: console + + lsblk + sudo bmaptool copy --bmap cassini-image-base-corstone1000-mps3.rootfs.wic.bmap cassini-image-base-corstone1000-mps3.rootfs.wic.gz /dev/ + + +**************************** +Running the software on FPGA +**************************** + +Insert SD card and USB drive before switching ON the device. + +On the host machine, connect the board via USB. + +If there are no other TTY USB devices, then the three ports from the MPS3 +will be connected as follows: + + - ttyUSB0 for MCC, OP-TEE and Secure Partition + - ttyUSB1 for Boot Processor (Cortex-M0+) + - ttyUSB2 for Host Processor (Cortex-A35) + +The rest of this guide assumes there are no other TTY USB devices on the +host machine. + +Connect to the serial console(s) using any terminal client (``picocom``, +``minicom``, or ``screen`` should all work). + +For example, run the following commands to open new picocom sessions for +each port: + +.. code-block:: console + + sudo picocom -b 115200 /dev/ttyUSB0 + sudo picocom -b 115200 /dev/ttyUSB1 + sudo picocom -b 115200 /dev/ttyUSB2 + +.. note:: + + ``sudo`` should not be required if the current user is in the + ``dialout`` group + +.. note:: + See notes under :ref:`run-time_integration_tests_label` before running + validation steps. diff --git a/documentation/user_manual/corstone1000fvp.rst b/documentation/user_manual/corstone1000fvp.rst new file mode 100644 index 0000000000000000000000000000000000000000..5bf6bf6ea943149afe36e48f966586be6e333b9b --- /dev/null +++ b/documentation/user_manual/corstone1000fvp.rst @@ -0,0 +1,124 @@ +.. + # SPDX-FileCopyrightText: Copyright (c) 2023, Linaro Limited. + # + # SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its + # affiliates + # + # SPDX-License-Identifier: MIT + +########################################## +Getting Started with Arm Corstone-1000 FVP +########################################## + +This document explains how to build and boot the Cassini distro on the Arm +Corstone-1000 FVP (Fast Model Fixed Virtual Platform). + +.. note:: + Due to performance limitations, K3S is not currently supported on + the Arm Corstone-1000 FVP. + +***** +Build +***** + +The provided kas configuration file kas/corstone1000-fvp.yml can be used to build images +that are targeting the Corstone-1000 FVP. + +.. note:: + To build and run any image for the Corstone-1000 FVP the user has to + accept its |EULA|_, which can be done by executing + the following command in the build environment: + + .. code-block:: console + + export FVP_CORSTONE1000_EULA_ACCEPT=True + +******************* +Building FVP images +******************* + +To build Corstone-1000 FVP images: + + .. code-block:: console + + kas build --update kas/cassini.yml:kas/corstone1000-fvp.yml + +Or if using kas-container: + + .. code-block:: console + + kas-container --runtime-args "-e FVP_CORSTONE1000_EULA_ACCEPT=True" build \ + kas/cassini.yml:kas/corstone1000-fvp.yml + +This will produce a Corstone-1000 firmware image here: + + ``build/tmp/deploy/images/corstone1000-fvp/corstone1000-flash-firmware-image-corstone1000-fvp.wic`` + +And a Cassini distribution image here: + + ``build/tmp/deploy/images/corstone1000-fvp/cassini-image-base-corstone1000-fvp.rootfs.wic`` + +*************** +Running the FVP +*************** + +To start the FVP and get the console: + + .. code-block:: console + + kas shell -c "../layers/meta-arm/scripts/runfvp --console" \ + kas/cassini.yml:kas/corstone1000-fvp.yml + +Or if using kas-container: + + .. code-block:: console + + kas-container --runtime-args "-e FVP_CORSTONE1000_EULA_ACCEPT=True" \ + shell -c "/work/layers/meta-arm/scripts/runfvp --console" \ + kas/cassini.yml:kas/corstone1000-fvp.yml + +By default, the Corstone-1000 FVP is configured for user mode networking. For more +information and instructions on how to configure networking with Fixed Virtual Platforms, +refer to the |Fast Models Reference Guide|_. + +.. note:: + See notes under :ref:`run-time_integration_tests_label` before running + validation steps. + +.. _reproduce_run-time_integration_tests: + +********** +Validation +********** + +The following validation tests can be performed on the Cassini Reference Stack: + + * System Integration Tests: + + * Cassini Architecture Stack: + + .. code-block:: console + + TESTIMAGE_AUTO=1 kas build kas/cassini.yml:kas/corstone1000-fvp.yml + + Or if using kas-container: + + .. code-block:: console + + kas-container --runtime-args "-e FVP_CORSTONE1000_EULA_ACCEPT=True -e TESTIMAGE_AUTO=1" build \ + kas/cassini.yml:kas/corstone1000-fvp.yml + + The previous test takes around 2 minutes to complete. + + A similar output should be printed out: + + .. code-block:: console + + NOTE: Executing Tasks + Creating terminal default on host_terminal_0 + default: Waiting for login prompt + RESULTS: + RESULTS - linuxboot.LinuxBootTest.test_linux_boot: PASSED (23.70s) + SUMMARY: + cassini-image-base () - Ran 1 test in 23.704s + cassini-image-base - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0) diff --git a/documentation/variables.py b/documentation/variables.py new file mode 100644 index 0000000000000000000000000000000000000000..f7fcffe150f3b40d59a14359c997c5a0439f2be6 --- /dev/null +++ b/documentation/variables.py @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2024, Linaro Limited. +# +# SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its +# affiliates +# +# SPDX-License-Identifier: MIT + +# This file centralizes the variables and links used throughout the +# documentation. The dictionaries are converted to a single string that is used +# as the rst_prolog (see the Sphinx Configuration documentation at +# https://www.sphinx-doc.org/en/master/usage/configuration.html for more info). + +# There are two types of key-value substitutions: +# 1. simple string replacements +# 2. replacement with a rendered hyperlink, where the key defines what the +# rendered hyperlink text will be + +# Prepend the key with "link:" to identify it as a Sphinx target name for use +# as a hyperlink. The "link:" prefix is dropped from the substitution name. +# +# For example: +# "link:This URL": "www.arm.com" +# "company name": "arm" +# Can be used as: +# The |company name| website can be found at |This URL|_. +# +# Note the "_" which renders the substitution as a hyperlink is only possible +# because the variable is defined as a link, to be resolved as a Sphinx target. + +""" Called from the parent (Cassini) documentation build to initialise +variables which are referenced from documentation sources in this repository +""" + +DOCS_RELEASE = "latest" + +general_links = { + "link:Arm Corstone-1000 Technical Overview": + "https://developer.arm.com/documentation/102360/0000", + "link:Arm Corstone-1000 Software": + "https://corstone1000.docs.arm.com/en/" + f"{DOCS_RELEASE}", + "link:Fast Models Fixed Virtual Platforms (FVP) Reference Guide": + "https://developer.arm.com/documentation/100966/1119", + "link:Fast Models Reference Guide": + "https://developer.arm.com/documentation/100964/1119/" + "Introduction-to-Fast-Models/User-mode-networking", + "link:EULA": "https://developer.arm.com/downloads/" + "-/arm-ecosystem-fvps/eula", +} + + +def generate_replacement(key, value): + """ Generate simple string substitution """ + + replacement = f".. |{key}| replace:: {value}" + return f"{replacement}" + + +def generate_link(key, link): + """ Generate link substitution """ + + definition = f".. _{key}: {link}" + key_mapping = f".. |{key}| replace:: {key}" + return f"{definition}\n{key_mapping}" + + +def generate_rst_prolog(): + """ Generate all substitutions that should be available in every file """ + + rst_prolog = "" + + for variables_group in [general_links]: + for key, value in variables_group.items(): + if key.startswith("link:"): + rst_prolog += generate_link(key.split("link:") + [1], value) + "\n" + else: + rst_prolog += generate_replacement(key, value) + "\n" + + return rst_prolog diff --git a/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb b/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb index 771e8b5a68811412149e044b1f6dfc593835616e..f4ec1ab0a97a99256c37f7bf6cb35219f8cf0bcf 100644 --- a/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb +++ b/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb @@ -9,7 +9,7 @@ DESCRIPTION = "Image used during testing of initramfs based platforms to \ tested" LICENSE = "MIT" -DEPENDS += "corstone1000-flash-firmware-image" +DEPENDS += "trusted-firmware-a" inherit image inherit nopackages diff --git a/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend b/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend index 28399fb2633e0267b7eade37153f7177b22f3fef..fadcad70fbf9ab44cff693c57b35e07f469a25b7 100644 --- a/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend +++ b/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend @@ -11,5 +11,5 @@ SRC_URI:append:corstone1000 = " \ # nooelint: oelint.func.specific - Common name set in Corstone-1000 definitions do_install:append:corstone1000() { - install -D -m0644 ${WORKDIR}/timeouts.conf ${D}${systemd_system_unitdir}.conf.d/01-${PN}.conf + install -D -m0644 ${UNPACKDIR}/timeouts.conf ${D}${systemd_system_unitdir}.conf.d/01-${PN}.conf } diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0019-se-proxy-protobuf-change.patch b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0019-se-proxy-protobuf-change.patch new file mode 100644 index 0000000000000000000000000000000000000000..e4d0b9759fa012c0e450cdac92dbfd6d8ffaef32 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0019-se-proxy-protobuf-change.patch @@ -0,0 +1,65 @@ +From e5a4487e2b757d0063148691c7d06ae1c7e15b9a Mon Sep 17 00:00:00 2001 +From: Emekcan Aras +Date: Tue, 18 Jun 2024 11:52:43 +0100 +Subject: [PATCH] protobuf fix + +Upstream-Status: Pending (not yet submitted to upstream) +Signed-off-by: Emekcan Aras +--- + .../se-proxy/env/commonsp/se_proxy_sp.c | 25 ++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/deployments/se-proxy/env/commonsp/se_proxy_sp.c b/deployments/se-proxy/env/commonsp/se_proxy_sp.c +index a0eb03b6f..e2774c135 100644 +--- a/deployments/se-proxy/env/commonsp/se_proxy_sp.c ++++ b/deployments/se-proxy/env/commonsp/se_proxy_sp.c +@@ -13,6 +13,7 @@ + #include "trace.h" + #include "deployments/se-proxy/infra/service_proxy_factory.h" + #include "deployments/se-proxy/se_proxy_interfaces.h" ++#include + + static bool sp_init(uint16_t *own_sp_id); + +@@ -39,7 +40,7 @@ void __noreturn sp_main(union ffa_boot_info *boot_info) + goto fatal_error; + } + +- rpc_status = ts_rpc_endpoint_sp_init(&rpc_endpoint, 5, 16); ++ rpc_status = ts_rpc_endpoint_sp_init(&rpc_endpoint, 6, 16); + if (rpc_status != RPC_SUCCESS) { + EMSG("Failed to initialize RPC endpoint: %d", rpc_status); + goto fatal_error; +@@ -82,6 +83,28 @@ void __noreturn sp_main(union ffa_boot_info *boot_info) + goto fatal_error; + } + ++ struct rpc_service_interface *crypto_iface_protobuf = NULL; ++ struct crypto_provider *crypto_protobuf_provider = NULL; ++ ++ crypto_protobuf_provider = crypto_protobuf_provider_factory_create(); ++ if (!crypto_protobuf_provider) { ++ EMSG("Failed to create crypto protobuf provider factory"); ++ goto fatal_error; ++ } ++ ++ crypto_iface_protobuf = service_provider_get_rpc_interface( ++ &crypto_protobuf_provider->base_provider); ++ if (!crypto_iface_protobuf) { ++ EMSG("Failed to create service provider RPC interface"); ++ goto fatal_error; ++ } ++ ++ rpc_status = ts_rpc_endpoint_sp_add_service(&rpc_endpoint, crypto_iface_protobuf); ++ if (rpc_status != RPC_SUCCESS) { ++ EMSG("Failed to add service to RPC endpoint: %d", rpc_status); ++ goto fatal_error; ++ } ++ + rpc_iface = attest_proxy_create(); + if (!rpc_iface) { + EMSG("Failed to create Attestation proxy"); +-- +2.25.1 + + diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/files/n1sdp/0001-add-boot-order-into-SP-manifest.patch b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/files/n1sdp/0001-add-boot-order-into-SP-manifest.patch deleted file mode 100644 index 8853dbf8c632ba1f114c0f4589bb6677656ad613..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/files/n1sdp/0001-add-boot-order-into-SP-manifest.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 9cb4babc2e496a4028bcd75337ea4466563f73ca Mon Sep 17 00:00:00 2001 -From: Emekcan Aras -Date: Wed, 13 Mar 2024 16:44:10 +0000 -Subject: [PATCH] add boot order into SP manifest - -The block storage SP should be loaded before the protected storage and ITS -SP due to block storage dependency. After OP-TEE v4.0, SPs can be loaded -in orderly fashion depending on the boot-order property in the SPs -manifest file. This patch loads SPs in a orderly fashion to make sure -there is no runtime dependency issues. - -Signed-off-by: Emekcan Aras -Upstream-Status: Pending ---- - .../config/default-opteesp/default_block-storage.dts.in | 1 + - deployments/crypto/config/default-opteesp/default_crypto.dts.in | 1 + - .../shared-flash-opteesp/default_internal-trusted-storage.dts.in | 1 + - .../config/shared-flash-opteesp/default_protected-storage.dts.in | 1 + - .../config/default-opteesp/default_smm-gateway.dts.in | 1 + - 5 files changed, 5 insertions(+) - -diff --git a/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in b/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in -index 0a97cb5..4b408ca 100644 ---- a/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in -+++ b/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in -@@ -18,4 +18,5 @@ - messaging-method = <3>; /* Direct messaging only */ - ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */ - elf-format = <1>; -+ boot-order = /bits/ 16 <1>; - }; -diff --git a/deployments/crypto/config/default-opteesp/default_crypto.dts.in b/deployments/crypto/config/default-opteesp/default_crypto.dts.in -index c900636..7d90a88 100644 ---- a/deployments/crypto/config/default-opteesp/default_crypto.dts.in -+++ b/deployments/crypto/config/default-opteesp/default_crypto.dts.in -@@ -18,6 +18,7 @@ - messaging-method = <3>; /* Direct messaging only */ - ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */ - elf-format = <1>; -+ boot-order = /bits/ 16 <4>; - - device-regions { - compatible = "arm,ffa-manifest-device-regions"; -diff --git a/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in b/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in -index 77d0805..a6ac644 100644 ---- a/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in -+++ b/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in -@@ -18,4 +18,5 @@ - messaging-method = <3>; /* Direct messaging only */ - ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */ - elf-format = <1>; -+ boot-order = /bits/ 16 <3>; - }; -diff --git a/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in b/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in -index b305fbb..95bd537 100644 ---- a/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in -+++ b/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in -@@ -18,4 +18,5 @@ - messaging-method = <3>; /* Direct messaging only */ - ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */ - elf-format = <1>; -+ boot-order = /bits/ 16 <2>; - }; -diff --git a/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in b/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in -index d74c2f3..4803de1 100644 ---- a/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in -+++ b/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in -@@ -18,6 +18,7 @@ - messaging-method = <3>; /* Direct messaging only */ - ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */ - elf-format = <1>; -+ boot-order = /bits/ 16 <5>; - - memory-regions { - compatible = "arm,ffa-manifest-memory-regions"; --- -2.25.1 - diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-platforms.inc b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-platforms.inc deleted file mode 100644 index 789311e42f1c84c5fd6b9f4eefd79d8df6a8f9af..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-platforms.inc +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS:prepend:n1sdp := "${THISDIR}/files/n1sdp:" - -SRC_URI:append:n1sdp = " \ - file://0001-add-boot-order-into-SP-manifest.patch \ - " diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-attestation_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-attestation_%.bbappend deleted file mode 100644 index 48d83d79111f3b6abaf0deccf36f1de116ce48f0..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-attestation_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its -# affiliates -# -# SPDX-License-Identifier: MIT - -require ts-platforms.inc diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-block-storage_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-block-storage_%.bbappend deleted file mode 100644 index 48d83d79111f3b6abaf0deccf36f1de116ce48f0..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-block-storage_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its -# affiliates -# -# SPDX-License-Identifier: MIT - -require ts-platforms.inc diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-crypto_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-crypto_%.bbappend deleted file mode 100644 index 48d83d79111f3b6abaf0deccf36f1de116ce48f0..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-crypto_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its -# affiliates -# -# SPDX-License-Identifier: MIT - -require ts-platforms.inc diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-its_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-its_%.bbappend deleted file mode 100644 index 7794851be537330a159459d7803a372803f05d7d..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-its_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its -# affiliates -# -# SPDX-License-Identifier: MIT - -require ts-platforms.inc - -# Override configuration to use block storage service -OECMAKE_SOURCEPATH:n1sdp = "${S}/deployments/internal-trusted-storage/config/shared-flash-${TS_ENV}" diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..13d0fc66c6332f4032cbbe06f9b52d2465ece676 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its +# affiliates +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend:corstone1000 := "${THISDIR}/corstone1000:" + +COMPATIBLE_MACHINE:corstone1000 = "corstone1000" +SRC_URI:append:corstone1000 = " \ + file://0019-se-proxy-protobuf-change.patch \ + " diff --git a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-storage_%.bbappend b/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-storage_%.bbappend deleted file mode 100644 index edde7ed562573d34070e7a80f0b03efd8be54d33..0000000000000000000000000000000000000000 --- a/meta-arm/meta-arm-bsp/recipes-security/trusted-services/ts-sp-storage_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its -# affiliates -# -# SPDX-License-Identifier: MIT - -require ts-platforms.inc - -# Override configuration to use block storage service -OECMAKE_SOURCEPATH:n1sdp = "${S}/deployments/protected-storage/config/shared-flash-${TS_ENV}"