diff --git a/IR/README.md b/IR/README.md index fb491aa..4c940ac 100644 --- a/IR/README.md +++ b/IR/README.md @@ -1,5 +1,7 @@ # SystemReady IR ACS +**_Note_**: Refer to [Yocto README](Yocto/README.md) for the details on the SystemReady IR ACS v2.0.0 **Beta-0** version and instructions to build using Yocto. + ## Introduction to SystemReady IR SystemReady IoT Ready (IR) is a band of system certification in the Arm SystemReady program. This certification is for devices in the IoT edge sector that are built around SoCs based on the Arm A-profile architecture. It ensures interoperability with embedded Linux and other embedded operating systems. diff --git a/IR/Yocto/README.md b/IR/Yocto/README.md new file mode 100644 index 0000000..97db51e --- /dev/null +++ b/IR/Yocto/README.md @@ -0,0 +1,147 @@ +# SystemReady IR ACS + +## Introduction to SystemReady IR +SystemReady IoT Ready (IR) is a band of system certification in the Arm SystemReady program. This certification is for devices in the IoT edge sector that are built around SoCs based on the Arm A-profile architecture. It ensures interoperability with embedded Linux and other embedded operating systems. + +SystemReady IR-certified platforms implement a minimum set of hardware and firmware features that an operating system can depend on to deploy the operating system image. Compliant systems must conform to the: +* [Base System Architecture (BSA) specification](https://developer.arm.com/documentation/den0094/latest) +* [Embedded Base Boot Requirements (EBBR)](https://developer.arm.com/architectures/platform-design/embedded-systems) +* EBBR recipe of the [Arm Base Boot Requirements (BBR) specification](https://developer.arm.com/documentation/den0044/latest) + +This section of the repository contains the build scripts and the live-images for the SystemReady IR Band. + +## Release details + - Code Quality: IR ACS v2.0.0 Beta-0 + - The latest pre-built release of IR ACS is available for download here: [v22.06_2.0.0_BETA-0](prebuilt_images/v22.06_2.0.0_BETA-0) + - The BSA tests are written for version 1.0 of the BSA specification. + - The BBR tests are written for version 1.0 of the BBR specification. + - The compliance suite is not a substitute for design verification. + - To review the ACS logs, Arm licensees can contact Arm directly through their partner managers. + + + +## Steps to build SystemReady IR ACS live image using the Yocto build system + +## Code download +- To build a release version of the code, checkout the main branch with the appropriate release tag. +- To build the latest version of the code with bug fixes and new features, use the main branch. + +## ACS build steps + +### Prebuilt images +- Prebuilt images for each release are available in the prebuilt_images folder. You can either choose to use these images or build your own image by following the build steps. +- To access the prebuilt_images, click : [prebuilt_images](prebuilt_images/) +- The prebuilt images are archived after compression to the .xz format. On Linux, use the xz utility to uncompress the image `xz -d ir-acs-live-image-generic-arm64.wic.xz`. On Windows, use the 7zip or a similar utility. +- If you choose to use the prebuilt image, skip the build steps, and navigate to the "Verification" section below. + + +### Prerequisites +Before starting the ACS build, ensure that the following requirements are met: + - Ubuntu 18.04 or 20.04 LTS with at least 32GB of free disk space. + - Availability of the Bash shell. + - **sudo** privilege to install tools required for the build. + - `git` installed using `sudo apt install git`. + - Configuration of email using the commands `git config --global user.name "Your Name"` and `git config --global user.email "Your Email"`. + +### Steps to build SystemReady IR ACS live image +1. Clone the arm-systemready repository
+ `git clone "https://github.com/ARM-software/arm-systemready.git"` + +2. Navigate to the IR/Yocto directory
+ `cd arm-systemready/IR/Yocto` + +3. Run get_source.sh to download all the related sources and tools for the build. Provide sudo permission when prompted
+ `./build-scripts/get_source.sh`
+ +4. To start the build of the IR ACS live image, execute the below step
+ `./build-scripts/build-ir-live-image.sh` + +5. If the above steps are successful, the bootable image will be available at
+ **/path-to-arm-systemready/IR/Yocto/meta-woden/build/tmp/deploy/images/generic-arm64/ir-acs-live-image-generic-arm64.wic.xz** + +Note: The image is generated in a compressed (.xz) format. The image must be uncompressed before using the same for verification.
+ +## Build output +This image comprises of two FAT file system partitions recognized by UEFI:
+- 'results'
+ Stores logs of the automated execution of ACS. (Approximate size: 50 MB)
+- '/'
+ Root partition for Linux which contains test-suites to run in Linux environment.
+- 'boot'
+ Contains bootable applications and test suites. (Approximate size: 100 MB) + +## Verification + +Note: The default UEFI EDK2 setting for "Console Preference" is "Graphical". In this default setting, the Linux output goes only to the graphical console (HDMI monitor). To force serial console output, you may change "Console Preference" to "Serial". + +### Verification of the IR image on QEMU Arm machine + +#### Follow the Build instructions mentioned in [qemu download page](https://www.qemu.org/download/#source) to build latest QEMU model. + +NOTE: Download the toolchain from [arm developer page](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/10-2-2020-11)
+NOTE: If repo sync fails due to incorrect repo version , please update repo using the below steps.
+``` +mkdir -p ~/.bin +PATH="${HOME}/.bin:${PATH}" +curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo +chmod a+rx ~/.bin/repo +``` + +#### To build the firmware image, follow the below steps + +``` +mkdir working_directory +cd working_directory +repo init -u https://github.com/glikely/u-boot-manifest +repo sync +export CROSS_COMPILE= +make qemu_arm64_defconfig +make +``` +nor_flash.bin is generated once the build is completed. + + +#### Verifying the ACS-IR pre-built image +Launch the model with the below command + +``` + -bios -drive file=,if=virtio,format=raw -cpu cortex-a57 -smp 2 -m 2048 -M virt,secure=on -monitor null -no-acpi -nodefaults -nographic -rtc base=utc,clock=host -serial stdio -d unimp,guest_errors -machine virtualization=on +``` + +### Automation +The test suite execution can be automated or manual. Automated execution is the default execution method when no key is pressed during boot.
+The live image boots to UEFI Shell. The different test applications can be run in the following order: + +1. [SCT tests](https://github.com/ARM-software/bbr-acs/blob/main/README.md) for BBR compliance. +2. [UEFI Shell application](https://github.com/ARM-software/bsa-acs/blob/main/README.md) for BSA compliance. +3. [FWTS tests](https://github.com/ARM-software/bbr-acs/blob/main/README.md) for BBR compliance. + +## Baselines for Open Source Software in this release: + +- [Firmware Test Suite (FWTS)](http://kernel.ubuntu.com/git/hwe/fwts.git) TAG: v22.05.00 + +- [Base System Architecture (BSA)](https://github.com/ARM-software/bsa-acs) TAG: v22.06_IR_2.0.0_BETA-0 + +- [Base Boot Requirements (BBR)](https://github.com/ARM-software/bbr-acs) TAG: v22.06_IR_2.0.0_BETA-0 + +- [UEFI Self Certification Tests (UEFI-SCT)](https://github.com/tianocore/edk2-test) TAG: dedfd87f76a9b48bfc03511c19beba285c4f5a81 + + + +## Security Implication +Arm SystemReady IR ACS test suite may run at higher privilege level. An attacker may utilize these tests as a means to elevate privilege which can potentially reveal the platform security assets. To prevent the leakage of Secure information, it is strongly recommended that the ACS test suite is run only on development platforms. If it is run on production systems, the system should be scrubbed after running the test suite. + +## License +System Ready ACS is distributed under Apache v2.0 License. + +## Feedback, contributions, and support + + - For feedback, use the GitHub Issue Tracker that is associated with this repository. + - For support, send an email to "support-systemready-acs@arm.com" with details. + - Arm licensees can contact Arm directly through their partner managers. + - Arm welcomes code contributions through GitHub pull requests. + +-------------- + +*Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.* + diff --git a/IR/Yocto/build-scripts/build-ir-live-image.sh b/IR/Yocto/build-scripts/build-ir-live-image.sh new file mode 100755 index 0000000..1500267 --- /dev/null +++ b/IR/Yocto/build-scripts/build-ir-live-image.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of ARM nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +set -x +TOP_DIR=`pwd` +pushd $TOP_DIR/meta-woden +kas build kas/woden.yml +if [ $? -eq 0 ]; then + if [ -f $TOP_DIR/meta-woden/build/tmp/deploy/images/generic-arm64/woden-image-generic-arm64.wic ]; then + cd $TOP_DIR/meta-woden/build/tmp/deploy/images/generic-arm64 + rm ir-acs-live-image-generic-arm64.wic.xz 2> /dev/null + cp woden-image-generic-arm64.wic ir-acs-live-image-generic-arm64.wic + xz -z ir-acs-live-image-generic-arm64.wic + echo "The built image is at $TOP_DIR/meta-woden/build/tmp/deploy/images/generic-arm64/ir-acs-live-image-generic-arm64.wic.xz" + fi +fi +popd + diff --git a/IR/Yocto/build-scripts/get_source.sh b/IR/Yocto/build-scripts/get_source.sh new file mode 100755 index 0000000..865d458 --- /dev/null +++ b/IR/Yocto/build-scripts/get_source.sh @@ -0,0 +1,133 @@ +#!/usr/bin/env bash + +# Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of ARM nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +set -x +TOP_DIR=`pwd` + +#Get the band run from automatically +pushd ../.. +BAND_PATH=`pwd` +BAND=`basename $BAND_PATH` +popd + +echo "Getting the sources for $BAND " + +. $TOP_DIR/../../common/config/common_config.cfg + +#The shell variables use in this file are defined in common_config.cfg + +export GIT_SSL_NO_VERIFY=1 + + +sudo apt install git curl mtools gdisk gcc liblz4-tool zstd \ + openssl automake autotools-dev libtool bison flex \ + bc uuid-dev python3 libglib2.0-dev libssl-dev autopoint \ + make gcc g++ python + +sudo pip3 install kas + +pushd $TOP_DIR/meta-woden +git init +kas checkout kas/woden.yml +popd + +customise_image() +{ + #Remove the root login prompt after the startup + sed -i 's/ExecStart=.*/ExecStart=\-\/sbin\/agetty \-a root \-8 \-L \%I \@BAUDRATE\@ \$TERM/' $TOP_DIR/meta-woden/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service + +} + + +copy_recipes() +{ + + #woden.conf will be changed + #sed -i 's/PREFERRED_VERSION_linux-yocto ?= \"[0-9]\.[0-9][0-9]\%\"/PREFERRED_VERSION_linux-yocto ?= \"'${YOCTO_LINUX_KERNEL_VERSION}'\%\"/' $TOP_DIR/meta-woden/poky/meta-poky/conf/distro/poky.conf + + #Remove the existing recipe + rm $TOP_DIR/meta-woden/poky/meta/recipes-kernel/linux/linux-yocto_5.15.bb + + #copy linux_yocto.bbappend with empty defconfig + cp $TOP_DIR/config/linux-yocto_%.bbappend $TOP_DIR/meta-woden/meta-arm/meta-arm/recipes-kernel/linux/linux-yocto_%.bbappend + + # check whether common_config.cfg specifies tag for related source(s) and update + # recipes accordingly + if [ ! -z "$ARM_BSA_TAG" ]; then + sed -i -E 's/SRCREV_bsa-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_bsa-acs = \"'${ARM_BSA_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs.bb + sed -i -E 's/SRCREV_bsa-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_bsa-acs = \"'${ARM_BSA_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-app/bsa-acs-app.bb + sed -i -E 's/SRCREV_bsa-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_bsa-acs = \"'${ARM_BSA_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb + fi + + if [ ! -z "$EDK2_SRC_TAG" ]; then + sed -i -E 's/SRCREV_edk2\s+=\s+"\$\{AUTOREV\}"/SRCREV_edk2 = \"'${EDK2_SRC_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb + sed -i -E 's/SRCREV_edk2\s+\?=\s+"\$\{AUTOREV\}"/SRCREV_edk2 = \"'${EDK2_SRC_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/edk2-firmware/edk2-firmware-rev.bb + fi + + if [ ! -z "$ARM_BBR_TAG" ]; then + sed -i -E 's/SRCREV_bbr-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_bbr-acs = \"'${ARM_BBR_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb + fi + + if [ ! -z "$EDK2_LIBC_SRC_TAG" ]; then + sed -i -E 's/SRCREV_edk2-libc\s+=\s+"\$\{AUTOREV\}"/SRCREV_edk2-libc = \"'${EDK2_LIBC_SRC_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs.bb + fi + + if [ ! -z "$SCT_SRC_TAG" ]; then + sed -i -E 's/SRCREV_edk2-test\s+=\s+"\$\{AUTOREV\}"/SRCREV_edk2-test = \"'${SCT_SRC_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb + fi + + if [ ! -z "$ARM_LINUX_ACS_TAG" ]; then + sed -i -E 's/SRCREV_linux-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_linux-acs = \"'${ARM_LINUX_ACS_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb + fi + + # create a bsa-acs patches directory in meta-woden/recipes-acs/bsa-acs-uefi and copy requires BSA patches + mkdir $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs + cp $TOP_DIR/../patches/* $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs/. + + # copy .nsh files to meta-woden/recipes-acs/bootfs-files/files + COMMON_DIR_PATH=`git rev-parse --show-toplevel`"/common" + mkdir $TOP_DIR/meta-woden/recipes-acs/bootfs-files/files + cp $COMMON_DIR_PATH/config/*.nsh $TOP_DIR/meta-woden/recipes-acs/bootfs-files/files/. + + #update run-time scripts with ACS version + pushd $TOP_DIR/meta-woden/recipes-acs/bootfs-files/files + if [ ! -z "$ACS_VERSION" ] && [ ! -z "$ARM_BSA_VERSION" ]; then + sed -i 's/#BSA_VERSION_PRINT_PLACEHOLDER/echo '"${ACS_VERSION}"'\necho BSA '"${ARM_BSA_VERSION}"' /g' bsa.nsh + fi + + # remove connect -r from startup.nsh, since it is not required for IR systems + sed -i 's/connect -r//g' startup.nsh + + popd + +} + +copy_recipes +customise_image + diff --git a/IR/Yocto/config/linux-yocto_%.bbappend b/IR/Yocto/config/linux-yocto_%.bbappend new file mode 100644 index 0000000..f0f9d37 --- /dev/null +++ b/IR/Yocto/config/linux-yocto_%.bbappend @@ -0,0 +1,16 @@ +ARMFILESPATHS := "${THISDIR}/${PN}:" + +COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64" +FILESEXTRAPATHS:prepend:generic-arm64 = "${ARMFILESPATHS}" +SRC_URI:append:generic-arm64 = " " + +FILESEXTRAPATHS:prepend:qemuarm64-sbsa = "${ARMFILESPATHS}" +SRC_URI:append:qemuarm64-sbsa = " \ + file://defconfig.patch \ + " + +FILESEXTRAPATHS:prepend:qemuarm64-secureboot = "${ARMFILESPATHS}" +SRC_URI:append:qemuarm64-secureboot = " \ + file://zone_dma_revert.patch \ + file://tee.cfg \ + " diff --git a/IR/Yocto/meta-woden/conf/distro/woden.conf b/IR/Yocto/meta-woden/conf/distro/woden.conf new file mode 100644 index 0000000..5d5bada --- /dev/null +++ b/IR/Yocto/meta-woden/conf/distro/woden.conf @@ -0,0 +1,38 @@ +DISTRO = "woden" +DISTRO_NAME = "Woden" +DISTRO_VERSION = "0.0" +DISTRO_CODENAME = "master" + +INIT_MANAGER = "systemd" +DISTRO_FEATURES = "acl argp ext2 ipv4 ipv6 largefile usbhost wifi xattr pci vfat seccomp" +DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio gobject-introspection-data" + +# TODO remove? +DISTRO_EXTRA_RDEPENDS += "packagegroup-core-boot" +DISTRO_EXTRA_RRECOMMENDS += "kernel-module-af-packet" + +PREMIRRORS ??= "\ +bzr://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +cvs://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +git://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +gitsm://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +hg://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +osc://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +p4://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n \ +svn://.*/.* https://downloads.yoctoproject.org/mirror/sources/ \n" + +require conf/distro/include/no-static-libs.inc +require conf/distro/include/yocto-uninative.inc +require conf/distro/include/security_flags.inc +INHERIT += "uninative" + +BB_SIGNATURE_HANDLER ?= "OEEquivHash" +BB_HASHSERVE ??= "auto" + +#grub-efi +EFI_PROVIDER = "grub-efi" + +# Suffixing the build directory with the libc is pointless +TCLIBCAPPEND = "" +PREFERRED_VERSION_linux-yocto = "5.15%" +PREFERRED_VERSION_fwts = "22.05.00" diff --git a/IR/Yocto/meta-woden/conf/layer.conf b/IR/Yocto/meta-woden/conf/layer.conf new file mode 100644 index 0000000..e486750 --- /dev/null +++ b/IR/Yocto/meta-woden/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-woden" +BBFILE_PATTERN_meta-woden = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-woden = "5" + +LAYERDEPENDS_meta-woden = "core meta-arm openembedded-layer" +LAYERSERIES_COMPAT_meta-woden = "kirkstone" diff --git a/IR/Yocto/meta-woden/kas/external-gcc.yml b/IR/Yocto/meta-woden/kas/external-gcc.yml new file mode 100644 index 0000000..2cb276d --- /dev/null +++ b/IR/Yocto/meta-woden/kas/external-gcc.yml @@ -0,0 +1,9 @@ +header: + version: 11 + +env: + EXTERNAL_TOOLCHAIN: "/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/" + +local_conf_header: + cc: | + TCMODE = "external-arm" diff --git a/IR/Yocto/meta-woden/kas/woden.yml b/IR/Yocto/meta-woden/kas/woden.yml new file mode 100644 index 0000000..2f61daa --- /dev/null +++ b/IR/Yocto/meta-woden/kas/woden.yml @@ -0,0 +1,35 @@ +header: + version: 11 + +repos: + meta-woden: + + poky: + url: https://git.yoctoproject.org/git/poky + refspec: kirkstone-4.0 + layers: + meta: + + meta-arm: + url: https://git.yoctoproject.org/git/meta-arm + refspec: kirkstone + layers: + meta-arm: + meta-arm-bsp: + meta-arm-toolchain: + + meta-openembedded: + url: https://git.openembedded.org/meta-openembedded + refspec: kirkstone + layers: + meta-oe: + +local_conf_header: + threads: | + BB_NUMBER_THREADS = "16" + PARALLEL_MAKE = "-j16" + +distro: woden +machine: generic-arm64 +target: + - woden-image diff --git a/IR/Yocto/meta-woden/recipes-acs/bootfs-files/bootfs-files.bb b/IR/Yocto/meta-woden/recipes-acs/bootfs-files/bootfs-files.bb new file mode 100644 index 0000000..b9fcfea --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/bootfs-files/bootfs-files.bb @@ -0,0 +1,34 @@ +LICENSE = "CLOSED" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit deploy + +S = "${WORKDIR}" + +SRC_URI = " file://bsa.nsh \ + file://debug_dump.nsh \ + file://startup.nsh \ + " + +# no configure step +do_configure[noexec] = "1" + +# no compile +do_compile[noexec] = "1" + +# no install +do_install[noexec] = "1" + +do_deploy() { + # Copy the files to deploy directory + cp bsa.nsh ${DEPLOYDIR}/ + cp debug_dump.nsh ${DEPLOYDIR}/ + cp startup.nsh ${DEPLOYDIR}/ + + # create and copy necessary flags to deploy directory + touch ir_bsa.flag yocto_image.flag + cp ir_bsa.flag yocto_image.flag ${DEPLOYDIR}/ +} + +addtask deploy after do_install diff --git a/IR/Yocto/meta-woden/recipes-acs/bsa-acs-app/bsa-acs-app.bb b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-app/bsa-acs-app.bb new file mode 100644 index 0000000..c0c6fd6 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-app/bsa-acs-app.bb @@ -0,0 +1,24 @@ +SUMMARY = "BSA ACS Linux application" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://bsa-acs/LICENSE.md;md5=2a944942e1496af1886903d274dedb13 \ +" + +SRC_URI = "git://github.com/ARM-software/bsa-acs;destsuffix=bsa-acs;protocol=https;branch=main;name=bsa-acs \ +" +SRCREV_bsa-acs = "${AUTOREV}" + +S = "${WORKDIR}" +TARGET_CC_ARCH += "${LDFLAGS}" + +do_compile() { + cd ${S}/bsa-acs/linux_app/bsa-acs-app + ${CC} *.c -Iinclude -o ${S}/bsa +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 bsa ${D}${bindir} +} + +FILES:${PN} += "${bindir}/*" + diff --git a/IR/Yocto/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb new file mode 100644 index 0000000..c496cda --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb @@ -0,0 +1,39 @@ +SUMMARY = "BSA-ACS Linux driver" +LICENSE = "GPLv2 & Apache-2.0" +LIC_FILES_CHKSUM = "file://bsa-acs/LICENSE.md;md5=2a944942e1496af1886903d274dedb13 \ + file://linux-acs/bsa-acs-drv/files/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ +" +COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64" + +inherit module-base + +SRC_URI += "git://github.com/ARM-software/bsa-acs;destsuffix=bsa-acs;protocol=https;branch=main;name=bsa-acs \ + git://git.gitlab.arm.com/linux-arm/linux-acs.git;destsuffix=linux-acs;protocol=https;branch=master;name=linux-acs \ + " +SRCREV_FORMAT = "bsa-acs_linux-acs" +SRCREV_bsa-acs = "${AUTOREV}" +SRCREV_linux-acs = "${AUTOREV}" + +S = "${WORKDIR}" +MODULE_NAME = "bsa_acs" + +do_configure(){ + cd ${S}/linux-acs/bsa-acs-drv/files/ + ./setup.sh ${S}/bsa-acs +} + +do_compile() { + export KERNEL_SRC=${STAGING_KERNEL_DIR} + cd ${S}/linux-acs/bsa-acs-drv/files/ + ./linux_bsa_acs.sh +} + +do_install() { + install -d ${D}/${base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} + install -m 0644 ${S}/linux-acs/bsa-acs-drv/files/${MODULE_NAME}.ko \ + ${D}/${base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko +} + +FILES:${PN} += "${base_libdir}/* \ +" + diff --git a/IR/Yocto/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs.bb b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs.bb new file mode 100644 index 0000000..1bc2541 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs.bb @@ -0,0 +1,30 @@ +require recipes-acs/edk2-firmware/edk2-firmware-rev.bb + +PROVIDES:remove = "virtual/uefi-firmware" +PROVIDES:remove = "virtual/bootloader" + +LICENSE += "& Apache-2.0" +LIC_FILES_CHKSUM += "file://ShellPkg/Application/bsa-acs/LICENSE.md;md5=2a944942e1496af1886903d274dedb13" +COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64" + +SRC_URI += "git://github.com/ARM-software/bsa-acs;destsuffix=edk2/ShellPkg/Application/bsa-acs;protocol=https;branch=main;name=bsa-acs \ + git://github.com/tianocore/edk2-libc;destsuffix=edk2/edk2-libc;protocol=https;branch=master;name=edk2-libc \ + file://ir_bsa.patch \ + file://ir_bsa_hii.patch \ + " + +SRCREV_bsa-acs = "${AUTOREV}" +SRCREV_edk2-libc = "${AUTOREV}" + +COMPATIBLE_HOST = "aarch64.*-linux" +EDK2_ARCH = "AARCH64" +EDK2_PLATFORM = "Shell" +EDK2_PLATFORM_DSC = "ShellPkg/ShellPkg.dsc" +EDK2_EXTRA_BUILD = "--module ShellPkg/Application/bsa-acs/uefi_app/BsaAcs.inf" + +PACKAGES_PATH .= ":${S}/edk2-libc" + +do_install() { + install -d ${D}/firmware + install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/*/Bsa.efi ${D}/firmware/ +} diff --git a/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb b/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb new file mode 100644 index 0000000..eb1a2dc --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/ebbr-sct.bb @@ -0,0 +1,76 @@ +SUMMARY = "UEFI Self Certification Tests (SCT) for IR systems" +DESCRIPTION = "UEFI SCT tests to check for compliance against the EBBR recipe" +HOMEPAGE = "https://github.com/ARM-software/bbr-acs" + +inherit deploy + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://bbr-acs/LICENSE.md;md5=2a944942e1496af1886903d274dedb13" + +SRC_URI += "git://github.com/ARM-software/bbr-acs;destsuffix=bbr-acs;protocol=https;branch=main;name=bbr-acs \ + git://github.com/tianocore/edk2-test;;destsuffix=edk2-test;protocol=https;nobranch=1;name=edk2-test \ + gitsm://github.com/tianocore/edk2.git;destsuffix=edk2-test/edk2;protocol=https;nobranch=1;name=edk2 \ + file://sctversion.patch;patch=1;patchdir=edk2-test \ +" + +S = "${WORKDIR}" + +SRCREV_FORMAT = "edk2-test_edk2_bbr-acs" +SRCREV_edk2 = "${AUTOREV}" +SRCREV_edk2-test = "${AUTOREV}" +SRCREV_bbr-acs = "${AUTOREV}" + +# set variables as required by edk2 based build +SBBR_TEST_DIR = "${S}/bbr-acs/common/sct-tests/sbbr-tests" +UEFI_BUILD_MODE = "DEBUG" +EDK2_ARCH = "AARCH64" +UEFI_TOOLCHAIN = "GCC5" +export PYTHON_COMMAND = "python3" + + +do_configure() { + cd ${S}/edk2-test + # patch edk2-test + echo "Applying SCT patch ..." + patch -p1 < ${S}/bbr-acs/common/patches/edk2-test-bbr.patch + + # Copy sbbr-test cases from bbr-acs to uefi-sct + cp -r ${SBBR_TEST_DIR}/SbbrBootServices uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ + cp -r ${SBBR_TEST_DIR}/SbbrEfiSpecVerLvl ${SBBR_TEST_DIR}/SbbrRequiredUefiProtocols ${SBBR_TEST_DIR}/SbbrSmbios ${SBBR_TEST_DIR}/SbbrSysEnvConfig uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/ + cp -r ${SBBR_TEST_DIR}/SBBRRuntimeServices uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/ + cp ${SBBR_TEST_DIR}/BBR_SCT.dsc uefi-sct/SctPkg/UEFI/ + cp ${SBBR_TEST_DIR}/build_bbr.sh uefi-sct/SctPkg/ + cp ${S}/bbr-acs/ebbr/config/EfiCompliant_EBBR.ini uefi-sct/SctPkg/UEFI/ +} + +do_compile() { + cd ${S}/edk2-test + # create softlink to SctPkg + ln -sf ${S}/edk2-test/uefi-sct/SctPkg SctPkg + chmod +x SctPkg/build_bbr.sh + # modify build_bbr.sh script to set CROSS_COMPILE to desired TARGET_PREFIX + sed -i 's/TEMP_CROSS_COMPILE=aarch64-linux-gnu-/TEMP_CROSS_COMPILE='${TARGET_PREFIX}'/g' SctPkg/build_bbr.sh + # build ebbr + ./SctPkg/build_bbr.sh ${EDK2_ARCH} GCC +} + +do_install() { + install -d ${D}/bbr/SCT + cd ${S}/edk2-test + cp -r Build/bbrSct/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/SctPackage${EDK2_ARCH}/${EDK2_ARCH}/* ${D}/bbr/SCT/ + cp ${S}/bbr-acs/ebbr/config/EBBRStartup.nsh ${D}/bbr/SctStartup.nsh + cp ${S}/bbr-acs/ebbr/config/EBBR_manual.seq ${D}/bbr/SCT/Sequence/EBBR_manual.seq + cp ${S}/bbr-acs/ebbr/config/EBBR.seq ${D}/bbr/SCT/Sequence/EBBR.seq + cp SctPkg/UEFI/EfiCompliant_EBBR.ini ${D}/bbr/SCT/Dependency/EfiCompliantBBTest/EfiCompliant.ini +} + +# include files to be packaged. +FILES:${PN} += "/bbr" + +do_deploy() { + # copy SCT output files to deploy directory + install -d ${DEPLOYDIR} + cp -r ${D}/bbr ${DEPLOYDIR}/bbr +} + +addtask deploy after do_install diff --git a/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/files/sctversion.patch b/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/files/sctversion.patch new file mode 100644 index 0000000..4a4131e --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/ebbr-sct/files/sctversion.patch @@ -0,0 +1,14 @@ +diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c +index 94cae289..21eec3b7 100644 +--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c ++++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c +@@ -29,6 +29,9 @@ Abstract: + #include "EfiTest.h" + #include "StandardTest.h" + #include ++ ++#define ACS_VERSION "SystemReady IR ACS v2.0.0 Beta-0\nBBR ACS 1.0.1 (EBBR)" ++ + + static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 }; + diff --git a/IR/Yocto/meta-woden/recipes-acs/edk2-firmware/edk2-firmware-rev.bb b/IR/Yocto/meta-woden/recipes-acs/edk2-firmware/edk2-firmware-rev.bb new file mode 100644 index 0000000..f48e1d4 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/edk2-firmware/edk2-firmware-rev.bb @@ -0,0 +1,9 @@ + +SRCREV_edk2 ?= "${AUTOREV}" +SRCREV_edk2-platforms ?= "${AUTOREV}" + +FILESEXTRAPATHS:prepend := "${TOPDIR}/../meta-arm/meta-arm/recipes-bsp/uefi/files:" + +require recipes-bsp/uefi/edk2-firmware.inc + +SRC_URI:remove = "file://unaligned.patch" diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-Add-correct-printf-qualifier-for-off_t.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-Add-correct-printf-qualifier-for-off_t.patch new file mode 100644 index 0000000..0d73d73 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-Add-correct-printf-qualifier-for-off_t.patch @@ -0,0 +1,42 @@ +From ee787b53d734cd952c170c9303d213d3dd18a86f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 8 Jun 2017 16:49:50 -0700 +Subject: [PATCH 1/6] Add correct printf qualifier for off_t + +Signed-off-by: Khem Raj +--- + src/bios/ebda_region/ebda_region.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/bios/ebda_region/ebda_region.c b/src/bios/ebda_region/ebda_region.c +index b70ced10..947a24bd 100644 +--- a/src/bios/ebda_region/ebda_region.c ++++ b/src/bios/ebda_region/ebda_region.c +@@ -83,9 +83,9 @@ static int ebda_test1(fwts_framework *fw) + if ((entry != NULL) && + (entry->type == FWTS_MEMORY_MAP_RESERVED || + entry->type == FWTS_MEMORY_MAP_ACPI)) { +- fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved as a %" PRId64 ++ fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved as a %" PRId64 + "K region in the %s table at 0x%" PRIx64 "..0x%" PRIx64 ".", +- ebda_addr, ++ (intmax_t)ebda_addr, + (entry->end_address - entry->start_address) / 1024, + memory_map_name, + entry->start_address, +@@ -93,9 +93,9 @@ static int ebda_test1(fwts_framework *fw) + } else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "EBDAMappedNotReserved", +- "EBDA region mapped at 0x%lx but not reserved in the %s table.", +- ebda_addr, memory_map_name); +- ++ "EBDA region mapped at 0x%jdx but not reserved in the %s table.", ++ (intmax_t)ebda_addr, memory_map_name); ++ + return FWTS_OK; + } + +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-uefi-esrt-Added-esrt_test2-for-EBBR.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-uefi-esrt-Added-esrt_test2-for-EBBR.patch new file mode 100644 index 0000000..ce514f0 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0001-uefi-esrt-Added-esrt_test2-for-EBBR.patch @@ -0,0 +1,102 @@ +From f55b4fa0b4bbff9643029464f4682355e27dff8b Mon Sep 17 00:00:00 2001 +From: G Edhaya Chandran +Date: Mon, 2 May 2022 14:42:27 +0530 +Subject: [PATCH] uefi/esrt : Added esrt_test2 for EBBR + +Added esrt_test2 which will validate if GUIDs (fw_class) in the ESRT +table is not equal to the default U-Boot GUIDs. +The test is applicable only for AARCH64 and --ebbr option + +Signed-off-by: G Edhaya Chandran +--- + src/uefi/esrt/esrt.c | 65 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +diff --git a/src/uefi/esrt/esrt.c b/src/uefi/esrt/esrt.c +index f75fbe9a..fd9013ed 100644 +--- a/src/uefi/esrt/esrt.c ++++ b/src/uefi/esrt/esrt.c +@@ -37,6 +37,9 @@ + /* Current Entry Version */ + #define ESRT_FIRMWARE_RESOURCE_VERSION 1 + ++#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID "DAFFD814-6EBA-4D8C-8A91-BC9BBF4AA301" ++#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID "E2BB9C06-70E9-4B14-97A3-5A7913176e3F" ++ + static int esrt_init(fwts_framework *fw) + { + +@@ -252,8 +255,70 @@ static int esrt_test1(fwts_framework *fw) + + } + ++//esrt_test2 is applicable only for EBBR recipe of Arm BBR ++#if defined(FWTS_ARCH_AARCH64) ++static int esrt_test2(fwts_framework *fw) ++{ ++ ++ DIR *dir; ++ struct dirent *entry; ++ bool passed = true; ++ const int SIZE_OF_GUID = 36; ++ ++ if (!(fw->flags & FWTS_FLAG_EBBR)) { ++ fwts_skipped(fw, "This test is applicable only for EBBR, hence skipped."); ++ return FWTS_SKIP; ++ } ++ ++ if (!(dir = opendir(FWTS_ESRT_ENTRY_PATH))) { ++ fwts_failed(fw, LOG_LEVEL_MEDIUM, "CannotOpenDir", ++ "Cannot open directory %s", FWTS_ESRT_ENTRY_PATH); ++ passed = false; ++ return FWTS_ERROR; ++ } ++ do { ++ entry = readdir(dir); ++ if (entry && strstr(entry->d_name, "entry")) { ++ char path[PATH_MAX] = {0x0}; ++ char *str = NULL; ++ ++ //str contains the GUID ++ snprintf(path, sizeof(path), FWTS_ESRT_ENTRY_PATH "/%s/fw_class", entry->d_name); ++ if ((str = fwts_get(path)) == NULL) { ++ fwts_failed(fw, LOG_LEVEL_MEDIUM, "CannotGetFwClass", ++ "Missing or failed to get FwClass on %s.", entry->d_name); ++ passed = false; ++ return FWTS_ERROR; ++ } ++ if (!strncasecmp(str, EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID, SIZE_OF_GUID)) { ++ fwts_failed(fw, LOG_LEVEL_MEDIUM, "The fw_class is set to default u-boot fit guid", ++ " %s This is an invalid entry.", str); ++ passed = false; ++ return FWTS_ERROR; ++ } ++ if (!strncasecmp(str, EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID, SIZE_OF_GUID)) { ++ fwts_failed(fw, LOG_LEVEL_MEDIUM, "The fw_class is set to default u-boot raw guid", ++ " %s This is an invalid entry.", str); ++ passed = false; ++ return FWTS_ERROR; ++ } ++ free(str); ++ } ++ } while (entry); ++ ++ closedir(dir); ++ ++ fwts_passed(fw, "The fw_class in the ESRT are not default u-boot guids %d", passed); ++ return FWTS_OK; ++} ++#endif ++ ++ + static fwts_framework_minor_test esrt_tests[] = { + { esrt_test1, "Sanity check UEFI ESRT Table." }, ++#if defined(FWTS_ARCH_AARCH64) ++ { esrt_test2, "Validity of fw_class in UEFI ESRT Table for EBBR." }, ++#endif + { NULL, NULL } + }; + +-- +2.17.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0002-Include-poll.h-instead-of-deprecated-sys-poll.h.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0002-Include-poll.h-instead-of-deprecated-sys-poll.h.patch new file mode 100644 index 0000000..8237933 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0002-Include-poll.h-instead-of-deprecated-sys-poll.h.patch @@ -0,0 +1,48 @@ +From 1575b5ce3ecb8709806908061f689315553b40c7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 6 Jun 2017 07:25:09 -0700 +Subject: [PATCH 2/6] Include poll.h instead of deprecated sys/poll.h + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/lib/src/fwts_ipmi.c | 3 ++- + src/lib/src/fwts_pipeio.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lib/src/fwts_ipmi.c b/src/lib/src/fwts_ipmi.c +index ca7c55bb..0b16bec3 100644 +--- a/src/lib/src/fwts_ipmi.c ++++ b/src/lib/src/fwts_ipmi.c +@@ -18,10 +18,11 @@ + * + */ + ++#include ++ + #include + #include + #include +-#include + #include + #include + +diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c +index 716297c4..37752297 100644 +--- a/src/lib/src/fwts_pipeio.c ++++ b/src/lib/src/fwts_pipeio.c +@@ -30,9 +30,9 @@ + #include + #include + #include ++#include + + #include +-#include + #include + #include + #include +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0003-Remove-Werror-from-build.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0003-Remove-Werror-from-build.patch new file mode 100644 index 0000000..5ccd461 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0003-Remove-Werror-from-build.patch @@ -0,0 +1,54 @@ +From 7317aba872f2bcf052a7db9fa3c7a7ce3c55dc6b Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Mon, 21 Aug 2017 10:34:40 +0200 +Subject: [PATCH 3/6] Remove -Werror from build + +Upstream-Status: Pending +--- + src/Makefile.am | 2 +- + src/lib/src/Makefile.am | 2 +- + src/utilities/Makefile.am | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index f8066af..6b979f8 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -12,7 +12,7 @@ AM_CPPFLAGS = \ + -I$(top_srcdir)/src/acpica/source/compiler \ + -I$(top_srcdir)/efi_runtime \ + -pthread `pkg-config --cflags glib-2.0 gio-2.0` \ +- -Wall -Werror -Wextra \ ++ -Wall -Wextra \ + -Wno-address-of-packed-member \ + -Wfloat-equal -Wmissing-declarations \ + -Wno-long-long -Wredundant-decls -Wshadow \ +diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am +index 55c52b4..50efa97 100644 +--- a/src/lib/src/Makefile.am ++++ b/src/lib/src/Makefile.am +@@ -25,7 +25,7 @@ AM_CPPFLAGS = \ + `pkg-config --silence-errors --cflags json-c` \ + `pkg-config --cflags glib-2.0 gio-2.0` \ + -DDATAROOTDIR=\"$(datarootdir)\" \ +- -Wall -Werror -Wextra \ ++ -Wall -Wextra \ + -Wno-address-of-packed-member + + pkglib_LTLIBRARIES = libfwts.la +diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am +index a7d9b9c..e1bf141 100644 +--- a/src/utilities/Makefile.am ++++ b/src/utilities/Makefile.am +@@ -16,7 +16,7 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + # + +-AM_CPPFLAGS = -Wall -Werror -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ ++AM_CPPFLAGS = -Wall -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ + -I$(srcdir)/../lib/include + + bin_PROGRAMS = kernelscan +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch new file mode 100644 index 0000000..83d1cbb --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch @@ -0,0 +1,33 @@ +From 9456f2f779d3ed4a134d55571d8bec78ad3b28c1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 6 Jun 2017 07:37:20 -0700 +Subject: [PATCH 4/6] Define __SWORD_TYPE if not defined by libc + +__SWORD_TYPE is internal to glibc, therefore +check and define it if needed e.g. on musl + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/lib/src/fwts_uefi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c +index 138f1164..13d9e36c 100644 +--- a/src/lib/src/fwts_uefi.c ++++ b/src/lib/src/fwts_uefi.c +@@ -63,6 +63,10 @@ typedef struct { + #define UEFI_IFACE_SYSFS (2) /* sysfs */ + #define UEFI_IFACE_EFIVARS (3) /* efivar fs */ + ++#ifndef __SWORD_TYPE ++typedef __typeof__( ((struct statfs *)0)->f_type ) __SWORD_TYPE; ++#endif ++ + /* File system magic numbers */ + #define PSTOREFS_MAGIC ((__SWORD_TYPE)0x6165676C) + #define EFIVARFS_MAGIC ((__SWORD_TYPE)0xde5e81e4) +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0005-Undefine-PAGE_SIZE.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0005-Undefine-PAGE_SIZE.patch new file mode 100644 index 0000000..319e085 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0005-Undefine-PAGE_SIZE.patch @@ -0,0 +1,30 @@ +From 53b9f97fb7faed043134f2ab738347b20379d32f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 6 Jun 2017 07:39:28 -0700 +Subject: [PATCH 5/6] Undefine PAGE_SIZE + +musl defines PAGE_SIZE and build complains +of multiple definitions + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/lib/src/fwts_acpi_tables.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index dc42a8bd..4fa1246a 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -42,6 +42,7 @@ + #define BIOS_START (0x000e0000) /* Start of BIOS memory */ + #define BIOS_END (0x000fffff) /* End of BIOS memory */ + #define BIOS_LENGTH (BIOS_END - BIOS_START) /* Length of BIOS memory */ ++#undef PAGE_SIZE + #define PAGE_SIZE (4096) + + static fwts_acpi_table_info tables[ACPI_MAX_TABLES]; +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/files/0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch new file mode 100644 index 0000000..eb8b0b7 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/files/0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch @@ -0,0 +1,67 @@ +From f723458eb649a9ad1d5d0e3dd6e801b284680fa7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 8 Jun 2017 16:50:59 -0700 +Subject: [PATCH 6/6] use intptr_t to fix pointer-to-int-cast issues + +uintptr_t is guaranteed to be wide enough that +converting a void* to uintptr_t and back again +will yield the original pointer value + +Signed-off-by: Khem Raj +--- + src/lib/src/fwts_acpi_tables.c | 4 ++-- + src/lib/src/fwts_mmap.c | 2 +- + src/lib/src/fwts_smbios.c | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index 4fa1246a..7ef197cd 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -173,7 +173,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_get_rsdp(fwts_framework *fw, void *addr, + return NULL; + } + +- if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) ++ if ((mem = fwts_mmap((uintptr_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) + return NULL; + + if (fwts_safe_memcpy(rsdp, mem, sizeof(fwts_acpi_table_rsdp)) != FWTS_OK) { +@@ -486,7 +486,7 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw) + if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL) + return FWTS_ERROR; + +- fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); ++ fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(uintptr_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); + + /* Load any tables from XSDT if it's valid */ + if (rsdp->xsdt_address) { +diff --git a/src/lib/src/fwts_mmap.c b/src/lib/src/fwts_mmap.c +index 2f2514f1..fbd946f4 100644 +--- a/src/lib/src/fwts_mmap.c ++++ b/src/lib/src/fwts_mmap.c +@@ -82,7 +82,7 @@ int fwts_munmap(void *mem, const size_t size) + off_t offset; + + page_size = fwts_page_size(); +- offset = ((off_t)(mem)) & (page_size - 1); ++ offset = ((uintptr_t)(mem)) & (page_size - 1); + + if (munmap((void *)((uint8_t *)mem - offset), size + offset) < 0) + return FWTS_ERROR; +diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c +index 8da572e9..04315bd3 100644 +--- a/src/lib/src/fwts_smbios.c ++++ b/src/lib/src/fwts_smbios.c +@@ -78,7 +78,7 @@ static void *fwts_smbios_find_entry_uefi( + if ((addr = fwts_scan_efi_systab(smbios)) != NULL) { + fwts_smbios_entry *mapped_entry; + +- if ((mapped_entry = fwts_mmap((off_t)addr, size)) != FWTS_MAP_FAILED) { ++ if ((mapped_entry = fwts_mmap((uintptr_t)addr, size)) != FWTS_MAP_FAILED) { + if (fwts_safe_memcpy(entry, mapped_entry, size) == FWTS_OK) { + (void)fwts_munmap(mapped_entry, size); + *type = FWTS_SMBIOS; +-- +2.25.1 + diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_21.06.00.bb b/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_21.06.00.bb new file mode 100644 index 0000000..de0570e --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_21.06.00.bb @@ -0,0 +1,33 @@ +SUMMARY = "Firmware testsuite" +DESCRIPTION = "The tool fwts comprises of over fifty tests that are designed to exercise and test different aspects of a machine's firmware. Many of these tests need super user access to read BIOS data and ACPI tables, so the tool requires running with super user privileges (e.g. with sudo)." +HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519" + +SRC_URI = "http://fwts.ubuntu.com/release/fwts-V${PV}.tar.gz;subdir=${BP} \ + file://0001-Add-correct-printf-qualifier-for-off_t.patch \ + file://0002-Include-poll.h-instead-of-deprecated-sys-poll.h.patch \ + file://0003-Remove-Werror-from-build.patch \ + file://0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \ + file://0005-Undefine-PAGE_SIZE.patch \ + file://0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \ + file://0001-uefi-esrt-Added-esrt_test2-for-EBBR.patch \ + " +SRC_URI[sha256sum] = "ca43439707976f6664fe3f6eb7f356a51ac7d7f8a4e246ef4d1b16305e066909" + +COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux" + +DEPENDS = "libpcre glib-2.0 dtc bison-native libbsd" +DEPENDS:append:libc-musl = " libexecinfo" + +# Use brokensep for now (https://github.com/ColinIanKing/fwts/issues/2) +inherit autotools-brokensep bash-completion pkgconfig + +LDFLAGS:append:libc-musl = " -lexecinfo" + +FILES:${PN} += "${libdir}/fwts/lib*${SOLIBS}" +FILES:${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la" +FILES:${PN}-staticdev += "${libdir}/fwts/lib*a" + +RDEPENDS:${PN} += "dtc" diff --git a/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_22.05.00.bb b/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_22.05.00.bb new file mode 100644 index 0000000..182eb07 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/fwts/fwts_22.05.00.bb @@ -0,0 +1,35 @@ +SUMMARY = "Firmware testsuite" +DESCRIPTION = "The tool fwts comprises of over fifty tests that are designed to exercise and test different aspects of a machine's firmware. Many of these tests need super user access to read BIOS data and ACPI tables, so the tool requires running with super user privileges (e.g. with sudo)." +HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts" + +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519" + +SRC_URI = "http://fwts.ubuntu.com/release/fwts-V${PV}.tar.gz;subdir=${BP} \ + file://0001-Add-correct-printf-qualifier-for-off_t.patch \ + file://0003-Remove-Werror-from-build.patch \ + file://0004-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \ + file://0005-Undefine-PAGE_SIZE.patch \ + file://0006-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \ + file://0001-uefi-esrt-Added-esrt_test2-for-EBBR.patch \ + " +SRC_URI[sha256sum] = "9a1a2ca3e37d49d46459d647be20ec70efd0e6a75848d2e5a8c51fc21b4bc191" + +COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux" + +DEPENDS = "libpcre glib-2.0 dtc bison-native libbsd" +DEPENDS:append:libc-musl = " libexecinfo" + +inherit autotools bash-completion pkgconfig + +LDFLAGS:append:libc-musl = " -lexecinfo" + +# We end up linker barfing with undefined symbols on ppc64 but not on other arches +# surprisingly +ASNEEDED:powerpc64le = "" + +FILES:${PN} += "${libdir}/fwts/lib*${SOLIBS}" +FILES:${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la" +FILES:${PN}-staticdev += "${libdir}/fwts/lib*a" + +RDEPENDS:${PN} += "dtc" diff --git a/IR/Yocto/meta-woden/recipes-acs/grub/grub-efi_%.bbappend b/IR/Yocto/meta-woden/recipes-acs/grub/grub-efi_%.bbappend new file mode 100644 index 0000000..c6d171f --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/grub/grub-efi_%.bbappend @@ -0,0 +1,5 @@ +# add chainloader + +GRUB_BUILDIN = "boot linux ext2 fat serial part_msdos part_gpt normal \ + efi_gop iso9660 configfile search loadenv test chain" + diff --git a/IR/Yocto/meta-woden/recipes-acs/install-files/files/acs_run-before-login-prompt.service b/IR/Yocto/meta-woden/recipes-acs/install-files/files/acs_run-before-login-prompt.service new file mode 100644 index 0000000..50b1f31 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/install-files/files/acs_run-before-login-prompt.service @@ -0,0 +1,14 @@ +[Unit] +Description=Run script with systemd right before login prompt +#After=systemd-user-sessions.service plymouth-quit-wait.service +After=results.mount +#Before=getty.target + +[Service] +Type=simple +RemainAfterExit=yes +StandardOutput=journal+console +ExecStart=/usr/bin/init.sh + +[Install] +WantedBy=multi-user.target diff --git a/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh b/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh new file mode 100644 index 0000000..6989dac --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh @@ -0,0 +1,99 @@ +#!/bin/sh + +# Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of ARM nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +echo "init.sh" + +sleep 5 + +echo "Attempting to mount the results partition ..." +RESULT_DEVICE=""; + +#mount result partition +cat /proc/partitions | tail -n +3 > partition_table.lst +while read -r line +do + # do something with $line here + MAJOR=`echo $line | awk '{print $1}'` + MINOR=`echo $line | awk '{print $2}'` + DEVICE=`echo $line | awk '{print $4}'` + echo "$MAJOR $MINOR $DEVICE" + mknod /dev/$DEVICE b $MAJOR $MINOR + mount /dev/$DEVICE /mnt + if [ -d /mnt/acs_results ]; then + #Partition is mounted. Break from loop + RESULT_DEVICE="/dev/$DEVICE" + echo "Setting RESULT_DEVICE to $RESULT_DEVICE" + break; + #Note: umount must be done from the calling function + else + #acs_results is not found, so move to next + umount /mnt + fi +done < partition_table.lst + +rm partition_table.lst + +if [ ! -z "$RESULT_DEVICE" ]; then + echo "Mounted the results partition on device $RESULT_DEVICE" +else + echo "Warning: the results partition could not be mounted. Logs may not be saved correctly" +fi + +sleep 3 + +#linux debug dump +mkdir -p /mnt/acs_results/linux_dump +lspci -vvv &> /mnt/acs_results/linux_dump/lspci.log + +mkdir -p /mnt/acs_results/fwts +echo "Executing FWTS for EBBR" +test_list=`cat /usr/bin/ir_bbr_fwts_tests.ini | grep -v "^#" | awk '{print $1}' | xargs` +echo "Test Executed are $test_list" +echo $'SystemReady IR ACS v2.0.0 Beta 0\nFWTS v22.05.00' > /mnt/acs_results/fwts/FWTSResults.log +/usr/bin/fwts --ebbr `echo $test_list` -r /mnt/acs_results/fwts/FWTSResults.log +echo -e -n "\n" + +#run linux bsa app +mkdir -p /mnt/acs_results/linux_acs/bsa_acs_app +echo "Loading BSA ACS Linux Driver" +insmod /lib/modules/*/kernel/bsa_acs/bsa_acs.ko +echo "Executing BSA ACS Application " +echo $'SystemReady IR ACS v2.0.0 Beta 0\nBSA v1.0.1' > /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log +bsa >> /mnt/acs_results/linux_acs/bsa_acs_app/BSALinuxResults.log + +#flush the contents to disk +sync /mnt +sleep 3 + +echo "ACS run is completed\n" +echo "Please press to continue ..." +echo -e -n "\n" +exit 0 + diff --git a/IR/Yocto/meta-woden/recipes-acs/install-files/files/ir_bbr_fwts_tests.ini b/IR/Yocto/meta-woden/recipes-acs/install-files/files/ir_bbr_fwts_tests.ini new file mode 100644 index 0000000..9e24c59 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/install-files/files/ir_bbr_fwts_tests.ini @@ -0,0 +1,16 @@ +#All Comments in this config file shall be ignored by the scripts +#fwts is run with --ebbr flag with the below additional tests + + +#TEST SUITE TEST DESCRIPOTION +#------------------------------------------------------------------------------------- +#Unsafe tests: +uefivarinfo UEFI variable info query. + +#UEFI tests: +#csm UEFI Compatibility Support Module test. +esrt Sanity check UEFI ESRT Table. +uefibootpath Sanity check for UEFI Boot Path Boot####. +#uefirtmisc UEFI miscellaneous runtime service interface tests. This is test is now included in the --ebbr flag +#uefirttime UEFI Runtime service time interface tests. This is test is now included in the --ebbr flag +#uefirtvariable UEFI Runtime service variable interface tests. This is test is now included in the --ebbr flag diff --git a/IR/Yocto/meta-woden/recipes-acs/install-files/systemd-init-install.bb b/IR/Yocto/meta-woden/recipes-acs/install-files/systemd-init-install.bb new file mode 100644 index 0000000..0c81542 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/install-files/systemd-init-install.bb @@ -0,0 +1,21 @@ +LICENSE = "CLOSED" +inherit systemd + +SYSTEMD_AUTO_ENABLE = "enable" +SYSTEMD_SERVICE:${PN} = "acs_run-before-login-prompt.service" + +SRC_URI:append = " file://acs_run-before-login-prompt.service \ + file://init.sh \ + file://ir_bbr_fwts_tests.ini \ + " + +FILES:${PN} += "${systemd_unitdir}/system" + +do_install:append() { + install -d ${D}${systemd_unitdir}/system + install -d ${D}${bindir} + install -m 0770 ${WORKDIR}/init.sh ${D}${bindir} + install -m 0770 ${WORKDIR}/ir_bbr_fwts_tests.ini ${D}${bindir} + install -m 0644 ${WORKDIR}/acs_run-before-login-prompt.service ${D}${systemd_unitdir}/system + +} diff --git a/IR/Yocto/meta-woden/recipes-acs/shell-app/shell-app.bb b/IR/Yocto/meta-woden/recipes-acs/shell-app/shell-app.bb new file mode 100644 index 0000000..0b4ae94 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/shell-app/shell-app.bb @@ -0,0 +1,21 @@ +SUMMARY = "UEFI Shell Application" +DESCRIPTION = "This recipe builds UEFI Shell Application" + +require recipes-acs/edk2-firmware/edk2-firmware-rev.bb + +PROVIDES:remove = "virtual/uefi-firmware" +PROVIDES:remove = "virtual/bootloader" + +LICENSE = "CLOSED" +COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64" + +COMPATIBLE_HOST = "aarch64.*-linux" +EDK2_ARCH = "AARCH64" +EDK2_PLATFORM = "Shell" +EDK2_PLATFORM_DSC = "ShellPkg/ShellPkg.dsc" +EDK2_BUILD_MODE = "RELEASE" + +do_install() { + install -d ${D}/firmware + install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/${EDK2_ARCH}/ShellPkg/Application/Shell/Shell/OUTPUT/Shell.efi ${D}/firmware/ +} diff --git a/IR/Yocto/meta-woden/recipes-acs/uefi-apps/uefi-apps.bb b/IR/Yocto/meta-woden/recipes-acs/uefi-apps/uefi-apps.bb new file mode 100644 index 0000000..a656925 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/uefi-apps/uefi-apps.bb @@ -0,0 +1,20 @@ +SUMMARY = "UEFI Applications" +DESCRIPTION = "This recipe builds UEFI Applications and deploys CapsuleApp" + +require recipes-acs/edk2-firmware/edk2-firmware-rev.bb + +PROVIDES:remove = "virtual/uefi-firmware" +PROVIDES:remove = "virtual/bootloader" + +LICENSE = "CLOSED" +COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64" + +COMPATIBLE_HOST = "aarch64.*-linux" +EDK2_ARCH = "AARCH64" +EDK2_PLATFORM = "MdeModule" +EDK2_PLATFORM_DSC = "MdeModulePkg/MdeModulePkg.dsc" + +do_install() { + install -d ${D}/firmware + install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/${EDK2_ARCH}/CapsuleApp.efi ${D}/firmware/ +} diff --git a/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb b/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb new file mode 100644 index 0000000..1546c9f --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb @@ -0,0 +1,62 @@ +inherit core-image + +COMPATIBLE_HOST = "aarch64.*-linux" + +WKS_FILE = "woden.wks.in" + +# Minimal install, don't pull in packagegroup-base +IMAGE_INSTALL = "packagegroup-core-boot \ + python3 \ + fwts \ + bsa-acs-drv \ + bsa-acs-app \ + ${CORE_IMAGE_EXTRA_INSTALL}" + +EXTRA_IMAGEDEPENDS += "bsa-acs \ + shell-app \ + uefi-apps \ + ebbr-sct \ + bootfs-files \ +" +IMAGE_EFI_BOOT_FILES += "Bsa.efi;EFI/BOOT/bsa/Bsa.efi \ + bsa.nsh;EFI/BOOT/bsa/bsa.nsh \ + ir_bsa.flag;EFI/BOOT/bsa/ir_bsa.flag \ + yocto_image.flag \ + debug_dump.nsh;EFI/BOOT/debug/debug_dump.nsh \ + startup.nsh;EFI/BOOT/startup.nsh \ + CapsuleApp.efi;EFI/BOOT/app/CapsuleApp.efi \ + Shell.efi;EFI/BOOT/Shell.efi \ +" + +do_dir_deploy() { + # copying bbr directory to /boot partition + wic cp ${DEPLOY_DIR_IMAGE}/bbr ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/EFI/BOOT/ + + # create and copy empty acs_results directory to /results partition + mkdir -p acs_results + wic cp acs_results ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:3/ + + #add bsa/bbr bootloder entry and set it has default boot + wic cp ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/EFI/BOOT/grub.cfg grub.cfg + echo "menuentry 'bbr/bsa' {chainloader /EFI/BOOT/Shell.efi}" >> grub.cfg + sed -i 's\default=boot\default=bbr/bsa\g' grub.cfg + sed -i 's\boot\Linux Boot\g' grub.cfg + wic cp grub.cfg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/EFI/BOOT/grub.cfg + + # update startup.nsh linux command with command from grub.cfg + # since PARTUUID method is reliable + LINUX_BOOT_CMD=`grep -Po 'Image\s+[a-zA-Z]+=.*' < grub.cfg` + wic cp ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/EFI/BOOT/startup.nsh startup.nsh + sed -i -E 's/Image\s+[a-zA-Z]+=.*/'"${LINUX_BOOT_CMD}"'/g' startup.nsh + wic cp startup.nsh ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/EFI/BOOT/startup.nsh + + # remove additional startup.nsh from /boot partition + wic rm ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.wic:1/startup.nsh +} + +IMAGE_FEATURES += "empty-root-password" +IMAGE_INSTALL:append = "systemd-init-install \ + pciutils \ +" + +addtask dir_deploy before do_populate_lic_deploy after do_image_complete diff --git a/IR/Yocto/meta-woden/recipes-kernel/linux/files/0002-Fix-for-CompuLab-IOT-GATE-iMX8-boot-issue.patch b/IR/Yocto/meta-woden/recipes-kernel/linux/files/0002-Fix-for-CompuLab-IOT-GATE-iMX8-boot-issue.patch new file mode 100644 index 0000000..6f3b0eb --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-kernel/linux/files/0002-Fix-for-CompuLab-IOT-GATE-iMX8-boot-issue.patch @@ -0,0 +1,27 @@ +From d11adca61b022d66bd0540e9a7a8da9e118fa221 Mon Sep 17 00:00:00 2001 +From: Amrathesh +Date: Tue, 21 Jun 2022 22:14:28 +0530 +Subject: [PATCH] Fix for CompuLab IOT-GATE-iMX8 boot issue + +- USB doesn't get mounted due to power domain support + changes for SoC. + +Signed-off-by: Amrathesh +--- + drivers/soc/imx/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile +index 078dc918f..fbdadcac7 100644 +--- a/drivers/soc/imx/Makefile ++++ b/drivers/soc/imx/Makefile +@@ -3,5 +3,5 @@ ifeq ($(CONFIG_ARM),y) + obj-$(CONFIG_ARCH_MXC) += soc-imx.o + endif + obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o +-obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o ++#obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o + obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o +-- +2.17.1 + diff --git a/IR/Yocto/meta-woden/recipes-kernel/linux/files/systemready.cfg b/IR/Yocto/meta-woden/recipes-kernel/linux/files/systemready.cfg new file mode 100644 index 0000000..1647b15 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-kernel/linux/files/systemready.cfg @@ -0,0 +1,6 @@ +#Defconfig for SystemReady IR +CONFIG_EFI_TEST=y +CONFIG_DMI_SYSFS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_COMMON_CLK_ZYNQMP=y +CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y diff --git a/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15%.bbappend b/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15%.bbappend new file mode 100644 index 0000000..4b0623c --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI:append:generic-arm64 = " file://systemready.cfg" diff --git a/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15.bb b/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15.bb new file mode 100644 index 0000000..cf6dfff --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-kernel/linux/linux-yocto_5.15.bb @@ -0,0 +1,73 @@ +KBRANCH ?= "v5.15/standard/base" + +require recipes-kernel/linux/linux-yocto.inc + +# board specific branches +KBRANCH:qemuarm ?= "v5.15/standard/arm-versatile-926ejs" +KBRANCH:qemuarm64 ?= "v5.15/standard/qemuarm64" +KBRANCH:qemumips ?= "v5.15/standard/mti-malta32" +KBRANCH:qemuppc ?= "v5.15/standard/qemuppc" +KBRANCH:qemuriscv64 ?= "v5.15/standard/base" +KBRANCH:qemuriscv32 ?= "v5.15/standard/base" +KBRANCH:qemux86 ?= "v5.15/standard/base" +KBRANCH:qemux86-64 ?= "v5.15/standard/base" +KBRANCH:qemumips64 ?= "v5.15/standard/mti-malta64" + +SRCREV_machine:qemuarm ?= "5a68f2d15d17f0f3c397e7f8c83f3f664f7037e5" +SRCREV_machine:qemuarm64 ?= "00e666e6154fcdf52268f2a5a612b96afad073b0" +SRCREV_machine:qemumips ?= "fb9e75076deade31754b7ad644952d63137e616b" +SRCREV_machine:qemuppc ?= "49f6567f3b85a843e8b6042a79c58aab0bdbd0c9" +SRCREV_machine:qemuriscv64 ?= "cc9695f5fd3b520464eb2ded66950734f308525c" +SRCREV_machine:qemuriscv32 ?= "cc9695f5fd3b520464eb2ded66950734f308525c" +SRCREV_machine:qemux86 ?= "cc9695f5fd3b520464eb2ded66950734f308525c" +SRCREV_machine:qemux86-64 ?= "cc9695f5fd3b520464eb2ded66950734f308525c" +SRCREV_machine:qemumips64 ?= "1ad01ab47ec056d4126798f6d57a33b65b2be49c" +SRCREV_machine ?= "cc9695f5fd3b520464eb2ded66950734f308525c" +SRCREV_meta ?= "37891dc371e83a3451781dd81a8a85cccd60084b" + +# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll +# get the /base branch, which is pure upstream -stable, and the same +# meta SRCREV as the linux-yocto-standard builds. Select your version using the +# normal PREFERRED_VERSION settings. +BBCLASSEXTEND = "devupstream:target" +SRCREV_machine:class-devupstream ?= "3fbf24b73f4a5bc8fd39a6b7a29145451c1039ce" +PN:class-devupstream = "linux-yocto-upstream" +KBRANCH:class-devupstream = "v5.15/base" + +SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA} \ + https://gitlab.arm.com/linux-arm/linux-acs/-/raw/master/kernel/src/0001-BSA-ACS-Linux-5.15.patch;patch=1;md5sum=360b193889d5a07219804b0b3327c892 \ + file://0002-Fix-for-CompuLab-IOT-GATE-iMX8-boot-issue.patch;patch=1 \ +" + +LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" +LINUX_VERSION ?= "5.15.38" + +DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" +DEPENDS += "openssl-native util-linux-native" +DEPENDS += "gmp-native libmpc-native" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +KMETA = "kernel-meta" +KCONF_BSP_AUDIT_LEVEL = "1" + +KERNEL_DEVICETREE:qemuarmv5 = "versatile-pb.dtb" + +COMPATIBLE_MACHINE = "qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32" + +# Functionality flags +KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc" +KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}" +KERNEL_FEATURES:append:qemuall=" cfg/virtio.scc features/drm-bochs/drm-bochs.scc" +KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc" +KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc" +KERNEL_FEATURES:append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "", d)}" +KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/scsi/scsi-debug.scc", "", d)}" +KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc", "", d)}" +KERNEL_FEATURES:append:powerpc =" arch/powerpc/powerpc-debug.scc" +KERNEL_FEATURES:append:powerpc64 =" arch/powerpc/powerpc-debug.scc" +KERNEL_FEATURES:append:powerpc64le =" arch/powerpc/powerpc-debug.scc" + +INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel" + diff --git a/IR/Yocto/meta-woden/wic/woden.wks.in b/IR/Yocto/meta-woden/wic/woden.wks.in new file mode 100644 index 0000000..7c0138e --- /dev/null +++ b/IR/Yocto/meta-woden/wic/woden.wks.in @@ -0,0 +1,7 @@ +bootloader --ptable gpt --timeout=10 --append="rootfstype=ext4" + +part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --label boot --active --align 1024 --use-uuid --size 100M + +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid + +part /results --fstype=vfat --label results --align 1024 --use-uuid --size 50M diff --git a/IR/patches/ir_bsa.patch b/IR/patches/ir_bsa.patch index af6b4df..d3b52c8 100644 --- a/IR/patches/ir_bsa.patch +++ b/IR/patches/ir_bsa.patch @@ -1,18 +1,20 @@ -From 4099a09e9dcc759c3703d759c6b7840a33386b1a Mon Sep 17 00:00:00 2001 +From 348ba393179b9231fc7914fb1770e7e904263cc6 Mon Sep 17 00:00:00 2001 From: Amrathesh -Date: Wed, 22 Dec 2021 17:01:59 +0530 +Date: Tue, 10 May 2022 13:59:19 +0530 Subject: [PATCH] EDK2 IR BSA Patch +- edk2-tag: edk2-stable202202 + Signed-off-by: Amrathesh --- ShellPkg/ShellPkg.dsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc -index a8b6de3..e717591 100644 +index 38fde3dc71..677625e067 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc -@@ -60,6 +60,9 @@ +@@ -63,6 +63,9 @@ DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf @@ -22,7 +24,7 @@ index a8b6de3..e717591 100644 [LibraryClasses.ARM,LibraryClasses.AARCH64] # -@@ -98,6 +101,7 @@ +@@ -101,6 +104,7 @@ ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf diff --git a/IR/patches/ir_bsa_hii.patch b/IR/patches/ir_bsa_hii.patch new file mode 100644 index 0000000..8261380 --- /dev/null +++ b/IR/patches/ir_bsa_hii.patch @@ -0,0 +1,30 @@ +From ea08aac51e70143261345a631110ecbf493a6f6f Mon Sep 17 00:00:00 2001 +From: Amrathesh +Date: Tue, 10 May 2022 14:04:15 +0530 +Subject: [PATCH] EDK2 IR BSA HII Patch + +- edk2-tag: edk2-stable202202 + +Signed-off-by: Amrathesh +--- + MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c b/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c +index f0a8b9fe62..e41e0de3e0 100644 +--- a/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c ++++ b/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c +@@ -90,8 +90,8 @@ UefiHiiServicesLibConstructor ( + // + // Retrieve the pointer to the UEFI HII Config Routing Protocol + // +- Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&gHiiConfigRouting); +- ASSERT_EFI_ERROR (Status); ++ //Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&gHiiConfigRouting); ++ //ASSERT_EFI_ERROR (Status); + + // + // Retrieve the pointer to the optional UEFI HII Font Protocol +-- +2.17.1 + diff --git a/common/config/bsa.nsh b/common/config/bsa.nsh index 4f7c4b1..9cb43d3 100644 --- a/common/config/bsa.nsh +++ b/common/config/bsa.nsh @@ -1,4 +1,4 @@ -# Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2021-2022, ARM Limited and Contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -37,6 +37,7 @@ for %i in 0 1 2 3 4 5 6 7 8 9 A B C D E F then cd uefi for %j in 0 1 2 3 4 5 6 7 8 9 A B C D E F then if exist FS%j:\EFI\BOOT\bsa\Bsa.efi then + #BSA_VERSION_PRINT_PLACEHOLDER if exist FS%j:\EFI\BOOT\bsa\ir_bsa.flag then #Executing for BSA IR. Execute only OS tests FS%j:\EFI\BOOT\bsa\Bsa.efi -os -skip 900 -dtb BsaDevTree.dtb -f BsaResults.log diff --git a/common/config/common_config.cfg b/common/config/common_config.cfg index 9ae5453..3ced3ea 100644 --- a/common/config/common_config.cfg +++ b/common/config/common_config.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2021-2022, ARM Limited and Contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -28,6 +28,8 @@ # Common configurations +#SystemReady ACS version +ACS_VERSION="SystemReady IR ACS v2.0.0 Beta-0" #Linux kernel version. Source downloaded from https://github.com/torvalds/linux.git LINUX_KERNEL_VERSION=5.15 @@ -36,30 +38,38 @@ LINUX_KERNEL_VERSION=5.15 BUSYBOX_SRC_VERSION=1_34_stable #EDK2 source tag from https://github.com/tianocore/edk2.git -EDK2_SRC_VERSION=edk2-stable202111 +EDK2_SRC_VERSION=edk2-stable202205 +EDK2_SRC_TAG=16779ede2d366bfc6b702e817356ccf43425bcc8 #Cross compiler tools from https://releases.linaro.org/components/toolchain/binaries LINARO_TOOLS_MAJOR_VERSION=7.5-2019.12 LINARO_TOOLS_VERSION=7.5.0-2019.12 #FWTS source tag from https://git.launchpad.net/fwts -FWTS_SRC_TAG=1228f0412a6c76b437cfa3078d5dc1fb5ca102c6 +FWTS_SRC_VERSION=v22.05.00 +FWTS_SRC_TAG=d82204d836a6e6bf1ce491224923ea5072bed967 # EDK2-TEST source tag from https://github.com/tianocore/edk2-test -SCT_SRC_TAG=d919c4a5d9fe2681de4d11a0bbfb07373fe6f9c7 +SCT_SRC_TAG=dedfd87f76a9b48bfc03511c19beba285c4f5a81 # GRUB2 source from https://github.com/rhboot/grub2.git GRUB_SRC_TAG=grub-2.06 #Arm BSA source tag. #NOTE: If the value is NULL then the latest BSA source will be downloaded -ARM_BSA_TAG="" +ARM_BSA_VERSION=v1.0.1 +ARM_BSA_TAG="046a01592ae6e46ce8642a2ac1e818320b1dbc47" #Arm BBR source tag #NOTE: If the value is NULL then the latest BBR source will be downloaded -ARM_BBR_TAG="" +ARM_BBR_TAG="489a6f7583941e03f94b8de9c265de9cdaa2c248" #Arm LINUX ACS source tag #NOTE: If the value is NULL then the latest Linux ACS source will be downloaded -ARM_LINUX_ACS_TAG="" +ARM_LINUX_ACS_TAG="7add1bb4cf66a83d9ca07d1fcd2a216120fb7ec8" +#Linux kernel version for Yocto build. Used only for the IR Band +YOCTO_LINUX_KERNEL_VERSION=5.15 + +# EDK2-LIBC source tag from https://github.com/tianocore/edk2-libc +EDK2_LIBC_SRC_TAG=c32222fed9927420fc46da503dea1ebb874698b6 diff --git a/common/config/startup.nsh b/common/config/startup.nsh index 34a063c..4737be8 100755 --- a/common/config/startup.nsh +++ b/common/config/startup.nsh @@ -1,4 +1,4 @@ -# Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2021-22, ARM Limited and Contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -79,5 +79,10 @@ for %l in 0 1 2 3 4 5 6 7 8 9 A B C D E F then cd FS%l:\ Image initrd=\ramdisk-busybox.img systemd.log_target=null plymouth.ignore-serial-consoles debug crashkernel=512M,high log_buf_len=1M efi=debug acpi=on crashkernel=256M earlycon uefi_debug endif + if exist FS%l:\Image and exist FS%l:\yocto_image.flag then + FS%l: + cd FS%l:\ + Image LABEL=Boot root=partuid rootfstype=ext4 + endif endfor echo "Image not found" diff --git a/common/patches/edk2_gicv3.patch b/common/patches/edk2_gicv3.patch index 2eb1472..f679183 100644 --- a/common/patches/edk2_gicv3.patch +++ b/common/patches/edk2_gicv3.patch @@ -1,7 +1,9 @@ -From 7109d1e6cba13fa2d6dda70104244aea8fb5ebe3 Mon Sep 17 00:00:00 2001 +From ce5bebf4c7b9c016a15cb5663676f3c738071f6c Mon Sep 17 00:00:00 2001 From: Amrathesh -Date: Wed, 5 Jan 2022 15:17:11 +0530 -Subject: [PATCH] EDK2 GICv3 Patch +Date: Tue, 10 May 2022 13:55:32 +0530 +Subject: [PATCH] EDK2 GICv3 patch + +- edk2-tag: edk2-stable202202 Signed-off-by: Amrathesh --- @@ -9,7 +11,7 @@ Signed-off-by: Amrathesh 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c -index 16bccbf..79e6e4e 100644 +index b1f0cd48c7..30f6a5ac7d 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c @@ -11,6 +11,7 @@ @@ -18,8 +20,8 @@ index 16bccbf..79e6e4e 100644 #define ARM_GIC_DEFAULT_PRIORITY 0x80 +#define ARM_GIC_MAX_NUM_INTERRUPT 16384 - extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV3Protocol; - extern EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V3Protocol; + extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV3Protocol; + extern EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V3Protocol; @@ -383,7 +384,7 @@ GicV3DxeInitialize ( mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);