From 0844ce84ab2c6855b198681b988936cf49793874 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:52:55 +0000 Subject: [PATCH 1/5] cassini-ci: Fix file paths in CI rules Fix the incorrect file paths specified in the CI rules so that CI jobs can be triggered when those files are modified. Signed-off-by: Devaraj Ranganna Signed-off-by: Vikas Katariya --- .gitlab/ci/rules.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 008d3b7..9aea33a 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT --- @@ -33,8 +34,8 @@ .kas-common: &kas-common - "meta-cassini-config/kas/cassini.yml" - "meta-cassini-config/kas/ci.yml" - - "meta-cassini-config/kas/internal/cassini-base.yml" - - "meta-cassini-config/kas/internal/cassini-release.yml" + - "meta-cassini-config/kas/include/cassini-base.yml" + - "meta-cassini-config/kas/include/cassini-release.yml" .kas-k3s: &kas-k3s - "meta-cassini-config/kas/cassini.yml" @@ -49,7 +50,7 @@ .kas-n1sdp: &kas-n1sdp - "meta-cassini-config/kas/n1sdp.yml" - - "meta-cassini-config/kas/internal/arm-machines.yml" + - "meta-cassini-config/kas/include/arm-machines.yml" .layer-configs: &layer-configs - "meta-cassini-distro/conf/layer.conf" -- GitLab From 8ab6dc89c9e0b2f1de659783f3d425476be87312 Mon Sep 17 00:00:00 2001 From: Vikas Katariya Date: Thu, 8 Dec 2022 17:17:34 +0000 Subject: [PATCH 2/5] cassini-[bsp,distro]: Move `*-extra-settings.inc` Move `N1SDP-cassini-extra-settings.inc` under `include` folder, to align with `meta-arm` repository structure. This allows us to include all machine specific extra-settings under the same directory. Signed-off-by: Vikas Katariya --- .../machine/{ => include}/n1sdp-cassini-extra-settings.inc | 0 meta-cassini-distro/conf/distro/cassini.conf | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename meta-cassini-bsp/conf/machine/{ => include}/n1sdp-cassini-extra-settings.inc (100%) diff --git a/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc similarity index 100% rename from meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc rename to meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc diff --git a/meta-cassini-distro/conf/distro/cassini.conf b/meta-cassini-distro/conf/distro/cassini.conf index d087dfd..319502e 100644 --- a/meta-cassini-distro/conf/distro/cassini.conf +++ b/meta-cassini-distro/conf/distro/cassini.conf @@ -1,10 +1,11 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT require ${COREBASE}/meta-poky/conf/distro/poky.conf -include conf/machine/${MACHINE}-cassini-extra-settings.inc +include conf/machine/include/${MACHINE}-cassini-extra-settings.inc # Unix group name for dev/tee* ownership. TEE_GROUP_NAME = "teeclnt" -- GitLab From fc039807910db227000d287a65604ea51f00f2cc Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:58:47 +0000 Subject: [PATCH 3/5] cassini-[docs,bsp,config,distro]: Add Corstone-1000-mps3 board support Add support for Corstone-1000-mps3 FPGA board https://developer.arm.com/documentation/102360/0000. The Corstone-1000 platform firmware needs to built using libc-musl library. Therefore, introduced a new Yocto multiconfig `meta-cassini-bsp/conf/multiconfig/firmware.conf`. In addition, use `libc-glibc` override to select patches for Cassini distribution and `libc-musl` override to select patches for Corstone-1000 firmware. Also, add `cassini` override where necessary to make sure yocto layer check doesn't fail. Finally, add Cassini-SDK support to Corstone-1000-mps3. This also enables psa-arch-tests for the target. Changelog: feature Signed-off-by: Devaraj Ranganna Signed-off-by: Vikas Katariya --- .../developer_manual/build_system.rst | 23 +++- documentation/user_manual/build.rst | 23 ++-- documentation/variables.py | 4 +- meta-cassini-bsp/conf/layer.conf | 6 +- ...rstone1000-mps3-cassini-extra-settings.inc | 16 +++ .../include/n1sdp-cassini-extra-settings.inc | 9 -- .../conf/multiconfig/firmware.conf | 114 ++++++++++++++++++ .../recipes-bsp/grub/grub-efi_%.bbappend | 7 ++ .../images/corstone1000-deploy-image.bb | 38 ++++++ .../corstone1000-utils-overlay-image.bb | 20 +++ .../systemd/corstone1000/system.conf | 8 ++ .../systemd/systemd-conf_%.bbappend | 14 +++ .../recipes-kernel/linux/linux-%.bbappend | 17 +++ .../linux-yocto/corstone1000/cgroups.cfg | 9 ++ .../linux-yocto/corstone1000/container.cfg | 5 + .../linux/linux-yocto/corstone1000/extfs.cfg | 8 ++ .../linux/linux-yocto/corstone1000/mmc.cfg | 26 ++++ .../linux-yocto/corstone1000/network.cfg | 26 ++++ .../linux/linux-yocto/corstone1000/sdk.cfg | 1 + .../wic/corstone1000-efidisk.wks.in | 14 +++ .../meta-arm-bsp/wic/corstone1000-grub.cfg | 13 ++ meta-cassini-config/kas/corstone1000-mps3.yml | 17 +++ .../qa-checks/cassini-dictionary | 5 + .../classes/cassini-image.bbclass | 19 +-- .../conf/distro/include/cassini-sdk.inc | 9 +- .../conf/distro/include/cassini-test.inc | 25 ++-- .../base-files/base-files_%.bbappend | 9 +- .../recipes-core/images/cassini-image-base.bb | 6 +- .../procps/procps-cassini.inc | 9 +- .../recipes-extended/shadow/shadow_%.bbappend | 5 +- .../recipes-extended/sudo/sudo_%.bbappend | 11 +- .../recipes-kernel/linux/linux-%.bbappend | 9 +- 32 files changed, 453 insertions(+), 72 deletions(-) create mode 100644 meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc create mode 100644 meta-cassini-bsp/conf/multiconfig/firmware.conf create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg create mode 100644 meta-cassini-config/kas/corstone1000-mps3.yml diff --git a/documentation/developer_manual/build_system.rst b/documentation/developer_manual/build_system.rst index ccf2adf..cabc463 100644 --- a/documentation/developer_manual/build_system.rst +++ b/documentation/developer_manual/build_system.rst @@ -75,10 +75,25 @@ Neoverse N1 System Development Platform (N1SDP) This supported target platform is the Neoverse N1 System Development Platform (N1SDP), implemented in |meta-arm-bsp|_. - The ``n1sdp.yml`` **Target Platform Config** includes common - configuration from the ``meta-cassini-config/kas/include/arm-machines.yml`` - which defines the BSPs, layers, and dependencies required when building for - the platform. + To read documentation about the N1SDP, see the + |N1SDP Technical Reference Manual|_. + +Corstone-1000 for MPS3 +====================== + + * **Corresponding value for** ``MACHINE`` **variable**: ``corstone1000-mps3`` + * **Target Platform Config**: ``meta-cassini-config/kas/corstone1000-mps3.yml`` + + This supported target platform is the Corstone-1000 MPS3, implemented in + |meta-arm-bsp|_. + + To read documentation about the Corstone-1000, see the + |Arm Corstone-1000 Technical Overview|_. + +The ``n1sdp.yml`` and ``corstone1000-mps3.yml`` **Target Platform Config** +includes common configuration from the +``meta-cassini-config/kas/include/arm-machines.yml`` which defines the BSPs, +layers, and dependencies required when building for the platform. .. _distribution_image_features_label: diff --git a/documentation/user_manual/build.rst b/documentation/user_manual/build.rst index d7627d2..bbb18cf 100644 --- a/documentation/user_manual/build.rst +++ b/documentation/user_manual/build.rst @@ -1,5 +1,6 @@ .. - # Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2022-2023 Arm Limited and/or its affiliates. + # # # SPDX-License-Identifier: MIT @@ -40,20 +41,14 @@ categories: * **Target Platform Configs**: Set the target platform - Cassini currently supports the The Neoverse N1 System Development Platform - (N1SDP), corresponding to the ``n1sdp`` ``MACHINE`` implemented in - |meta-arm-bsp|_. - A single Target Platform Config is therefore provided: + For information on supported targets in Cassini and corresponding value + for ``MACHINE`` **variable**, refer to :ref:`target_platforms_label`. - * ``n1sdp.yml`` to select the N1SDP as the target platform. - - To read documentation about the N1SDP, see the - |N1SDP Technical Reference Manual|_. - -These kas configuration files can be used to build a custom Cassini distribution -by passing one **Base Config**, zero or more **Build Modifier Configs**, -and one **Target Platform Config** to the kas build tool, chained via a colon -(:) character. Examples for this are given later in this document. +These kas configuration files can be used to build a custom Cassini +distribution by passing one **Base Config**, zero or more +**Build Modifier Configs**, and one **Target Platform Config** to the kas build +tool, chained via a colon (:) character. Examples for this are given later in +this document. In the next section, guidance is provided for configuring, building and deploying Cassini distributions using these kas configuration files. diff --git a/documentation/variables.py b/documentation/variables.py index 0437edd..c2ecb42 100644 --- a/documentation/variables.py +++ b/documentation/variables.py @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT @@ -47,6 +48,7 @@ general_links = { "link:kas Dependencies & installation": f"https://kas.readthedocs.io/en/{kas_version}/userguide.html#dependencies-installation", "link:meta-arm-bsp": f"https://git.yoctoproject.org/meta-arm/tree/meta-arm-bsp/documentation/n1sdp.md?h={yocto_release}", "link:N1SDP Technical Reference Manual": "https://developer.arm.com/documentation/101489/0000", + "link:Arm Corstone-1000 Technical Overview": "https://developer.arm.com/documentation/102360/0000", "link:PEP 8": "https://peps.python.org/pep-0008/", "link:pycodestyle Documentation": "https://pycodestyle.pycqa.org/en/latest/", "link:Shellcheck": "https://github.com/koalaman/shellcheck", diff --git a/meta-cassini-bsp/conf/layer.conf b/meta-cassini-bsp/conf/layer.conf index 2ba816e..2904563 100644 --- a/meta-cassini-bsp/conf/layer.conf +++ b/meta-cassini-bsp/conf/layer.conf @@ -1,4 +1,5 @@ -# Copyright (c) 2022-2023 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT @@ -14,3 +15,6 @@ BBFILES_DYNAMIC += " \ BBFILE_COLLECTIONS += "meta-cassini-bsp" BBFILE_PATTERN_meta-cassini-bsp = "^${LAYERDIR}/" LAYERSERIES_COMPAT_meta-cassini-bsp = "mickledore" + +# Root directory for the meta-cassini-bsp/meta-arm/meta-arm-bsp +CASSINI_ARM_BSP_DYNAMIC_DIR := "${LAYERDIR}/meta-arm/meta-arm-bsp" diff --git a/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc new file mode 100644 index 0000000..b47c7b2 --- /dev/null +++ b/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc @@ -0,0 +1,16 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +# Remove initramfs image generation for cassini distribution due to size restrictions +INITRAMFS_IMAGE:remove:libc-glibc = "corstone1000-initramfs-image" + +# Extend the wks search path to find custom wks file +WKS_SEARCH_PATH:prepend:libc-glibc:corstone1000 := "${CASSINI_ARM_BSP_DYNAMIC_DIR}/wic:" +WKS_FILE:libc-glibc:corstone1000 = "corstone1000-efidisk.wks.in" +GRUB_CFG_FILE:libc-glibc:corstone1000 ?= "${CASSINI_ARM_BSP_DYNAMIC_DIR}/wic/corstone1000-grub.cfg" + +# Add grub-efi +EFI_PROVIDER:libc-glibc ?= "grub-efi" +MACHINE_FEATURES:append:libc-glibc = " efi" diff --git a/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc index 2836686..b04be3f 100644 --- a/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc +++ b/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc @@ -8,12 +8,3 @@ MACHINE_FEATURES:append = " arm-ffa" # Trusted services secure partitions MACHINE_FEATURES:append = " ts-crypto ts-storage ts-its ts-attestation" - -IMAGE_INSTALL:append = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'cassini-test', \ - 'optee-test', '', d)}" - -IMAGE_INSTALL:append = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'cassini-test', \ - 'packagegroup-ts-tests-psa', '', d)}" - diff --git a/meta-cassini-bsp/conf/multiconfig/firmware.conf b/meta-cassini-bsp/conf/multiconfig/firmware.conf new file mode 100644 index 0000000..fa68eaf --- /dev/null +++ b/meta-cassini-bsp/conf/multiconfig/firmware.conf @@ -0,0 +1,114 @@ +# Based on: meta-poky/conf/distro/poky-tiny.conf +# In open-source project: https://git.yoctoproject.org/poky/tree/meta-poky/conf/distro/poky-tiny.conf?id=eaf8ce9d39a2c0d9c42b32fb6596ab4302f93a1a +# +# Original file: Copyright (c) 2011, Intel Corporation. +# Modifications: Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +TCLIBC = "musl" + +FULL_OPTIMIZATION="-Os -pipe ${DEBUG_FLAGS}" + +# FIXME: consider adding a new "tiny" feature +#DISTRO_FEATURES_append = " tiny" + +# Distro config is evaluated after the machine config, so we have to explicitly +# set the kernel provider to override a machine config. +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny" +PREFERRED_VERSION_linux-yocto-tiny ?= "5.15%" + +# We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny +#POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot" +# Drop kernel-module-af-packet from RRECOMMENDS +POKY_DEFAULT_EXTRA_RRECOMMENDS = "" + +# FIXME: what should we do with this? +TCLIBCAPPEND = "" + +# Disable wide char support for ncurses as we don't include it in +# in the LIBC features below. +# Leave native enable to avoid build failures +ENABLE_WIDEC = "false" +ENABLE_WIDEC:class-native = "true" + +# Drop native language support. This removes the +# eglibc->bash->gettext->l ibc-posix-clang-wchar dependency. +USE_NLS="no" + +# Comment out any of the lines below to disable them in the build +# DISTRO_FEATURES options: +# alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci +DISTRO_FEATURES_TINY = "pci" +DISTRO_FEATURES_NET = "ipv4 ipv6" +DISTRO_FEATURES_USB = "usbhost" +#DISTRO_FEATURES_USBGADGET = "usbgadget" +#DISTRO_FEATURES_WIFI = "wifi" + +DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \ + ${DISTRO_FEATURES_NET} \ + ${DISTRO_FEATURES_USB} \ + ${DISTRO_FEATURES_USBGADGET} \ + ${DISTRO_FEATURES_WIFI} \ + " + +# Enable LFS - see bug YOCTO #5865 +DISTRO_FEATURES:append:libc-musl = " largefile" + +DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" +DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" + +# enable mdev/busybox for init +INIT_MANAGER = "mdev-busybox" +VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" +VIRTUAL-RUNTIME_init_manager = "busybox" +VIRTUAL-RUNTIME_initscripts = "initscripts" +VIRTUAL-RUNTIME_keymaps = "keymaps" +VIRTUAL-RUNTIME_login_manager = "busybox" + +# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in +# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and +# netbase. + +# By default we only support initramfs. We don't build live as that +# pulls in a lot of dependencies for the live image and the installer, like +# udev, grub, etc. These pull in gettext, which fails to build with wide +# character support. +IMAGE_FSTYPES = "cpio.gz" +QB_DEFAULT_FSTYPE = "cpio.gz" + +# Drop v86d from qemu dependency list (we support serial) +# Drop grub from meta-intel BSPs +# FIXME: A different mechanism is needed here. We could define -tiny +# variants of all compatible machines, but that leads to a lot +# more machine configs to maintain long term. +MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "" + +# The mtrace script included by eglibc is a perl script. This means the system +# will build perl in case this package is installed. Since we don't care about +# this script for the purposes of tiny, remove the dependency from here. +RDEPENDS:${PN}-mtrace:pn-eglibc = "" + +SKIP_RECIPE[build-appliance-image] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-rt] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-rt-sdk] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato-dev] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato-sdk] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-x11] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-weston] = "not buildable with poky-tiny" + +# Disable python usage in opkg-utils since it won't build with tiny config +PACKAGECONFIG:remove:pn-opkg-utils = "python" + +DISTRO_FEATURES:remove = "pci ipv6 usbhost systemd virtualization seccomp k3s cassini-parsec cassini-security" + +# Cassini specific config options below +# Ensure this config has it's own TMPDIR +TMPDIR:append = "-firmware" + +KERNEL_CLASSES:remove = "containers_kernelcfg_check k3s_kernelcfg_check" + +# Include any machine specific extras +include conf/machine/include/${MACHINE}-firmware-extra-settings.inc diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend new file mode 100644 index 0000000..1999321 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend @@ -0,0 +1,7 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +# Ensure grub supports the required commands +GRUB_BUILDIN:append:corstone1000 = " gzio" diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb new file mode 100644 index 0000000..2ae1d8b --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb @@ -0,0 +1,38 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Firmware image deploying multiconfig firmware" + +inherit deploy nopackages + +LICENSE = "MIT" +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(corstone1000-mps3)" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" + +FIRMWARE_BINARIES = "corstone1000-image-${MACHINE}.wic.nopt \ + ${@bb.utils.contains('DISTRO_FEATURES','cassini-test', \ + 'corstone1000-utils-overlay-image-${MACHINE}.tar.bz2', '', d)} \ + " + +do_deploy() { + firmwareloc="${TOPDIR}/tmp-firmware/deploy/images/${MACHINE}" + for firmware in ${FIRMWARE_BINARIES}; do + cp -av ${firmwareloc}/${firmware} ${DEPLOYDIR}/ + if [ -L ${firmwareloc}/${firmware} ]; then + cp -av ${firmwareloc}/$(readlink ${firmwareloc}/${firmware}) ${DEPLOYDIR}/ + fi + done +} + +do_deploy[umask] = "022" +do_deploy[mcdepends] = "mc::firmware:corstone1000-image:do_image_complete \ + ${@bb.utils.contains('DISTRO_FEATURES', 'cassini-test', \ + 'mc::firmware:corstone1000-utils-overlay-image:do_image_complete', '', d)} \ + " + +addtask deploy after do_prepare_recipe_sysroot diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb new file mode 100644 index 0000000..b201e00 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb @@ -0,0 +1,20 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Overlay image containing bmaptool" +LICENSE = "MIT" + +inherit core-image +inherit nopackages + +PACKAGE_INSTALL = "bmap-tools" + +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" + +IMAGE_ROOTFS_SIZE = "0" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +IMAGE_FSTYPES += "tar.bz2" diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf new file mode 100644 index 0000000..48c9395 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf @@ -0,0 +1,8 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +[Manager] +# Change DefaultTimeoutStartSec from 90s to 300s +DefaultTimeoutStartSec = 300s diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 0000000..b665a62 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend := "${THISDIR}:" + +SRC_URI:append:corstone1000 = "\ + file://system.conf \ +" + +do_install:append:corstone1000() { + install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_system_unitdir}.conf.d/01-${PN}.conf +} diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend new file mode 100644 index 0000000..cffe1c8 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend @@ -0,0 +1,17 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend:libc-glibc := "${THISDIR}:${THISDIR}/linux-yocto:" + +SRC_URI:append:libc-glibc:corstone1000 = " \ + file://extfs.cfg \ + file://cgroups.cfg \ + file://mmc.cfg \ + file://container.cfg \ + file://network.cfg \ + ${@bb.utils.contains('DISTRO_FEATURES', \ + 'cassini-sdk', \ + 'file://sdk.cfg ', '', d)} \ + " diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg new file mode 100644 index 0000000..0544241 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg @@ -0,0 +1,9 @@ +CONFIG_CGROUP_SCHED=y +CONFIG_CGROUPS=y +CONFIG_CGROUP_DEBUG=y +CONFIG_CGROUP_DEVICE=y +CONFIG_BLK_CGROUP=y +CONFIG_NET_CLS_CGROUP=y +CONFIG_PERF_EVENTS=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_HUGETLB=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg new file mode 100644 index 0000000..ee1cd51 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg @@ -0,0 +1,5 @@ +CONFIG_DM_THIN_PROVISIONING=m +CONFIG_CFS_BANDWIDTH=y +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_IPC_NS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg new file mode 100644 index 0000000..9dade58 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg @@ -0,0 +1,8 @@ +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_POSIX_ACL is not set +# CONFIG_EXT4_FS_SECURITY is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_AUTOFS4_FS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg new file mode 100644 index 0000000..948d1a7 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg @@ -0,0 +1,26 @@ +CONFIG_REGULATOR=y +# CONFIG_REGULATOR_DEBUG is not set +CONFIG_REGULATOR_FIXED_VOLTAGE=y +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_GPIO is not set +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_REGULATOR_VEXPRESS is not set +CONFIG_MMC=y +# CONFIG_PWRSEQ_EMMC is not set +CONFIG_PWRSEQ_SIMPLE=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=8 +# CONFIG_SDIO_UART is not set +# CONFIG_MMC_TEST is not set +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_STM32_SDMMC is not set +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_DW is not set +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_USDHI6ROL0 is not set +# CONFIG_MMC_CQHCI is not set +# CONFIG_MMC_HSQ is not set +# CONFIG_MMC_MTK is not set diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg new file mode 100644 index 0000000..c1664f6 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg @@ -0,0 +1,26 @@ +CONFIG_NETFILTER=y +CONFIG_NETFILTER_XTABLES=y +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_FILTER=m +CONFIG_NF_NAT=m +CONFIG_NF_CONNTRACK=y +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_IP_SET=m +CONFIG_IP_VS=y +CONFIG_IP_VS_NFCT=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +CONFIG_POSIX_MQUEUE=y +CONFIG_IPC_NS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg new file mode 100644 index 0000000..e24be27 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg @@ -0,0 +1 @@ +CONFIG_KPROBES=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in new file mode 100644 index 0000000..7d98eec --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +# short-description: Create an EFI disk image +# long-description: Creates a partitioned EFI disk image that the user +# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot. + +part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 + +part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024 --uuid=6a60524d-061d-454a-bfd1-38989910eccd + +bootloader --ptable gpt --configfile="${GRUB_CFG_FILE}" --timeout=5 diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg new file mode 100644 index 0000000..e8d0884 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg @@ -0,0 +1,13 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +set debug="loader,mm" +set term="vt100" +set default="0" +set timeout="5" + +menuentry 'Arm reference image boot on Corstone1000 (Device Tree)' { + linux /Image.gz earlycon=pl011,0x1a510000 console=ttyAMA0,115200 root=PARTUUID=6a60524d-061d-454a-bfd1-38989910eccd rootwait rootfstype=ext4 verbose debug +} diff --git a/meta-cassini-config/kas/corstone1000-mps3.yml b/meta-cassini-config/kas/corstone1000-mps3.yml new file mode 100644 index 0000000..401bd32 --- /dev/null +++ b/meta-cassini-config/kas/corstone1000-mps3.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT + +--- +header: + version: 11 + includes: + - meta-cassini-config/kas/include/arm-machines.yml + +local_conf_header: + corstone1000: | + # Only needed as kas dosn't add it automatically unless you have 2 targets + BBMULTICONFIG ?= "firmware" + +machine: corstone1000-mps3 diff --git a/meta-cassini-config/qa-checks/cassini-dictionary b/meta-cassini-config/qa-checks/cassini-dictionary index 351a308..392fe95 100644 --- a/meta-cassini-config/qa-checks/cassini-dictionary +++ b/meta-cassini-config/qa-checks/cassini-dictionary @@ -21,6 +21,7 @@ appends arm-machines.yml armv8-a armv8a-crc +attestation aws b baremetal @@ -69,6 +70,9 @@ containerization containerized containers_kernelcfg_check.bbclass contributing_documentation_build_validation +corstone-1000 +corstone1000-mps3 +corstone1000-mps3.yml cortex-a customizable customization @@ -180,6 +184,7 @@ meta-virtualization minicom modifiable modifier +mps3 mr multiconfig n1 diff --git a/meta-cassini-distro/classes/cassini-image.bbclass b/meta-cassini-distro/classes/cassini-image.bbclass index f6cf402..48b107f 100644 --- a/meta-cassini-distro/classes/cassini-image.bbclass +++ b/meta-cassini-distro/classes/cassini-image.bbclass @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT @@ -8,17 +9,19 @@ IMAGE_BUILDINFO_VARS = " \ inherit core-image extrausers image-buildinfo +IMAGE_FSTYPES:corstone1000 += "wic wic.gz wic.bmap" + # meta-virtualization/recipes-containers/k3s/README.md states that K3s requires # 2GB of space in the rootfs to ensure containers can start CASSINI_ROOTFS_EXTRA_SPACE ?= "2000000" -IMAGE_ROOTFS_EXTRA_SPACE:append = "${@ ' + ${CASSINI_ROOTFS_EXTRA_SPACE}' \ - if '${CASSINI_ROOTFS_EXTRA_SPACE}' \ - else ''}" +IMAGE_ROOTFS_EXTRA_SPACE:append:libc-glibc = "${@ ' + ${CASSINI_ROOTFS_EXTRA_SPACE}' \ + if '${CASSINI_ROOTFS_EXTRA_SPACE}' \ + else ''}" -IMAGE_FEATURES += "ssh-server-openssh bash-completion-pkgs" +IMAGE_FEATURES:libc-glibc = " ssh-server-openssh bash-completion-pkgs" -IMAGE_INSTALL += "\ +IMAGE_INSTALL:append:libc-glibc = " \ bash \ bash-completion-extra \ ca-certificates \ @@ -31,10 +34,10 @@ IMAGE_INSTALL += "\ # Add two users: one with admin access and one without admin access # 'CASSINI_USER_ACCOUNT', 'CASSINI_ADMIN_ACCOUNT' -EXTRA_USERS_PARAMS:prepend = " useradd -p '' ${CASSINI_USER_ACCOUNT}; \ +EXTRA_USERS_PARAMS:prepend:libc-glibc = " useradd -p '' ${CASSINI_USER_ACCOUNT}; \ useradd -p '' ${CASSINI_ADMIN_ACCOUNT}; \ groupadd ${CASSINI_ADMIN_GROUP}; \ usermod -aG ${CASSINI_ADMIN_GROUP} ${CASSINI_ADMIN_ACCOUNT}; \ " -EXTRA_USERS_PARAMS:prepend = "${@bb.utils.contains('TEE_GROUP_NAME', 'teeclnt', 'usermod -aG teeclnt ${CASSINI_TEST_ACCOUNT};', '', d)}" +EXTRA_USERS_PARAMS:prepend:libc-glibc = "${@bb.utils.contains('TEE_GROUP_NAME', 'teeclnt', 'usermod -aG teeclnt ${CASSINI_TEST_ACCOUNT};', '', d)}" diff --git a/meta-cassini-distro/conf/distro/include/cassini-sdk.inc b/meta-cassini-distro/conf/distro/include/cassini-sdk.inc index 48923f0..f47db56 100644 --- a/meta-cassini-distro/conf/distro/include/cassini-sdk.inc +++ b/meta-cassini-distro/conf/distro/include/cassini-sdk.inc @@ -1,11 +1,12 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT # Config specifc to the cassini-sdk distro feature, enabled using # DISTRO_FEATURES -IMAGE_FEATURES:append = " \ +IMAGE_FEATURES:append:libc-glibc = " \ package-management \ dev-pkgs \ tools-sdk \ @@ -14,6 +15,6 @@ IMAGE_FEATURES:append = " \ debug-tweaks \ ssh-server-openssh" -IMAGE_INSTALL:append = " kernel-base kernel-devsrc kernel-modules" +IMAGE_INSTALL:append:libc-glibc = " kernel-base kernel-devsrc kernel-modules" -IMAGE_INSTALL:append:aarch64 = " gator-daemon" +IMAGE_INSTALL:append:aarch64:libc-glibc = " gator-daemon" diff --git a/meta-cassini-distro/conf/distro/include/cassini-test.inc b/meta-cassini-distro/conf/distro/include/cassini-test.inc index f0b5576..0c5c47c 100644 --- a/meta-cassini-distro/conf/distro/include/cassini-test.inc +++ b/meta-cassini-distro/conf/distro/include/cassini-test.inc @@ -1,20 +1,23 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT # Config specifc to the cassini-test distro feature, enabled using # DISTRO_FEATURES -DISTRO_FEATURES:append = " ptest" -EXTRA_IMAGE_FEATURES:append = " debug-tweaks" -IMAGE_INSTALL:append = " jfrog-cli \ - container-engine-integration-tests-ptest \ - k3s-integration-tests-ptest \ - user-accounts-integration-tests-ptest" +DISTRO_FEATURES:append:libc-glibc = " ptest" -IMAGE_INSTALL:append = "${@bb.utils.contains('DISTRO_FEATURES',\ - 'cassini-parsec', ' parsec-simple-e2e-tests-ptest', '', d)}" +EXTRA_IMAGE_FEATURES:append:libc-glibc = " debug-tweaks" -IMAGE_INSTALL:append = " optee-xtests-ptest" +IMAGE_INSTALL:append:libc-glibc = " jfrog-cli \ + packagegroup-ts-tests-psa \ + psa-arch-tests-ptest \ + container-engine-integration-tests-ptest \ + k3s-integration-tests-ptest \ + user-accounts-integration-tests-ptest \ + ${@bb.utils.contains('DISTRO_FEATURES',\ + 'cassini-parsec', 'parsec-simple-e2e-tests-ptest', '', d)} \ + " -IMAGE_INSTALL:append = " psa-arch-tests-ptest" +IMAGE_INSTALL:append:n1sdp = " optee-test optee-xtests-ptest" diff --git a/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend b/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend index 76658ff..1091924 100644 --- a/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend +++ b/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend @@ -1,16 +1,17 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" OVERRIDES:append = "${CASSINI_OVERRIDES}" -SRC_URI:append:cassini = " file://cassini_profile.sh" +SRC_URI:append:libc-glibc:cassini = " file://cassini_profile.sh" CASSINI_SECURITY_UMASK ??= "0027" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { # PS1 is set inside cassini_profile.sh sed -i '/PS1/d' ${D}${sysconfdir}/skel/.bashrc diff --git a/meta-cassini-distro/recipes-core/images/cassini-image-base.bb b/meta-cassini-distro/recipes-core/images/cassini-image-base.bb index 11cf6e1..62d57db 100644 --- a/meta-cassini-distro/recipes-core/images/cassini-image-base.bb +++ b/meta-cassini-distro/recipes-core/images/cassini-image-base.bb @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT @@ -9,3 +10,6 @@ IMAGE_LINGUAS = " " LICENSE = "MIT" inherit cassini-image + +# Ensure cassini-image-* also builds the firmware for platforms that use a different libc +EXTRA_IMAGEDEPENDS:append:corstone1000 = " corstone1000-deploy-image" diff --git a/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc b/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc index 5fc5c8a..57b0032 100644 --- a/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc +++ b/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc @@ -1,14 +1,15 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" QUIET_PRINTK = "20-quiet-printk.conf" -SRC_URI:append:cassini = "file://${QUIET_PRINTK}" +SRC_URI:append:libc-glibc:cassini = "file://${QUIET_PRINTK}" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { install -Dm 0640 ${WORKDIR}/${QUIET_PRINTK} \ ${D}${sysconfdir}/sysctl.d/${QUIET_PRINTK} } diff --git a/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend b/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend index fa8f709..a6d3871 100644 --- a/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend +++ b/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend @@ -1,10 +1,11 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT OVERRIDES:append = "${CASSINI_OVERRIDES}" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { # Make sure that users cannot access to each other HOME directory sed -i 's/#HOME_MODE/HOME_MODE/g' ${D}${sysconfdir}/login.defs diff --git a/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend b/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend index 0b65efa..4bf875e 100644 --- a/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend +++ b/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend @@ -1,14 +1,15 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" -SRC_URI:append:cassini = " file://cassini_admin_group.in" +SRC_URI:append:libc-glibc:cassini = " file://cassini_admin_group.in" -DEPENDS:append:cassini = " gettext-native" +DEPENDS:append:libc-glibc:cassini = " gettext-native" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { export ADMIN_GROUP="${CASSINI_ADMIN_GROUP}" export ADMIN_GROUP_OPTIONS="${CASSINI_ADMIN_GROUP_OPTIONS}" diff --git a/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend b/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend index e699e9e..caefad7 100644 --- a/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend +++ b/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend @@ -1,16 +1,17 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}:${THISDIR}/linux-yocto:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}:${THISDIR}/linux-yocto:" # # cassini kmeta # -SRC_URI:append:cassini = " file://cassini-kmeta;type=kmeta;name=cassini-kmeta;destsuffix=cassini-kmeta" +SRC_URI:append:libc-glibc:cassini = " file://cassini-kmeta;type=kmeta;name=cassini-kmeta;destsuffix=cassini-kmeta" # Add gator daemon kernel configs dependencies. -KERNEL_FEATURES:append:cassini:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', \ +KERNEL_FEATURES:append:libc-glibc:aarch64:cassini = "${@bb.utils.contains('DISTRO_FEATURES', \ 'cassini-sdk', \ ' features/cassini/gator.scc', '', d)}" -- GitLab From abfa10c7eb7cdf1cfadc4336c9b46cf19b4a952b Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:58:03 +0000 Subject: [PATCH 4/5] cassini-ci: Add sanity job for Corstone1000-mps3 board Added sanity test to validate Cassini distro booting on Corstone1000-mps3 FPGA board. Signed-off-by: Devaraj Ranganna Signed-off-by: Vikas Katariya --- .gitlab-ci.yml | 3 +- .gitlab/ci/corstone1000-image-builds.yml | 62 ++++++++ .gitlab/ci/lava-test.yml | 34 +++++ .gitlab/ci/rules.yml | 16 ++ .gitlab/ci/templates/image_build.yml.j2 | 44 +++++- .gitlab/ci/trigger-image-builds.yml | 10 ++ .gitlab/ci/yocto-qa.yml | 8 +- .../lava/corstone1000-mps3/sanity_job.yml.j2 | 142 ++++++++++++++++++ 8 files changed, 314 insertions(+), 5 deletions(-) create mode 100644 .gitlab/ci/corstone1000-image-builds.yml create mode 100644 .gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a9b27c..f10e525 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ variables: BUILD_PLATFORM: value: none description: Comma seperated list of platforms to build - (none, all-platforms, n1sdp) + (none, all-platforms, corstone1000-mps3, n1sdp) BUILD_HOST_ARCH: value: arm64 description: What build host architecture should be used @@ -48,6 +48,7 @@ include: - local: '.gitlab/ci/rules.yml' - local: '.gitlab/ci/docker-image-builds.yml' - local: '.gitlab/ci/n1sdp-image-builds.yml' + - local: '.gitlab/ci/corstone1000-image-builds.yml' - local: '.gitlab/ci/trigger-image-builds.yml' - local: '.gitlab/ci/docs-build.yml' diff --git a/.gitlab/ci/corstone1000-image-builds.yml b/.gitlab/ci/corstone1000-image-builds.yml new file mode 100644 index 0000000..325d9e5 --- /dev/null +++ b/.gitlab/ci/corstone1000-image-builds.yml @@ -0,0 +1,62 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT +--- +.corstone1000_generator: + extends: .generator + variables: + MACHINE: corstone1000-mps3 + RUN_TESTS: 'none' + + +cassini/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s", rules] + - !reference [".build-image:rules:corstone1000", rules] + +cassini/security/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s-security", rules] + - !reference [".build-image:rules:corstone1000", rules] + +cassini-dev/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/) + && ($FREQUENCY == "nightly")' + +cassini-dev/security/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/) + && ($FREQUENCY == "nightly")' + +cassini-sdk/corstone1000-mps3: + extends: .corstone1000_generator + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s-sdk", rules] + - !reference [".build-image:rules:corstone1000", rules] diff --git a/.gitlab/ci/lava-test.yml b/.gitlab/ci/lava-test.yml index 23eeb3f..8ea4428 100644 --- a/.gitlab/ci/lava-test.yml +++ b/.gitlab/ci/lava-test.yml @@ -38,6 +38,28 @@ sed -i "s/$config$current_value/$config$new_value/" config.txt zip -r ../cassini-firmware.zip * ;; + 'corstone1000-mps3') + echo "Building images for Corstone-1000 for MPS3" + mkdir -p ~/.ssh + eval "$(ssh-agent -s)" + if [ -n "${SSH_PRIVATE_GERRIT}+x" ]; then + echo "${SSH_PRIVATE_GERRIT}" | tr -d '\r' | ssh-add - > /dev/null; + fi + ssh-keyscan -t rsa ${CI_SERVER_HOST} >> ~/.ssh/known_hosts + git config --global url.ssh://git@${CI_SERVER_HOST}.insteadOf \ + https://${CI_SERVER_HOST} + git clone https://${CI_SERVER_HOST}/${CORSTONE1000_CI_PATH} + export \ + BUILD_DIR=$(pwd)/../work/build/tmp/deploy/images/corstone1000-mps3/ + # The `LavaPrepTool.py` requires specfic file name to prep for lava + cp ${BUILD_DIR}/corstone1000-image-${MACHINE}.wic.nopt \ + ${BUILD_DIR}/corstone1000-flash-firmware-image-${MACHINE}.wic.nopt + python3 corstone1000-ci/LavaPrepTool.py create_mps3 --config \ + corstone1000-ci/configs/cassini_create_mps3.yml + # LavaPrepTool creates this under cassini-firmware/, but Gitlab is + # looking in the parent directory. So we move it. + mv cassini-firmware.zip ../ + ;; *) echo "Unkown machine ${MACHINE}" exit 1 @@ -176,6 +198,18 @@ - TEST-*-test-report.xml - lava-result.yml expire_in: 1 week + +.sanity-test: + extends: .submit-cassini-lava-job + variables: + LAVA_JOB: sanity_job.yml + +.sanity-test-results: + extends: .complete-lava-job + artifacts: + paths: + - lava-result.yml + expire_in: 1 day reports: junit: - TEST-*-test-report.xml diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 9aea33a..9f64c8c 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -31,6 +31,10 @@ - ".gitlab/ci/n1sdp-image-builds.yml" - ".gitlab/lava/n1sdp/*" +.ci-corstone1000-patterns: &ci-corstone1000-patterns + - ".gitlab/ci/corstone1000-image-builds.yml" + - ".gitlab/lava/corstone1000*/*" + .kas-common: &kas-common - "meta-cassini-config/kas/cassini.yml" - "meta-cassini-config/kas/ci.yml" @@ -52,6 +56,10 @@ - "meta-cassini-config/kas/n1sdp.yml" - "meta-cassini-config/kas/include/arm-machines.yml" +.kas-corstone1000: &kas-corstone1000 + - "meta-cassini-config/kas/corstone1000*.yml" + - "meta-cassini-config/kas/include/arm-machines.yml" + .layer-configs: &layer-configs - "meta-cassini-distro/conf/layer.conf" - "meta-cassini-bsp/conf/layer.conf" @@ -59,6 +67,7 @@ .build-common: &build-common - "meta-cassini-distro/**/*" + - "meta-cassini-bsp/**/*" - "meta-cassini-tests/classes/**/*" - "meta-cassini-tests/conf/**/*" - "meta-cassini-tests/recipes-core/**/*" @@ -83,6 +92,13 @@ - <<: *if-merge-request-or-push changes: *kas-n1sdp +.build-image:rules:corstone1000: + rules: + - <<: *if-merge-request-or-push + changes: *ci-corstone1000-patterns + - <<: *if-merge-request-or-push + changes: *kas-corstone1000 + .build-image:rules:k3s: rules: - <<: *if-merge-request-or-push diff --git a/.gitlab/ci/templates/image_build.yml.j2 b/.gitlab/ci/templates/image_build.yml.j2 index a27bc3f..6f8fa06 100644 --- a/.gitlab/ci/templates/image_build.yml.j2 +++ b/.gitlab/ci/templates/image_build.yml.j2 @@ -1,4 +1,5 @@ -# Copyright (c) 2022-2023 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT @@ -21,6 +22,16 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: - echo "IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/${ARTIFACT_DIR}/$(readlink ${IMAGE}-{{ MACHINE }}.wic.gz)" >> ${CI_PROJECT_DIR}/build_data.env - echo "IMAGE=${IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env - echo "ARTIFACT_DIR=${ARTIFACT_DIR}" >> ${CI_PROJECT_DIR}/build_data.env +{% if MACHINE == 'corstone1000-mps3' %} + - echo "BL1_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/bl1.bin" >> ${CI_PROJECT_DIR}/build_data.env + - echo "BL1_IMAGE=bl1.bin" >> ${CI_PROJECT_DIR}/build_data.env + - export UTIL_IMAGE=$(ls -- *-{{ MACHINE }}.tar.bz2 | sed "s/-{{ MACHINE }}\.tar\.bz2//") + - echo "UTIL_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/$(readlink ${UTIL_IMAGE}-{{ MACHINE }}.tar.bz2)" >> ${CI_PROJECT_DIR}/build_data.env + - echo "UTIL_IMAGE=${UTIL_IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env + - export FW_IMAGE=$(ls -- *-{{ MACHINE }}.wic.nopt | sed "s/-{{ MACHINE }}\.wic\.nopt//") + - echo "FW_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/$(readlink ${FW_IMAGE}-{{ MACHINE }}.wic.nopt)" >> ${CI_PROJECT_DIR}/build_data.env + - echo "FW_IMAGE=${FW_IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env +{% endif %} # Store built images - | ( @@ -29,7 +40,14 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: mkdir --parents ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }} cp $(readlink ${IMAGE}-{{ MACHINE }}.wic.bmap) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ cp $(readlink ${IMAGE}-{{ MACHINE }}.wic.bz2) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% if MACHINE == 'n1sdp' %} cp *-board-firmware_primary.tar.gz ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% elif MACHINE == 'corstone1000-mps3' %} + cp bl1.bin ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ + cp $(readlink ${UTIL_IMAGE}-{{ MACHINE }}.tar.bz2) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ + cp $(readlink ${FW_IMAGE}-{{ MACHINE }}.wic.nopt) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% else %} +{% endif %} ) 200>${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}.lock - popd # ${KAS_WORK_DIR}/build/tmp/deploy/images/{{ MACHINE }} - chmod 777 ${CI_PROJECT_DIR}/build_data.env @@ -38,7 +56,14 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: paths: - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.gz - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.bmap +{% if MACHINE == 'n1sdp' %} - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-board-firmware_primary.tar.gz +{% elif MACHINE == 'corstone1000-mps3' %} + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/bl1.bin + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.nopt + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/*-*-*.tar.bz2 +{% else %} +{% endif %} - build_data.env reports: dotenv: build_data.env @@ -72,6 +97,23 @@ PTest-{{ CI_JOB_NAME_SLUG }}-Complete: - PTest-{{ CI_JOB_NAME_SLUG }} {% endif %} +{% set can_run = ('all' in RUN_TESTS or 'sanity' in RUN_TESTS.split(',')) %} +{% set force = ('all' in FORCE_TESTS or 'sanity' in FORCE_TESTS.split(',')) %} +{% set should_run = true %} +{% if can_run and (should_run or force) %} +Sanity-Test-{{ CI_JOB_NAME_SLUG }}: + extends: .sanity-test + needs: + - Lava-Test-Prep-{{ CI_JOB_NAME_SLUG }} + variables: + MACHINE: "{{ MACHINE }}" + +Sanity-Test-{{ CI_JOB_NAME_SLUG }}-Complete: + extends: .sanity-test-results + needs: + - Sanity-Test-{{ CI_JOB_NAME_SLUG }} +{% endif %} + {% set can_run = ('all' in RUN_TESTS or 'acs' in RUN_TESTS.split(',')) %} {% set force = ('all' in FORCE_TESTS or 'acs' in FORCE_TESTS.split(',')) %} {% set should_run = (CI_PIPELINE_SOURCE == "schedule" and MACHINE!="corstone1000-mps3" )%} diff --git a/.gitlab/ci/trigger-image-builds.yml b/.gitlab/ci/trigger-image-builds.yml index 2787ee0..667b041 100644 --- a/.gitlab/ci/trigger-image-builds.yml +++ b/.gitlab/ci/trigger-image-builds.yml @@ -18,6 +18,16 @@ merge_jobs: optional: true - job: cassini-dev/security/tests/n1sdp optional: true + - job: cassini/tests/corstone1000-mps3 + optional: true + - job: cassini/security/tests/corstone1000-mps3 + optional: true + - job: cassini-sdk/corstone1000-mps3 + optional: true + - job: cassini-dev/tests/corstone1000-mps3 + optional: true + - job: cassini-dev/security/tests/corstone1000-mps3 + optional: true before_script: - | cat << EOF > ${CI_JOB_FILE} diff --git a/.gitlab/ci/yocto-qa.yml b/.gitlab/ci/yocto-qa.yml index 5c0c21e..aabba80 100644 --- a/.gitlab/ci/yocto-qa.yml +++ b/.gitlab/ci/yocto-qa.yml @@ -1,4 +1,5 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited and/or its affiliates. +# # # SPDX-License-Identifier: MIT --- @@ -8,7 +9,7 @@ check-layers: extends: .kas_build_cassini script: - kas shell --update --force-checkout - meta-cassini-config/kas/n1sdp.yml:meta-cassini-config/kas/tests.yml:meta-cassini-config/kas/cassini.yml:meta-cassini-config/kas/security.yml + meta-cassini-config/kas/cassini.yml:meta-cassini-config/kas/security.yml:meta-cassini-config/kas/${MACHINE}.yml:meta-cassini-config/kas/tests.yml --command "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $KAS_WORK_DIR/layers/meta-* $KAS_WORK_DIR/layers/poky/meta-poky @@ -16,6 +17,7 @@ check-layers: --no-auto-dependency" parallel: matrix: - - LAYER: [meta-cassini-distro, meta-cassini-bsp, meta-cassini-tests] + - MACHINE: [n1sdp, corstone1000-mps3] + LAYER: [meta-cassini-distro, meta-cassini-bsp, meta-cassini-tests] rules: - !reference [".layer-check:rules", rules] diff --git a/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 b/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 new file mode 100644 index 0000000..d7594ff --- /dev/null +++ b/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 @@ -0,0 +1,142 @@ +# Copyright (c) 2023 Arm Limited and/or its affiliates. +# +# +# SPDX-License-Identifier: MIT +--- +device_type: mps3 +job_name: {{ CI_JOB_NAME }} +timeouts: + job: + minutes: 560 + +metadata: + source: {{ CI_PROJECT_URL }} + path: .gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 + gitlab-job-url: {{ CI_JOB_URL }} + +priority: medium +visibility: + group: + - cassini + +notify: + criteria: + status: finished + callbacks: + - url: "{{ CI_API_V4_URL }}/projects/{{ CI_PROJECT_ID }}/jobs/{{ TEST_COMPLETE_JOB_ID }}/play" + method: POST + token: "{{ LAVA_CALLBACK_TOKEN }}" + header: "PRIVATE-TOKEN" + dataset: minimal + +actions: + +- boot: + namespace: uart0 + method: new_connection + connection: uart0 + +- boot: + namespace: uart1 + method: new_connection + connection: uart1 + +- boot: + namespace: uart3 + method: new_connection + connection: uart3 + +# Booting the mps3 test suite +- deploy: + to: flasher + images: + recovery_image: + url: "{{ FIRMWARE_ARTIFACT }}" + namespace: target + timeout: + minutes: 5 + +# Run kernel in Flash to copy rootfs overlay to USB stick +- boot: + namespace: target + method: u-boot + timeout: + minutes: 30 + commands: + - run retrieve_kernel_load_addr + - echo Loading kernel from $kernel_addr to memory ... + - unzip $kernel_addr 0x90000000 + - loadm 0x90000000 $kernel_addr_r 0xd00000 + - bootefi $kernel_addr_r $fdtcontroladdr + auto_login: + login_prompt: 'CASSINI unstable corstone1000-mps3' + username: root + prompts: + - '(.*)corstone1000-mps3:' + +# +# Fudge to enable bmap-tool usage +# +- deploy: + namespace: poky + timeout: + minutes: 5 + to: usb + os: oe + images: + image: + url: "{{ UTIL_ARTIFACT }}" + compression: bz2 + uniquify: false + device: usb_storage_device + download: + tool: /usr/bin/wget + options: --no-check-certificate -O - {DOWNLOAD_URL} + prompt: "Connecting to .+" + writer: + tool: /bin/tar + options: -C / -xf - + prompt: 'writing to stdout' + tool: + prompts: + - 'written to stdout' + +# +# Deploy the cassini uefi image stored as artifacts by the build job +# +- deploy: + namespace: secondary_media + timeout: + minutes: 300 + to: usb + os: oe + images: + image: + url: "{{ IMAGE_ARTIFACT }}" + compression: gz + bmap: + url: "{{ BMAP_ARTIFACT }}" + uniquify: false + device: usb_storage_device + writer: + tool: /usr/bin/bmaptool + options: copy {DOWNLOAD_URL} /dev/sda + prompt: 'bmaptool: info' + tool: + prompts: ['copying time: [0-9hms\.\ ]+, copying speed [0-9\.]+ [MK]iB\/sec'] + +- boot: + namespace: secondary_media + method: minimal + timeout: + minutes: 480 + auto_login: + login_prompt: 'CASSINI unstable corstone1000-mps3 ttyAMA0' + username: cassini + login_commands: + - cassini123 + - cassini123 + prompts: + - 'New password: ' + - 'Re-enter new password: ' + - '(.*)corstone1000-mps3:' -- GitLab From 42449ac7ce83b2ddc8f38dbf0c791ef703977f0d Mon Sep 17 00:00:00 2001 From: Vikas Katariya Date: Tue, 20 Dec 2022 16:18:33 +0000 Subject: [PATCH 5/5] cassini-docs: Add Corstone1000-mps3 setup instructions Signed-off-by: Vikas Katariya --- documentation/user_manual/corstone1000.rst | 125 +++++++++++++++++++++ documentation/user_manual/index.rst | 4 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 documentation/user_manual/corstone1000.rst diff --git a/documentation/user_manual/corstone1000.rst b/documentation/user_manual/corstone1000.rst new file mode 100644 index 0000000..863aed4 --- /dev/null +++ b/documentation/user_manual/corstone1000.rst @@ -0,0 +1,125 @@ +.. + # Copyright (c) 2023 Arm Limited and/or its affiliates. + # + # + # SPDX-License-Identifier: MIT + +############################################### +Getting Started with Arm Corstone-1000 for MPS3 +############################################### + +This document explains how to boot the Cassini distro on the Arm Corstone-1000 for MPS3. + +**NOTE:** We require a micro SD card (4GB) and USB drive (32 GB) + + +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``. + +Only copy the current directory structure shown below on to the Micro SD Card. + +.. code-block:: console + + MB + ├── BRD_LOG.TXT + ├── HBI0309B + │ ├── AN550 + │ │ ├── AN550_v1.bit + │ │ ├── an550_v1.txt + │ │ └── images.txt + │ ├── board.txt + │ └── mbb_v210.ebf + └── HBI0309C + ├── AN550 + │ ├── AN550_v1.bit + │ ├── an550_v1.txt + │ └── images.txt + ├── board.txt + └── mbb_v210.ebf + SOFTWARE + ├── ES0.bin + ├── SE.bin + └── an550_st.axf + config.txt + + +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: 2 ;Number of Images (Max: 32) + + IMAGE0PORT: 1 + IMAGE0ADDRESS: 0x00_0000_0000 + IMAGE0UPDATE: RAM + IMAGE0FILE: \SOFTWARE\bl1.bin + + IMAGE1PORT: 0 + IMAGE1ADDRESS: 0x00_00010_0000 + IMAGE1UPDATE: AUTOQSPI + IMAGE1FILE: \SOFTWARE\cs1000.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-image-corstone1000-mps3.wic.nopt`` from OUTPUT_DIR directory to SOFTWARE + directory of the Micro SD card and rename the wic image to ``cs1000.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.wic.bmap cassini-image-base-corstone1000-mps3.wic /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 and open 3 minicom sessions. +In case of Linux machine it will be ttyUSB0, ttyUSB1, ttyUSB2 and it might +be different on Windows machine. + + - ttyUSB0 for MCC, OP-TEE and Secure Partition + - ttyUSB1 for Boot Processor (Cortex-M0+) + - ttyUSB2 for Host Processor (Cortex-A35) + +Run following commands to open minicom sessions on Linux each on new terminal: + +.. code-block:: console + + sudo picocom -b 115200 /dev/ttyUSB0 + sudo picocom -b 115200 /dev/ttyUSB1 + sudo picocom -b 115200 /dev/ttyUSB2 + +Once the system boot is completed, you should see console +logs on the minicom sessions. Once the HOST(Cortex-A35) is +booted completely, user can login to the shell using +**"root"** login. diff --git a/documentation/user_manual/index.rst b/documentation/user_manual/index.rst index cda51e2..d2ee76f 100644 --- a/documentation/user_manual/index.rst +++ b/documentation/user_manual/index.rst @@ -1,5 +1,6 @@ .. - # Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2022-2023 Arm Limited and/or its affiliates. + # # # SPDX-License-Identifier: MIT @@ -11,3 +12,4 @@ User Manual :maxdepth: 1 build + corstone1000 -- GitLab