├── LICENSE.md ├── README.md ├── Security.md ├── brsi ├── config │ ├── BRSI.seq │ ├── BRSIStartup.nsh │ ├── BRSI_extd_run.seq │ ├── BRSI_manual.seq │ ├── EfiCompliant_BRSI.ini │ ├── buildroot_defconfig │ ├── debug_dump.nsh │ ├── grub-buildroot.cfg │ ├── grub_prefix.cfg │ └── startup.nsh ├── prebuilt_images │ ├── brs_live_image.img.xz │ └── uefi_flash1_23.04.img └── scripts │ └── build-scripts │ ├── build_brsi.sh │ ├── build_image.sh │ ├── config │ ├── BRSIStartup.nsh │ └── debug_dump.nsh │ ├── get_brsi_source.sh │ ├── get_efi_offset.sh │ ├── sct_result_parser.sh │ └── start_qemu.sh ├── common ├── patches │ ├── Update-test-profile-for-MemRead_Func-as-an-example.patch │ ├── buildroot_enable_busybox_auto_login.patch │ ├── buildroot_update_fwts_version.patch │ ├── edk2-test-brs-build.patch │ ├── fwts │ │ ├── 0001-lib-Add-fwts_architecture-macro-for-risc-v.patch │ │ ├── 0002-acpi-rsdp-Add-xsdt_address-check-for-riscv.patch │ │ ├── 0003-acpi-madt-update-madt-revisions-to-ACPI-6.5.next.patch │ │ ├── 0004-acpi-madt-Add-AIA-and-PLIC-sub-tables-test-for-riscv.patch │ │ ├── 0005-acpi-rhct-Add-tests-for-ACPI-RHCT-table.patch │ │ ├── 0006-acpi-acpitables-Update-acpitables-test-for-ACPI-6.5.patch │ │ └── 0007-add-brs-for-BRS-test-set.patch │ └── grub_update_default_gunlib_url.patch ├── scripts │ ├── build-buildroot.sh │ ├── build-grub.sh │ ├── build-linux.sh │ ├── build-sbi-test.sh │ ├── build-sct.sh │ ├── build-sct.sh_bak │ ├── build-uefi-apps.sh │ ├── framework.sh │ ├── get_source.sh │ └── parse_params.sh └── sct-tests │ └── brsi-tests │ ├── BRS_SCT.dsc │ ├── BrsBootServices │ └── BlackBoxTest │ │ ├── BrsBootServicesBBTest.inf │ │ ├── BrsBootServicesBBTestFunction.c │ │ ├── BrsBootServicesBBTestFunction.h │ │ ├── BrsBootServicesBBTestMain.c │ │ ├── BrsBootServicesBBTestMain.h │ │ ├── Guid.c │ │ └── Guid.h │ ├── BrsiEfiSpecVerLvl │ └── BlackBoxTest │ │ ├── EfiSpecVerLvlBBTest.inf │ │ ├── EfiSpecVerLvlBBTestFunction.c │ │ ├── EfiSpecVerLvlBBTestFunction.h │ │ ├── EfiSpecVerLvlBBTestMain.c │ │ ├── EfiSpecVerLvlBBTestMain.h │ │ ├── Guid.c │ │ └── Guid.h │ ├── BrsiRequiredUefiProtocols │ └── BlackBoxTest │ │ ├── Guid.c │ │ ├── Guid.h │ │ ├── RequiredUefiProtocolsBBTest.inf │ │ ├── RequiredUefiProtocolsBBTestFunction.c │ │ ├── RequiredUefiProtocolsBBTestFunction.h │ │ ├── RequiredUefiProtocolsBBTestMain.c │ │ └── RequiredUefiProtocolsBBTestMain.h │ ├── BrsiRuntimeServices │ └── BlackBoxTest │ │ ├── BRSIRuntimeServicesBBTest.inf │ │ ├── BRSIRuntimeServicesBBTestFunction.c │ │ ├── BRSIRuntimeServicesBBTestFunction.h │ │ ├── BRSIRuntimeServicesBBTestMain.c │ │ ├── BRSIRuntimeServicesBBTestMain.h │ │ ├── Guid.c │ │ └── Guid.h │ └── build_brs.sh └── docs ├── Network_Test_Environment_Setup.md └── RV-BRS-Test-Suite_Developer_Guide.md /Security.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. 3 | 4 | ## Reporting a Vulnerability 5 | Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). 6 | 7 | -------------------------------------------------------------------------------- /brsi/config/BRSI.seq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/rv-brs-test-suite/573824669a8513cda83aac2c06b3d7a250cb2492/brsi/config/BRSI.seq -------------------------------------------------------------------------------- /brsi/config/BRSIStartup.nsh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, 2023 ARM Limited and Contributors. All rights reserved. 2 | # Copyright (c) 2023 Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | echo -off 31 | 32 | for %i in 0 1 2 3 4 5 6 7 8 9 A B C D E F 33 | if exist FS%i:\EFI\BOOT\brs\SCT then 34 | # 35 | # Found EFI SCT harness 36 | # 37 | FS%i: 38 | cd FS%i:\EFI\BOOT\brs\SCT 39 | echo Press any key to stop the EFI SCT running 40 | stallforkey.efi 5 41 | if %lasterror% == 0 then 42 | goto Done 43 | endif 44 | for %j in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 45 | if exists FS%j:\acs_results\ then 46 | if exists FS%j:\acs_results\sct_results then 47 | 48 | #Check if SCT run has already completed 49 | if exist FS%j:\acs_results\sct_results\Overall\Summary.log then 50 | echo SCT has completed run. Press any key to start SCT execution from the beginning. WARNING: Ensure you have backed up the existing logs. 51 | stallforkey.efi 5 52 | if %lasterror% == 0 then 53 | #Backup the existing logs 54 | rm -q FS%j:\acs_results\sct_results_previous_run 55 | mkdir FS%j:\acs_results\sct_results_previous_run 56 | cp -r FS%j:\acs_results\sct_results FS%j:\acs_results\sct_results_previous_run 57 | rm -q FS%j:\acs_results\sct_results 58 | goto StartSCT 59 | else 60 | goto Done 61 | endif 62 | endif 63 | 64 | if exist FS%i:\EFI\BOOT\brs\SCT\.passive.mode then 65 | if exist FS%i:\EFI\BOOT\brs\SCT\.verbose.mode then 66 | Sct -c -p mnp -v 67 | else 68 | Sct -c -p mnp 69 | endif 70 | else 71 | if exist FS%i:\EFI\BOOT\brs\SCT\.verbose.mode then 72 | Sct -c -v 73 | else 74 | Sct -c 75 | endif 76 | 77 | #SCT execution has finished. Copy the logs to acs_results 78 | if exist FS%j:\acs_results\sct_results\ then 79 | if exist FS%i:\EFI\BOOT\brs\SCT\Overall then 80 | cp -r FS%i:\EFI\BOOT\brs\SCT\Overall FS%j:\acs_results\sct_results\ 81 | endif 82 | if exist FS%i:\EFI\BOOT\brs\SCT\Dependency\EfiCompliantBBTest then 83 | cp -r FS%i:\EFI\BOOT\brs\SCT\Dependency\EfiCompliantBBTest FS%j:\acs_results\sct_results\ 84 | endif 85 | if exist FS%i:\EFI\BOOT\brs\SCT\Sequence then 86 | cp -r FS%i:\EFI\BOOT\brs\SCT\Sequence FS%j:\acs_results\sct_results\ 87 | endif 88 | 89 | #Restart to avoid an impact of running SCT tests on rest of the suites 90 | echo Reset the system ... 91 | reset 92 | endif 93 | #goto Done 94 | endif 95 | else 96 | :StartSCT 97 | FS%j: 98 | cd FS%j:\acs_results 99 | mkdir sct_results 100 | FS%i: 101 | cd FS%i:\EFI\BOOT\brs\SCT 102 | if %1 == sct_extd then 103 | echo "Starting extended run of SCT" 104 | Sct -s BRSI_extd_run.seq 105 | else 106 | Sct -s BRSI.seq 107 | endif 108 | goto Done 109 | endif 110 | endif 111 | endfor 112 | endif 113 | endfor 114 | 115 | :Done 116 | 117 | -------------------------------------------------------------------------------- /brsi/config/BRSI_extd_run.seq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/rv-brs-test-suite/573824669a8513cda83aac2c06b3d7a250cb2492/brsi/config/BRSI_extd_run.seq -------------------------------------------------------------------------------- /brsi/config/BRSI_manual.seq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/rv-brs-test-suite/573824669a8513cda83aac2c06b3d7a250cb2492/brsi/config/BRSI_manual.seq -------------------------------------------------------------------------------- /brsi/config/EfiCompliant_BRSI.ini: -------------------------------------------------------------------------------- 1 | ## @file 2 | # 3 | # Copyright 2006 - 2019 Unified EFI, Inc.
4 | # Copyright (c) 2010 - 2019, 2023 Intel Corporation. All rights reserved.
5 | # 6 | # This program and the accompanying materials 7 | # are licensed and made available under the terms and conditions of the BSD License 8 | # which accompanies this distribution. The full text of the license may be found at 9 | # http://opensource.org/licenses/bsd-license.php 10 | # 11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 | # 14 | ## 15 | #/*++ 16 | # 17 | # Module Name: 18 | # 19 | # EfiCompliant.ini 20 | # 21 | # Abstract: 22 | # 23 | # Configuration file for EFI compliant testing. 24 | # 25 | # Notes: 26 | # 27 | ### [Test Configuration Specific] 28 | # 29 | # GEN_CONFIG_INI_FILE_ON = 30 | # 31 | # IGNORE_COMPLIANT_TEST_CSV = 32 | # 33 | ### [Platform Specific] 34 | # 35 | # ConsoleDevices = 36 | # 37 | # HiiConfigSupport = 38 | # 39 | # HiiFontSupport = 40 | # 41 | # GraphicalConsoleDevices = 42 | # 43 | # PointerDevices = 44 | # 45 | # BootFromDiskDevices = 46 | # 47 | # BootFromNetworkDevices = 48 | # 49 | # ValidateBootImageThruNet = 50 | # 51 | # UartDevices = 52 | # 53 | # PciBusSupport = 54 | # 55 | # UsbBusSupport = 56 | # 57 | # NVMExpressPassThru = 58 | # 59 | # BootFromNVMe = 60 | # 61 | # ExtScsiPassThru = 62 | # 63 | # DebugSupport = 64 | # 65 | # PlatformDriverOverride = 66 | # 67 | # AtaPassThru = 68 | # 69 | # UEFIIPv4Support = 70 | # 71 | # BootFromScsi = 72 | # 73 | # ExtScsiPassThruSupport = 74 | # 75 | # BootFromIScsi = 76 | # 77 | # EBCSupport = 80 | # 81 | # UEFIIPv6Support = 82 | # 83 | # VLANSupport = 84 | # 85 | # DNS4Support = 86 | # 87 | # DNS6Support = 88 | # 89 | # TLSSupport = 90 | # 91 | # HTTPSupport = 92 | # 93 | # EAPSupport = 94 | # 95 | # BlueToothClassicSupport = 96 | # 97 | # BlueToothLESupport = 98 | # 99 | # IPSecSupport = 100 | # 101 | #--*/ 102 | [Test Configuration Specific] 103 | GEN_CONFIG_INI_FILE_ON = yes 104 | IGNORE_COMPLIANT_TEST_CSV = no 105 | 106 | [Platform Specific] 107 | 108 | ConsoleDevices = yes 109 | HiiConfigSupport = yes 110 | HiiFontSupport = yes 111 | GraphicalConsoleDevices = yes 112 | PointerDevices = no 113 | BootFromDiskDevices = yes 114 | BootFromNetworkDevices = yes 115 | ValidateBootImageThruNet = no 116 | UartDevices = yes 117 | PciBusSupport = yes 118 | UsbBusSupport = yes 119 | NVMExpressPassThru = no 120 | BootFromNVMe = no 121 | ExtScsiPassThru = no 122 | DebugSupport = no 123 | PlatformDriverOverride = no 124 | AtaPassThru = no 125 | UEFIIPv4Support = yes 126 | BootFromScsi = no 127 | ExtScsiPassThruSupport = no 128 | BootFromIScsi = no 129 | EBCSupport = no 130 | UEFIIPv6Support = no 131 | VLANSupport = no 132 | DNS4Support = no 133 | DNS6Support = no 134 | TLSSupport = no 135 | HTTPSupport = yes 136 | EAPSupport = no 137 | BlueToothClassicSupport = no 138 | BlueToothLESupport = no 139 | IPSecSupport = no 140 | -------------------------------------------------------------------------------- /brsi/config/buildroot_defconfig: -------------------------------------------------------------------------------- 1 | # Architecture 2 | BR2_riscv=y 3 | BR2_RISCV_64=y 4 | 5 | # Toolchain 6 | BR2_TOOLCHAIN_BUILDROOT_GLIBC=y 7 | 8 | # System 9 | BR2_SYSTEM_DHCP="eth0" 10 | 11 | # FWTS package 12 | BR2_PACKAGE_FWTS=y 13 | BR2_PACKAGE_FWTS_EFI_RUNTIME_MODULE=y 14 | 15 | # Filesystem 16 | BR2_TARGET_ROOTFS_CPIO=y 17 | 18 | # Image 19 | #BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh" 20 | #BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)" 21 | 22 | # Linux headers same as kernel 23 | BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y 24 | 25 | # Kernel 26 | BR2_LINUX_KERNEL=y 27 | BR2_LINUX_KERNEL_CUSTOM_VERSION=y 28 | BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.24" 29 | BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y 30 | BR2_LINUX_KERNEL_IMAGE=y 31 | 32 | # Bootloader 33 | BR2_TARGET_OPENSBI=y 34 | BR2_TARGET_OPENSBI_PLAT="generic" 35 | 36 | # host-qemu for gitlab testing 37 | BR2_PACKAGE_HOST_QEMU=y 38 | BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y 39 | -------------------------------------------------------------------------------- /brsi/config/debug_dump.nsh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # Redistributions of source code must retain the above copyright notice, this 7 | # list of conditions and the following disclaimer. 8 | # 9 | # Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # 13 | # Neither the name of ARM nor the names of its contributors may be used 14 | # to endorse or promote products derived from this software without specific 15 | # prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | echo -off 30 | 31 | for %m in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 32 | if exist FS%m:\acs_results then 33 | FS%m: 34 | cd FS%m:\acs_results 35 | if not exist uefi_dump then 36 | mkdir uefi_dump 37 | endif 38 | cd uefi_dump 39 | echo "Starting UEFI Debug dump" 40 | connect -r 41 | pci > pci.log 42 | drivers > drivers.log 43 | devices > devices.log 44 | dmpstore -all > dmpstore.log 45 | dh -d > dh.log 46 | memmap > memmap.log 47 | bcfg boot dump > bcfg.log 48 | map -r > map.log 49 | devtree > devtree.log 50 | ver > uefi_version.log 51 | ifconfig -l > ifconfig.log 52 | dmem > dmem.log 53 | 54 | for %n in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 55 | if exist FS%n:\EFI\BOOT\bsa\ir_bsa.flag then 56 | #IR Specific ->DT 57 | else 58 | smbiosview > smbiosview.log 59 | acpiview -l > acpiview_l.log 60 | acpiview -r 2 > acpiview_r.log 61 | acpiview > acpiview.log 62 | acpiview -d -s acpiview_d 63 | goto Done 64 | endif 65 | goto Done 66 | endfor 67 | endif 68 | endfor 69 | :Done 70 | -------------------------------------------------------------------------------- /brsi/config/grub-buildroot.cfg: -------------------------------------------------------------------------------- 1 | set timeout=5 2 | set default="BRS test suite" 3 | set fallback=0 4 | set debug="loader,mm" 5 | set term="vt100" 6 | 7 | menuentry 'Linux Buildroot' { 8 | linux /Image rootwait verbose console=ttyS0 earlycon earlyprintk 9 | initrd /ramdisk-buildroot.img 10 | } 11 | menuentry 'BRS test suite' { 12 | chainloader /EFI/BOOT/Shell.efi 13 | } 14 | -------------------------------------------------------------------------------- /brsi/config/grub_prefix.cfg: -------------------------------------------------------------------------------- 1 | set prefix=($root)/ 2 | -------------------------------------------------------------------------------- /brsi/config/startup.nsh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021-2023, ARM Limited and Contributors. All rights reserved. 2 | # Copyright (c) 2023 Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | echo -off 31 | connect -r 32 | 33 | for %i in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 34 | if exist FS%i:\EFI\BOOT\brs\SctStartup.nsh then 35 | FS%i:\EFI\BOOT\brs\SctStartup.nsh %1 36 | goto Donebrs 37 | endif 38 | endfor 39 | :Donebrs 40 | 41 | for %e in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 42 | if exist FS%e:\acs_results then 43 | FS%e: 44 | cd FS%e:\acs_results 45 | if not exist app_output then 46 | mkdir app_output 47 | endif 48 | cd app_output 49 | for %q in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 50 | if exist FS%q:\EFI\BOOT\app\CapsuleApp.efi then 51 | echo "Running CapsuleApp" 52 | FS%q:\EFI\BOOT\app\CapsuleApp.efi -P > CapsuleApp_FMP_protocol_info.log 53 | FS%q:\EFI\BOOT\app\CapsuleApp.efi -E > CapsuleApp_ESRT_table_info.log 54 | goto DoneApp 55 | endif 56 | endfor 57 | endif 58 | endfor 59 | :DoneApp 60 | 61 | for %l in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 62 | if exist FS%l:\Image and exist FS%l:\ramdisk-buildroot.img then 63 | FS%l: 64 | cd FS%l:\ 65 | Image initrd=\ramdisk-buildroot.img console=ttyS0 earlycon earlyprintk 66 | endif 67 | endfor 68 | echo "Image not found" 69 | -------------------------------------------------------------------------------- /brsi/prebuilt_images/brs_live_image.img.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/rv-brs-test-suite/573824669a8513cda83aac2c06b3d7a250cb2492/brsi/prebuilt_images/brs_live_image.img.xz -------------------------------------------------------------------------------- /brsi/prebuilt_images/uefi_flash1_23.04.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/rv-brs-test-suite/573824669a8513cda83aac2c06b3d7a250cb2492/brsi/prebuilt_images/uefi_flash1_23.04.img -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/build_brsi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # 12 | # Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # Neither the name of ARM nor the names of its contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | # POSSIBILITY OF SUCH DAMAGE. 31 | 32 | TOP_DIR=`pwd` 33 | 34 | create_scripts_link() 35 | { 36 | ln -s $TOP_DIR/../../common/scripts/framework.sh $TOP_DIR/build-scripts/framework.sh 37 | ln -s $TOP_DIR/../../common/scripts/parse_params.sh $TOP_DIR/build-scripts/parse_params.sh 38 | ln -s $TOP_DIR/../../common/scripts/build-sct.sh $TOP_DIR/build-scripts/build-sct.sh 39 | ln -s $TOP_DIR/../../common/scripts/build-sbi-test.sh $TOP_DIR/build-scripts/build-sbi-test.sh 40 | ln -s $TOP_DIR/../../common/scripts/build-uefi-apps.sh $TOP_DIR/build-scripts/build-uefi-apps.sh 41 | ln -s $TOP_DIR/../../common/scripts/build-fwts.sh $TOP_DIR/build-scripts/build-fwts.sh 42 | ln -s $TOP_DIR/../../common/scripts/start_qemu.sh $TOP_DIR/build-scripts/start_qemu.sh 43 | ln -s $TOP_DIR/../../common/scripts/build-grub.sh $TOP_DIR/build-scripts/build-grub.sh 44 | ln -s $TOP_DIR/../../common/scripts/build-linux.sh $TOP_DIR/build-scripts/build-linux.sh 45 | ln -s $TOP_DIR/../../common/scripts/build-buildroot.sh $TOP_DIR/build-scripts/build-buildroot.sh 46 | } 47 | 48 | init_dir() 49 | { 50 | mkdir -p $TOP_DIR/build-scripts/config 51 | cp -r $TOP_DIR/../config/* $TOP_DIR/build-scripts/config/ 52 | } 53 | 54 | create_scripts_link 55 | init_dir 56 | 57 | source ./build-scripts/build-sct.sh 58 | source ./build-scripts/build-sbi-test.sh 59 | source ./build-scripts/build-grub.sh 60 | source ./build-scripts/build-linux.sh 61 | source ./build-scripts/build-buildroot.sh 62 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/build_image.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021-2023, ARM Limited and Contributors. All rights reserved. 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # 12 | # Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # Neither the name of ARM nor the names of its contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | # POSSIBILITY OF SUCH DAMAGE. 31 | 32 | #------------------------------------------ 33 | # Generate the disk image for busybox boot 34 | #------------------------------------------ 35 | 36 | 37 | #variables for image generation 38 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 39 | TOP_DIR=`pwd` 40 | PLATDIR=${TOP_DIR}/output 41 | OUTDIR=${PLATDIR} 42 | GRUB_BUILDROOT_CONFIG_FILE=${TOP_DIR}/../config/grub-buildroot.cfg 43 | EFI_CONFIG_FILE=${TOP_DIR}/../../brsi/config/startup.nsh 44 | SCT_STARTUP_FILE=${TOP_DIR}/../../brsi/config/BRSIStartup.nsh 45 | DEBUG_CONFIG_FILE=${TOP_DIR}/../../brsi/config/debug_dump.nsh 46 | BLOCK_SIZE=512 47 | SEC_PER_MB=$((1024*2)) 48 | GRUB_PATH=grub 49 | UEFI_SHELL_PATH=edk2-test/uefi-sct/Build/Shell/DEBUG_GCC5/RISCV64/ShellPkg/Application/Shell/Shell/OUTPUT 50 | SCT_PATH=edk2-test/uefi-sct/RISCV64_SCT 51 | UEFI_APPS_PATH=${TOP_DIR}/edk2-test/uefi-sct/Build/MdeModule/DEBUG_GCC5/RISCV64/MdeModulePkg/Application/CapsuleApp/CapsuleApp/OUTPUT 52 | 53 | create_cfgfiles () 54 | { 55 | local fatpart_name="$1" 56 | 57 | mcopy -i $fatpart_name -o ${GRUB_BUILDROOT_CONFIG_FILE} ::/grub.cfg 58 | mcopy -i $fatpart_name -o ${SCT_STARTUP_FILE} ::/EFI/BOOT/brs/ 59 | 60 | mcopy -i $fatpart_name -o ${EFI_CONFIG_FILE} ::/EFI/BOOT/ 61 | mcopy -i $fatpart_name -o ${DEBUG_CONFIG_FILE} ::/EFI/BOOT/debug/ 62 | 63 | } 64 | 65 | create_fatpart () 66 | { 67 | local fatpart_name="$1" #Name of the FAT partition disk image 68 | local fatpart_size="$2" #FAT partition size (in 512-byte blocks) 69 | 70 | dd if=/dev/zero of=$fatpart_name bs=$BLOCK_SIZE count=$fatpart_size 71 | mkfs.vfat $fatpart_name -n $fatpart_name 72 | mmd -i $fatpart_name ::/EFI 73 | mmd -i $fatpart_name ::/EFI/BOOT 74 | mmd -i $fatpart_name ::/grub 75 | 76 | mmd -i $fatpart_name ::/EFI/BOOT/brs 77 | mmd -i $fatpart_name ::/EFI/BOOT/debug 78 | mmd -i $fatpart_name ::/EFI/BOOT/app 79 | 80 | mcopy -i $fatpart_name bootriscv64.efi ::/EFI/BOOT 81 | mcopy -i $fatpart_name Shell.efi ::/EFI/BOOT 82 | mcopy -i $fatpart_name $OUTDIR/Image ::/ 83 | mcopy -i $fatpart_name $PLATDIR/ramdisk-buildroot.img ::/ 84 | 85 | mcopy -s -i $fatpart_name SCT/* ::/EFI/BOOT/brs 86 | # mcopy -i $fatpart_name ${UEFI_APPS_PATH}/CapsuleApp.efi ::/EFI/BOOT/app 87 | 88 | echo "FAT partition image created" 89 | } 90 | 91 | create_fatpart2 () 92 | { 93 | local fatpart_name="$1" #Name of the FAT partition disk image 94 | local fatpart_size="$2" #FAT partition size (in 512-byte blocks) 95 | 96 | dd if=/dev/zero of=$fatpart_name bs=$BLOCK_SIZE count=$fatpart_size 97 | mkfs.vfat $fatpart_name -n $fatpart_name 98 | mmd -i $fatpart_name ::/acs_results 99 | echo "FAT partition 2 image created" 100 | } 101 | 102 | create_diskimage () 103 | { 104 | local image_name="$1" 105 | local part_start="$2" 106 | local fatpart_size="$3" 107 | local fatpart2_size="$4" 108 | 109 | (echo n; echo 1; echo $part_start; echo +$((fatpart_size-1));\ 110 | echo 0700; echo w; echo y) | gdisk $image_name 111 | (echo n; echo 2; echo $((part_start+fatpart_size)); echo +$((fatpart2_size-1));\ 112 | echo 0700; echo w; echo y) | gdisk $image_name 113 | } 114 | 115 | prepare_disk_image () 116 | { 117 | echo 118 | echo 119 | echo "-------------------------------------" 120 | echo "Preparing disk image for busybox boot" 121 | echo "-------------------------------------" 122 | 123 | IMG_BB=brs_live_image.img 124 | echo -e "\e[1;32m Build BRS Live Image at $PLATDIR/$IMG_BB \e[0m" 125 | 126 | pushd $TOP_DIR/$GRUB_PATH/output 127 | 128 | local FAT_SIZE_MB=512 129 | local FAT2_SIZE_MB=128 130 | local PART_START=$((1*SEC_PER_MB)) 131 | local FAT_SIZE=$((FAT_SIZE_MB*SEC_PER_MB)) 132 | local FAT2_SIZE=$((FAT2_SIZE_MB*SEC_PER_MB)) 133 | 134 | rm -f $PLATDIR/$IMG_BB 135 | mkdir -p $PLATDIR 136 | cp grubriscv64.efi bootriscv64.efi 137 | cp $TOP_DIR/$UEFI_SHELL_PATH/Shell.efi Shell.efi 138 | 139 | cp -Tr $TOP_DIR/$SCT_PATH/ SCT 140 | grep -q -F 'mtools_skip_check=1' ~/.mtoolsrc || echo "mtools_skip_check=1" >> ~/.mtoolsrc 141 | 142 | #Package images for Busybox 143 | rm -f $IMG_BB 144 | dd if=/dev/zero of=part_table bs=$BLOCK_SIZE count=$PART_START 145 | 146 | #Space for partition table at the top 147 | cat part_table > $IMG_BB 148 | 149 | #Create fat partition 150 | create_fatpart "BOOT" $FAT_SIZE 151 | create_cfgfiles "BOOT" 152 | cat BOOT >> $IMG_BB 153 | 154 | #Result partition 155 | create_fatpart2 "RESULT" $FAT2_SIZE 156 | cat RESULT >> $IMG_BB 157 | 158 | #Space for backup partition table at the bottom (1M) 159 | cat part_table >> $IMG_BB 160 | 161 | # create disk image and copy into output folder 162 | create_diskimage $IMG_BB $PART_START $FAT_SIZE $FAT2_SIZE 163 | cp $IMG_BB $PLATDIR 164 | 165 | #remove intermediate files 166 | rm -f part_table 167 | rm -f BOOT 168 | rm -f RESULT 169 | 170 | echo "Compressing the image : $PLATDIR/$IMG_BB" 171 | xz -z $PLATDIR/$IMG_BB 172 | 173 | if [ -f $PLATDIR/$IMG_BB.xz ]; then 174 | echo "Completed preparation of disk image for busybox boot" 175 | echo "Image path : $PLATDIR/$IMG_BB.xz" 176 | fi 177 | echo "----------------------------------------------------" 178 | } 179 | exit_fun() { 180 | exit 1 # Exit script 181 | } 182 | 183 | #prepare the disk image 184 | prepare_disk_image 185 | 186 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/config/BRSIStartup.nsh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, 2023 ARM Limited and Contributors. All rights reserved. 2 | # Copyright (c) 2023 Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | echo -off 31 | 32 | for %i in 0 1 2 3 4 5 6 7 8 9 A B C D E F 33 | if exist FS%i:\EFI\BOOT\brs\SCT then 34 | # 35 | # Found EFI SCT harness 36 | # 37 | FS%i: 38 | cd FS%i:\EFI\BOOT\brs\SCT 39 | echo Press any key to stop the EFI SCT running 40 | stallforkey.efi 5 41 | if %lasterror% == 0 then 42 | goto Done 43 | endif 44 | for %j in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 45 | if exists FS%j:\acs_results\ then 46 | if exists FS%j:\acs_results\sct_results then 47 | 48 | #Check if SCT run has already completed 49 | if exist FS%j:\acs_results\sct_results\Overall\Summary.log then 50 | echo SCT has completed run. Press any key to start SCT execution from the beginning. WARNING: Ensure you have backed up the existing logs. 51 | stallforkey.efi 5 52 | if %lasterror% == 0 then 53 | #Backup the existing logs 54 | rm -q FS%j:\acs_results\sct_results_previous_run 55 | mkdir FS%j:\acs_results\sct_results_previous_run 56 | cp -r FS%j:\acs_results\sct_results FS%j:\acs_results\sct_results_previous_run 57 | rm -q FS%j:\acs_results\sct_results 58 | goto StartSCT 59 | else 60 | goto Done 61 | endif 62 | endif 63 | 64 | if exist FS%i:\EFI\BOOT\brs\SCT\.passive.mode then 65 | if exist FS%i:\EFI\BOOT\brs\SCT\.verbose.mode then 66 | Sct -c -p mnp -v 67 | else 68 | Sct -c -p mnp 69 | endif 70 | else 71 | if exist FS%i:\EFI\BOOT\brs\SCT\.verbose.mode then 72 | Sct -c -v 73 | else 74 | Sct -c 75 | endif 76 | 77 | #SCT execution has finished. Copy the logs to acs_results 78 | if exist FS%j:\acs_results\sct_results\ then 79 | if exist FS%i:\EFI\BOOT\brs\SCT\Overall then 80 | cp -r FS%i:\EFI\BOOT\brs\SCT\Overall FS%j:\acs_results\sct_results\ 81 | endif 82 | if exist FS%i:\EFI\BOOT\brs\SCT\Dependency\EfiCompliantBBTest then 83 | cp -r FS%i:\EFI\BOOT\brs\SCT\Dependency\EfiCompliantBBTest FS%j:\acs_results\sct_results\ 84 | endif 85 | if exist FS%i:\EFI\BOOT\brs\SCT\Sequence then 86 | cp -r FS%i:\EFI\BOOT\brs\SCT\Sequence FS%j:\acs_results\sct_results\ 87 | endif 88 | 89 | #Restart to avoid an impact of running SCT tests on rest of the suites 90 | echo Reset the system ... 91 | reset 92 | endif 93 | #goto Done 94 | endif 95 | else 96 | :StartSCT 97 | FS%j: 98 | cd FS%j:\acs_results 99 | mkdir sct_results 100 | FS%i: 101 | cd FS%i:\EFI\BOOT\brs\SCT 102 | if %1 == sct_extd then 103 | echo "Starting extended run of SCT" 104 | Sct -s BRSI_extd_run.seq 105 | else 106 | Sct -s BRSI.seq 107 | endif 108 | goto Done 109 | endif 110 | endif 111 | endfor 112 | endif 113 | endfor 114 | 115 | :Done 116 | 117 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/config/debug_dump.nsh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # Redistributions of source code must retain the above copyright notice, this 7 | # list of conditions and the following disclaimer. 8 | # 9 | # Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # 13 | # Neither the name of ARM nor the names of its contributors may be used 14 | # to endorse or promote products derived from this software without specific 15 | # prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | echo -off 30 | 31 | for %m in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 32 | if exist FS%m:\acs_results then 33 | FS%m: 34 | cd FS%m:\acs_results 35 | if not exist uefi_dump then 36 | mkdir uefi_dump 37 | endif 38 | cd uefi_dump 39 | echo "Starting UEFI Debug dump" 40 | connect -r 41 | pci > pci.log 42 | drivers > drivers.log 43 | devices > devices.log 44 | dmpstore -all > dmpstore.log 45 | dh -d > dh.log 46 | memmap > memmap.log 47 | bcfg boot dump > bcfg.log 48 | map -r > map.log 49 | devtree > devtree.log 50 | ver > uefi_version.log 51 | ifconfig -l > ifconfig.log 52 | dmem > dmem.log 53 | 54 | for %n in 0 1 2 3 4 5 6 7 8 9 A B C D E F then 55 | if exist FS%n:\EFI\BOOT\bsa\ir_bsa.flag then 56 | #IR Specific ->DT 57 | else 58 | smbiosview > smbiosview.log 59 | acpiview -l > acpiview_l.log 60 | acpiview -r 2 > acpiview_r.log 61 | acpiview > acpiview.log 62 | acpiview -d -s acpiview_d 63 | goto Done 64 | endif 65 | goto Done 66 | endfor 67 | endif 68 | endfor 69 | :Done 70 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/get_brsi_source.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # 12 | # Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # Neither the name of ARM nor the names of its contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | # POSSIBILITY OF SUCH DAMAGE. 31 | 32 | TOP_DIR=`pwd` 33 | 34 | create_scripts_link() 35 | { 36 | ln -s $TOP_DIR/../../common/scripts/get_source.sh $TOP_DIR/build-scripts/get_source.sh 37 | } 38 | 39 | create_scripts_link 40 | source ./build-scripts/get_source.sh 41 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/get_efi_offset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################################ 4 | # Script: get_efi_offset.sh 5 | # 6 | # Description: 7 | # This script is used to extract the load address of an EFI file for GDB 8 | # debugging purposes. It assumes that you have an example EFI file which you 9 | # want to debug. 10 | # 11 | # Usage: 12 | # ./get_efi_offset.sh 13 | # 14 | # Arguments: 15 | # : The path to the edk2 build directory. 16 | # : The path to the edk2-test build directory. 17 | # : Qemu log with uefi debug enabled. 18 | # : Gdb script file generated. 19 | # 20 | # Notes: 21 | # - Ensure that you have the the specified edk2 and edk2-test build path is the same used in qemu. 22 | ################################################################################ 23 | 24 | 25 | # Function to print script usage 26 | print_usage() { 27 | echo "Usage: $0 " 28 | } 29 | 30 | # Check if all required arguments are provided 31 | if [ $# -ne 4 ]; then 32 | print_usage 33 | exit 1 34 | fi 35 | 36 | edk2_build_path="$1" 37 | edk2_test_build_path="$2" 38 | qemu_debug_log="$3" 39 | output_filename="$4" 40 | 41 | # Check if edk2 build path, edk2-test build path, qemu debug log, and output filename exist 42 | if [ ! -d "$edk2_build_path" ] || [ ! -d "$edk2_test_build_path" ] || [ ! -f "$qemu_debug_log" ] || [ -e "$output_filename" ]; then 43 | if [ ! -d "$edk2_build_path" ]; then 44 | echo "Error: EDK2 build path '$edk2_build_path' does not exist." 45 | fi 46 | 47 | if [ ! -d "$edk2_test_build_path" ]; then 48 | echo "Error: EDK2-test build path '$edk2_test_build_path' does not exist." 49 | fi 50 | 51 | if [ ! -f "$qemu_debug_log" ]; then 52 | echo "Error: QEMU debug log file '$qemu_debug_log' does not exist." 53 | fi 54 | 55 | if [ -e "$output_filename" ]; then 56 | echo "Warning: Output filename '$output_filename' already exists." 57 | read -p "Do you want to overwrite it? (y/n) " choice 58 | if [ "$choice" != "y" ] && [ "$choice" != "Y" ]; then 59 | echo "Exiting script." 60 | exit 0 61 | else 62 | > $output_filename 63 | fi 64 | fi 65 | fi 66 | 67 | # Download preinfo repo if it doesn't exist 68 | if [ ! -d "peinfo" ]; then 69 | git clone https://github.com/retrage/peinfo.git || { echo "Failed to download preinfo repo."; exit 1; } 70 | fi 71 | 72 | # Check if peinfo executable exists 73 | if [ ! -x "peinfo/peinfo" ]; then 74 | # Build peinfo 75 | cd peinfo || { echo "Failed to change directory to 'peinfo'."; exit 1; } 76 | make || { echo "Failed to build peinfo."; exit 1; } 77 | cd .. || { echo "Failed to change directory."; exit 1; } 78 | fi 79 | PEINFO="peinfo/peinfo" 80 | cat ${qemu_debug_log} | grep -a Loading | grep -i efi | tac | while read LINE; do 81 | BASE="`echo ${LINE} | cut -d " " -f4`" 82 | NAME="`echo ${LINE} | cut -d " " -f6 | tr -d "[:cntrl:]"`" 83 | if [ -e ${edk2_build_path}/${NAME} ];then 84 | efi_file_path=$edk2_build_path 85 | elif [ -e ${edk2_test_build_path}/${NAME} ];then 86 | efi_file_path=$edk2_test_build_path 87 | else 88 | echo "${edk2_test_build_path}/${NAME} for ${edk2_build_path}/${NAME} not exist!" 1>&2 89 | continue 90 | fi 91 | ADDR="`${PEINFO} ${efi_file_path}/${NAME} \ 92 | | grep -A 5 text | grep VirtualAddress | cut -d " " -f2`" 93 | TEXT="`python -c "print(hex(${BASE} + ${ADDR}))"`" 94 | SYMS="`echo ${NAME} | sed -e "s/\.efi/\.debug/g"`" 95 | # Check if line exists in the output file and update or append accordingly 96 | grep -qF "add-symbol-file ${efi_file_path}/${SYMS}" "$output_filename" && \ 97 | sed -i 's/add-symbol-file ${efi_file_path}\/${SYMS} .*/add-symbol-file ${efi_file_path}\/${SYMS} ${TEXT}/' "$output_filename" || \ 98 | echo "add-symbol-file ${efi_file_path}/${SYMS} ${TEXT}" >> "$output_filename" 99 | 100 | done 101 | echo "update gdb script $output_filename." 102 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/sct_result_parser.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #!/bin/bash 3 | # 4 | # Copyright (c) 2024 Intel Corporation 5 | # 6 | # This program and the accompanying materials 7 | # are licensed and made available under the terms and conditions of the BSD License 8 | # which accompanies this distribution. The full text of the license may be found at 9 | # http://opensource.org/licenses/bsd-license.php 10 | # 11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 | # 14 | ## 15 | 16 | # Initialize associative arrays for storing test cases and counts 17 | declare -A testcases 18 | declare -A status_counts=( 19 | ) 20 | usage() { 21 | echo "Usage: $0 -l LOG_PATH -s SKIP_PATH [-o OUTPUT_PATH]" 22 | echo " -l LOG_PATH Path to the log summary file." 23 | echo " -s SKIP_PATH Path to the skipped case list file." 24 | echo " -o OUTPUT_PATH Path to the output result file (optional, default: ./result.txt)." 25 | echo " -m: Use this option to output the result in Markdown format." 26 | echo "" 27 | echo "Example:" 28 | echo " $0 -l FSx:/acs_results/sct_results/Overall/Summary.log \\" 29 | echo " -s FS(x):/EFI/BOOT/brs/SCT/Data/SkippedCase.ini \\" 30 | echo " -o ./result.txt" 31 | exit 1 32 | } 33 | # Function to process log file 34 | process_log_file() { 35 | echo "Processing log file: $1" 36 | while IFS= read -r line; do 37 | if [[ $line =~ (.*):\ \[(.*)\] ]]; then 38 | testcase_name="${BASH_REMATCH[1]}" 39 | status="[${BASH_REMATCH[2]}]" 40 | # Add to testcases array if not already present 41 | if [[ -z ${testcases["$testcase_name:$status"]} ]]; then 42 | testcases["$testcase_name:$status"]=1 43 | ((status_counts["$status"]++)) 44 | fi 45 | fi 46 | done < "$1" 47 | } 48 | 49 | # Function to process skip file 50 | process_skip_file() { 51 | echo "Processing skip file: $1" 52 | dos2unix -f "$1" 53 | while IFS= read -r line; do 54 | if [[ $line =~ CaseName=(.*) ]]; then 55 | testcase_name="${BASH_REMATCH[1]}" 56 | status="[SKIP]" 57 | # Add to testcases array if not already present 58 | if [[ -z ${testcases["$testcase_name:$status"]} ]]; then 59 | testcases["$testcase_name:$status"]=1 60 | ((status_counts["$status"]++)) 61 | fi 62 | fi 63 | done < "$1" 64 | } 65 | 66 | result_file="result.txt" 67 | markdown=false 68 | 69 | # Parse command-line arguments 70 | while getopts "l:s:o:m" opt; do 71 | case $opt in 72 | l) process_log_file "$OPTARG" ;; 73 | s) process_skip_file "$OPTARG" ;; 74 | o) result_file="$OPTARG" ;; 75 | m) markdown=true ;; 76 | \?) usage ;; 77 | :) usage ;; 78 | esac 79 | done 80 | 81 | # Calculate total number of test cases 82 | total=0 83 | for count in "${status_counts[@]}"; do 84 | ((total+=count)) 85 | done 86 | 87 | # Clear the result file or create it if it doesn't exist 88 | > "$result_file" 89 | 90 | { 91 | echo "SCT Summary" 92 | echo "" 93 | echo "Result Test(s)" 94 | for status in "${!status_counts[@]}"; do 95 | percentage=$(printf "%.2f%%" "$(bc <<< "scale=4; (${status_counts[$status]}*100)/$total")") 96 | printf "%-25s %5s (%6s)\n" "$status:" "${status_counts[$status]}" "$percentage" 97 | done 98 | echo "" 99 | } | tee "$result_file" 100 | # Output detailed test case list by status 101 | status_order=([FAILED] [NOT SUPPORTED] [SKIP] [PASSED] [PASSED WITH WARNINGS]) 102 | 103 | if $markdown; then 104 | echo "| Testcase Status |" >> "$result_file" 105 | echo "| --------------- |" >> "$result_file" 106 | else 107 | for status in "${status_order[@]}"; do 108 | echo "$status:" >> "$result_file" 109 | done 110 | fi 111 | 112 | for status in "${status_order[@]}"; do 113 | for testcase in "${!testcases[@]}"; do 114 | if [[ $testcase == *":$status" ]]; then 115 | # Remove the status from the testcase name and append to the file 116 | if $markdown; then 117 | echo "| ${testcase%:$status} |" >> "$result_file" 118 | else 119 | echo "${testcase%:$status}" >> "$result_file" 120 | fi 121 | fi 122 | done 123 | if ! $markdown; then 124 | echo "" >> "$result_file" 125 | fi 126 | done 127 | -------------------------------------------------------------------------------- /brsi/scripts/build-scripts/start_qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2023 Intel Corporation 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # Redistributions of source code must retain the above copyright notice, this 9 | # list of conditions and the following disclaimer. 10 | # 11 | # Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # Neither the name of ARM nor the names of its contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | TOP_DIR=`pwd` 32 | UEFI_BUILD_MODE=RELEASE 33 | UEFI_TOOLCHAIN=GCC5 34 | QEMU_SRC_VERSION=riscv_acpi_b2_v7 35 | 36 | get_qemu_src() 37 | { 38 | if [ ! -d "$TOP_DIR/qemu" ];then 39 | echo "Downloading qemu. TAG : $QEMU_SRC_VERSION" 40 | git clone --single-branch \ 41 | --branch riscv_acpi_b2_v7 https://github.com/vlsunil/qemu.git qemu 42 | pushd $TOP_DIR/qemu 43 | git checkout 15ecd5f3774b63a5893adb0c0ff657a9b316cb56 44 | git submodule update --init --recursive 45 | popd 46 | fi 47 | } 48 | 49 | get_opensbi_src() 50 | { 51 | if [ ! -d "$TOP_DIR/opensbi" ];then 52 | echo "Downloading opensbi." 53 | git clone --depth 1 --single-branch \ 54 | --branch v1.3.1 https://github.com/riscv-software-src/opensbi.git 55 | pushd $TOP_DIR/opensbi 56 | git checkout 057eb10b6d523540012e6947d5c9f63e95244e94 57 | popd 58 | fi 59 | } 60 | 61 | build_opensbi() 62 | { 63 | if [ -f "$TOP_DIR/opensbi/build/platform/generic/firmware/fw_dynamic.bin" ];then 64 | echo "skip build opensbi." 65 | else 66 | echo "build opensbi..." 67 | pushd $TOP_DIR/opensbi 68 | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=generic 69 | popd 70 | fi 71 | } 72 | 73 | build_edk2() 74 | { 75 | if [ ! -d "$TOP_DIR/edk2" ];then 76 | source ./build-scripts/get_brsi_source.sh 77 | source ./build-scripts/build_brsi.sh 78 | source ./build-scripts/build_image.sh 79 | fi 80 | if [ -f "$TOP_DIR/Build/RiscVVirtQemu/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/FV/RISCV_VIRT_CODE.fd" ];then 81 | echo "skip build edk2." 82 | else 83 | echo "build edk2..." 84 | pushd $TOP_DIR 85 | export GCC5_RISCV64_PREFIX=riscv64-linux-gnu- 86 | export PACKAGES_PATH=$TOP_DIR/edk2 87 | export EDK_TOOLS_PATH=$TOP_DIR/edk2/BaseTools 88 | source edk2/edksetup.sh 89 | make -C edk2/BaseTools clean 90 | make -C edk2/BaseTools 91 | make -C edk2/BaseTools/Source/C 92 | source edk2/edksetup.sh BaseTools 93 | build -a RISCV64 --buildtarget ${UEFI_BUILD_MODE} -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc -t ${UEFI_TOOLCHAIN} 94 | truncate -s 32M Build/RiscVVirtQemu/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/FV/RISCV_VIRT_CODE.fd 95 | truncate -s 32M Build/RiscVVirtQemu/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/FV/RISCV_VIRT_VARS.fd 96 | popd 97 | fi 98 | } 99 | 100 | build_qemu() 101 | { 102 | if [ -f "$TOP_DIR/qemu/build/qemu-system-riscv64" ];then 103 | echo "skip build qemu-riscv64" 104 | else 105 | echo "build qemu-riscv64..." 106 | pushd $TOP_DIR/qemu 107 | ./configure --enable-slirp --enable-debug --target-list=riscv64-softmmu 108 | make -j `nproc` 109 | popd 110 | fi 111 | } 112 | 113 | start_qemu() 114 | { 115 | BRS_IMG=$TOP_DIR/output/brs_live_image.img 116 | BRS_IMG_XZ=$TOP_DIR/output/brs_live_image.img.xz 117 | if [ -e $BRS_IMG_XZ ]; then 118 | echo "decompresing $BRS_IMG_XZ" 119 | xz -d $BRS_IMG_XZ 120 | else 121 | if [ -e $BRS_IMG ];then 122 | echo "find image: $BRS_IMG " 123 | else 124 | echo "Firmware test suite image: $BRS_IMG_XZ does not exist!" 1>&2 125 | exit 1 126 | fi 127 | fi 128 | echo "Starting rv64 qemu... press Ctrl+A, X to exit qemu" 129 | sleep 2 130 | $TOP_DIR/qemu/build/qemu-system-riscv64 -nographic \ 131 | -machine virt,aia=aplic-imsic,pflash0=pflash0,pflash1=pflash1 \ 132 | -cpu rv64 -m 4G -smp 2 \ 133 | -bios $TOP_DIR/opensbi/build/platform/generic/firmware/fw_dynamic.bin \ 134 | -drive file=$BRS_IMG,if=none,format=raw,id=drv1 -device virtio-blk-device,drive=drv1 \ 135 | -blockdev node-name=pflash0,driver=file,read-only=on,filename=$TOP_DIR/Build/RiscVVirtQemu/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/FV/RISCV_VIRT_CODE.fd \ 136 | -blockdev node-name=pflash1,driver=file,filename=$TOP_DIR/Build/RiscVVirtQemu/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/FV/RISCV_VIRT_VARS.fd \ 137 | -device e1000,netdev=net0 \ 138 | -device virtio-gpu-pci \ 139 | -netdev type=user,id=net0 \ 140 | -device qemu-xhci \ 141 | -device usb-mouse \ 142 | -device usb-kbd 143 | } 144 | 145 | sbi_test() 146 | { 147 | BRS_IMG=$TOP_DIR/kvm-unit-tests/riscv/sbi.flat 148 | if [ ! -e $BRS_IMG ]; then 149 | echo "SBI test image: $BRS_IMG does not exist!" 1>&2 150 | exit 1 151 | fi 152 | echo "Starting rv64 qemu... press Ctrl+A, X to exit qemu" 153 | sleep 2 154 | $TOP_DIR/qemu/build/qemu-system-riscv64 -nographic \ 155 | -machine virt,aia=aplic-imsic \ 156 | -cpu rv64 -m 4G -smp 2 \ 157 | -bios $TOP_DIR/opensbi/build/platform/generic/firmware/fw_dynamic.bin \ 158 | -kernel $BRS_IMG 159 | } 160 | get_qemu_src 161 | build_qemu 162 | get_opensbi_src 163 | build_opensbi 164 | 165 | if [ "$#" -eq 0 ]; then 166 | build_edk2 167 | start_qemu 168 | else 169 | # Process the arguments 170 | for arg in "$@" 171 | do 172 | case $arg in 173 | --sbi-test) 174 | sbi_test 175 | shift # Remove --test-sbi from processing 176 | ;; 177 | *) 178 | echo "Incorrect argument provided" 179 | echo "Usage: ./script.sh [--sbi-test]" 180 | exit 1 181 | ;; 182 | esac 183 | done 184 | fi 185 | -------------------------------------------------------------------------------- /common/patches/Update-test-profile-for-MemRead_Func-as-an-example.patch: -------------------------------------------------------------------------------- 1 | From 7d23b28b3216990eafc3619a983659dc345590a8 Mon Sep 17 00:00:00 2001 2 | From: Yin Wang 3 | Date: Tue, 31 Oct 2023 16:08:27 +0800 4 | Subject: [PATCH] Update test profile for MemRead_Func as an example on QEMU 5 | 6 | --- 7 | .../BlackBoxTest/Dependency/Config/PciIoBBTest.ini | 10 +++++----- 8 | 1 file changed, 5 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PciIo/BlackBoxTest/Dependency/Config/PciIoBBTest.ini b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PciIo/BlackBoxTest/Dependency/Config/PciIoBBTest.ini 11 | index 9db53f20..3cc7fe9d 100644 12 | --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PciIo/BlackBoxTest/Dependency/Config/PciIoBBTest.ini 13 | +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PciIo/BlackBoxTest/Dependency/Config/PciIoBBTest.ini 14 | @@ -57,11 +57,11 @@ TargetValue= 15 | AlternateValue= 16 | 17 | [MemRead_Func] 18 | -DevicePath= 19 | -BarIndex= 20 | -AddressOffset= 21 | -Length= 22 | -PciIoWidth= 23 | +DevicePath=Acpi(PNP0A03,0)/Pci(2|0) 24 | +BarIndex=0 25 | +AddressOffset=5c 26 | +Length=4 27 | +PciIoWidth=EfiPciIoWidthUint32 28 | DataUnits= 29 | 30 | [MemWrite_Func] 31 | -- 32 | 2.34.1 33 | 34 | -------------------------------------------------------------------------------- /common/patches/buildroot_enable_busybox_auto_login.patch: -------------------------------------------------------------------------------- 1 | diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk 2 | index 1633ca525d..eb1f867e65 100644 3 | --- a/package/busybox/busybox.mk 4 | +++ b/package/busybox/busybox.mk 5 | @@ -229,18 +229,6 @@ define BUSYBOX_SET_INIT 6 | $(call KCONFIG_ENABLE_OPT,CONFIG_INIT) 7 | endef 8 | 9 | -ifeq ($(BR2_TARGET_GENERIC_GETTY),y) 10 | -define BUSYBOX_SET_GETTY 11 | - $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SYSTEM_GETTY_PORT)::respawn:/sbin/getty -L $(SYSTEM_GETTY_OPTIONS) $(SYSTEM_GETTY_PORT) $(SYSTEM_GETTY_BAUDRATE) $(SYSTEM_GETTY_TERM) #~' \ 12 | - $(TARGET_DIR)/etc/inittab 13 | -endef 14 | -else 15 | -define BUSYBOX_SET_GETTY 16 | - $(SED) '/# GENERIC_SERIAL$$/s~^.*#~#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 #~' $(TARGET_DIR)/etc/inittab 17 | -endef 18 | -endif # BR2_TARGET_GENERIC_GETTY 19 | -BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_SET_GETTY 20 | - 21 | BUSYBOX_TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_ROOT_INITTAB 22 | 23 | endif # BR2_INIT_BUSYBOX 24 | diff --git a/package/busybox/inittab b/package/busybox/inittab 25 | index f2b4df801b..274209bd5c 100644 26 | --- a/package/busybox/inittab 27 | +++ b/package/busybox/inittab 28 | @@ -28,6 +28,10 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr 29 | # now run any rc scripts 30 | ::sysinit:/etc/init.d/rcS 31 | 32 | +::wait:/usr/bin/fwts 33 | +::wait:/bin/cat results.log 34 | +::respawn:-/bin/sh -i 35 | + 36 | # Put a getty on the serial port 37 | #ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL 38 | 39 | -------------------------------------------------------------------------------- /common/patches/buildroot_update_fwts_version.patch: -------------------------------------------------------------------------------- 1 | diff --git a/package/fwts/0001-build-do-not-use-Werror.patch b/package/fwts/0001-build-do-not-use-Werror.patch 2 | deleted file mode 100644 3 | index c6a84537ed..0000000000 4 | --- a/package/fwts/0001-build-do-not-use-Werror.patch 5 | +++ /dev/null 6 | @@ -1,79 +0,0 @@ 7 | -From feb05271b484b158c14611839f968109e9cf3082 Mon Sep 17 00:00:00 2001 8 | -From: Erico Nunes 9 | -Date: Fri, 12 Aug 2016 23:11:56 +0200 10 | -Subject: [PATCH] fwts: do not use -Werror 11 | -MIME-Version: 1.0 12 | -Content-Type: text/plain; charset=UTF-8 13 | -Content-Transfer-Encoding: 8bit 14 | - 15 | -Warnings come and go with various compiler versions, so using -Werror is 16 | -prone to cause build failures with various compiler versions, especially 17 | -newer versions that introduce new warnings. 18 | - 19 | -Remove use of -Werror. 20 | - 21 | -Signed-off-by: Erico Nunes 22 | -[Fabrice: updated for 20.08.00] 23 | -Signed-off-by: Fabrice Fontaine 24 | -[Vincent: rebased onto V21.05.00] 25 | -Signed-off-by: Vincent Stehlé 26 | ---- 27 | - configure.ac | 2 +- 28 | - src/Makefile.am | 2 +- 29 | - src/lib/src/Makefile.am | 2 +- 30 | - src/utilities/Makefile.am | 2 +- 31 | - 4 files changed, 4 insertions(+), 4 deletions(-) 32 | - 33 | -diff --git a/configure.ac b/configure.ac 34 | -index ca2f54e2..ed584abf 100644 35 | ---- a/configure.ac 36 | -+++ b/configure.ac 37 | -@@ -1,5 +1,5 @@ 38 | - AC_INIT([fwts],[0.1],[fwts-devel@lists.ubuntu.com]) 39 | -- AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) 40 | -+ AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) 41 | - m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 42 | - AC_CANONICAL_HOST 43 | - AC_CONFIG_MACRO_DIR([m4]) 44 | -diff --git a/src/Makefile.am b/src/Makefile.am 45 | -index 3bb35e5c..e9fe92fe 100644 46 | ---- a/src/Makefile.am 47 | -+++ b/src/Makefile.am 48 | -@@ -13,7 +13,7 @@ AM_CPPFLAGS = \ 49 | - -I$(top_srcdir)/efi_runtime \ 50 | - -I$(top_srcdir)/smccc_test \ 51 | - -pthread \ 52 | -- -Wall -Werror -Wextra \ 53 | -+ -Wall -Wextra \ 54 | - -Wno-address-of-packed-member \ 55 | - -Wfloat-equal -Wmissing-declarations \ 56 | - -Wno-long-long -Wredundant-decls -Wshadow \ 57 | -diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am 58 | -index d5d53dd7..76c48d4d 100644 59 | ---- a/src/lib/src/Makefile.am 60 | -+++ b/src/lib/src/Makefile.am 61 | -@@ -22,7 +22,7 @@ AM_CPPFLAGS = \ 62 | - -I$(top_srcdir)/src/acpica/source/include \ 63 | - -I$(top_srcdir)/src/acpica/source/compiler \ 64 | - -DDATAROOTDIR=\"$(datarootdir)\" \ 65 | -- -Wall -Werror -Wextra \ 66 | -+ -Wall -Wextra \ 67 | - -Wno-address-of-packed-member 68 | - 69 | - pkglib_LTLIBRARIES = libfwts.la 70 | -diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am 71 | -index de38f070..785975ff 100644 72 | ---- a/src/utilities/Makefile.am 73 | -+++ b/src/utilities/Makefile.am 74 | -@@ -16,7 +16,7 @@ 75 | - # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 76 | - # 77 | - 78 | --AM_CPPFLAGS = -Wall -Werror -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ 79 | -+AM_CPPFLAGS = -Wall -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \ 80 | - -I$(srcdir)/../lib/include 81 | - 82 | - bin_PROGRAMS = kernelscan 83 | --- 84 | -2.36.1 85 | - 86 | diff --git a/package/fwts/Config.in b/package/fwts/Config.in 87 | index 08608d1dd7..110f770e32 100644 88 | --- a/package/fwts/Config.in 89 | +++ b/package/fwts/Config.in 90 | @@ -3,6 +3,7 @@ config BR2_PACKAGE_FWTS_ARCH_SUPPORTS 91 | default y if BR2_aarch64 92 | default y if BR2_arm 93 | default y if BR2_i386 94 | + default y if BR2_riscv 95 | default y if BR2_x86_64 96 | 97 | config BR2_PACKAGE_FWTS 98 | diff --git a/package/fwts/fwts.hash b/package/fwts/fwts.hash 99 | index 8525d47ecb..f73d03f255 100644 100 | --- a/package/fwts/fwts.hash 101 | +++ b/package/fwts/fwts.hash 102 | @@ -1,5 +1,5 @@ 103 | # Hash from: http://fwts.ubuntu.com/release/SHA256SUMS 104 | -sha256 a15e11c42856e9dfcf7ac23ed370618d2777eb996dd7843accf12d45b21b551c fwts-V23.07.00.tar.gz 105 | +sha256 fc00b35f08bea4ac6eb26a48c7a0e2c48e47593ca20c68093cc0d4e00075cf47 fwts-V23.09.00.tar.gz 106 | 107 | # Hash for license file 108 | sha256 b9e44b1f9f65178e037a59a31b051b51dbd6a531d27c8775d3438a6ce53fc874 debian/copyright 109 | diff --git a/package/fwts/fwts.mk b/package/fwts/fwts.mk 110 | index f06609777d..7ffffd053a 100644 111 | --- a/package/fwts/fwts.mk 112 | +++ b/package/fwts/fwts.mk 113 | @@ -4,7 +4,7 @@ 114 | # 115 | ################################################################################ 116 | 117 | -FWTS_VERSION = 23.07.00 118 | +FWTS_VERSION = 23.09.00 119 | FWTS_SOURCE = fwts-V$(FWTS_VERSION).tar.gz 120 | FWTS_SITE = http://fwts.ubuntu.com/release 121 | FWTS_STRIP_COMPONENTS = 0 122 | -------------------------------------------------------------------------------- /common/patches/fwts/0001-lib-Add-fwts_architecture-macro-for-risc-v.patch: -------------------------------------------------------------------------------- 1 | From 63621183bcba22e2c97e7fed0fa5f13b7fe22c80 Mon Sep 17 00:00:00 2001 2 | From: Haibo Xu 3 | Date: Wed, 19 Jul 2023 14:41:22 +0800 4 | Subject: [PATCH 1/6] lib: Add fwts_architecture macro for risc-v 5 | 6 | --- 7 | src/lib/include/fwts_arch.h | 1 + 8 | src/lib/src/fwts_arch.c | 2 ++ 9 | 2 files changed, 3 insertions(+) 10 | 11 | diff --git a/src/lib/include/fwts_arch.h b/src/lib/include/fwts_arch.h 12 | index ddf29e84..02270269 100644 13 | --- a/src/lib/include/fwts_arch.h 14 | +++ b/src/lib/include/fwts_arch.h 15 | @@ -27,6 +27,7 @@ typedef enum { 16 | FWTS_ARCH_X86, 17 | FWTS_ARCH_IA64, 18 | FWTS_ARCH_ARM64, 19 | + FWTS_ARCH_RISCV64, 20 | FWTS_ARCH_OTHER 21 | } fwts_architecture; 22 | 23 | diff --git a/src/lib/src/fwts_arch.c b/src/lib/src/fwts_arch.c 24 | index d60f25a6..ace78d51 100644 25 | --- a/src/lib/src/fwts_arch.c 26 | +++ b/src/lib/src/fwts_arch.c 27 | @@ -31,6 +31,7 @@ static const struct fwts_arch_info arch_info[] = { 28 | { FWTS_ARCH_IA64, "ia64" }, 29 | { FWTS_ARCH_ARM64, "arm64" }, 30 | { FWTS_ARCH_ARM64, "aarch64" }, 31 | + { FWTS_ARCH_RISCV64, "riscv64" }, 32 | { FWTS_ARCH_OTHER, "other" } 33 | }; 34 | 35 | @@ -38,6 +39,7 @@ static const struct fwts_arch_info arch_name[] = { 36 | { FWTS_ARCH_X86, "x86" }, 37 | { FWTS_ARCH_IA64, "ia64" }, 38 | { FWTS_ARCH_ARM64, "arm64" }, 39 | + { FWTS_ARCH_RISCV64, "riscv64" }, 40 | { FWTS_ARCH_OTHER, "other" }, 41 | }; 42 | 43 | -- 44 | 2.34.1 45 | 46 | -------------------------------------------------------------------------------- /common/patches/fwts/0002-acpi-rsdp-Add-xsdt_address-check-for-riscv.patch: -------------------------------------------------------------------------------- 1 | From fa4ae0c1c2048154b141ddf35fe45c0b520a7650 Mon Sep 17 00:00:00 2001 2 | From: Haibo Xu 3 | Date: Wed, 19 Jul 2023 14:53:28 +0800 4 | Subject: [PATCH 2/6] acpi: rsdp: Add xsdt_address check for riscv 5 | 6 | --- 7 | src/acpi/rsdp/rsdp.c | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c 11 | index 419016f3..72705b36 100644 12 | --- a/src/acpi/rsdp/rsdp.c 13 | +++ b/src/acpi/rsdp/rsdp.c 14 | @@ -165,6 +165,11 @@ static int rsdp_test1(fwts_framework *fw) 15 | passed = true; 16 | break; 17 | 18 | + case FWTS_ARCH_RISCV: 19 | + if (rsdp->xsdt_address != 0) 20 | + passed = true; 21 | + break; 22 | + 23 | default: 24 | passed = true; 25 | fwts_log_advice(fw, 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /common/patches/fwts/0003-acpi-madt-update-madt-revisions-to-ACPI-6.5.next.patch: -------------------------------------------------------------------------------- 1 | From 46164451d0a2a83fe0fd06efc8889501185a912b Mon Sep 17 00:00:00 2001 2 | From: Haibo Xu 3 | Date: Tue, 7 Nov 2023 17:03:33 +0800 4 | Subject: [PATCH 3/6] acpi: madt: update madt revisions to ACPI 6.5.next 5 | 6 | Add risc-v madt subtable types which were accepted 7 | in ACPI 6.5.next[1]. 8 | 9 | [1] https://github.com/riscv-non-isa/riscv-acpi/wiki/ACPI-ASWG-ECR-Process 10 | --- 11 | src/acpi/madt/madt.c | 14 +++++++++- 12 | src/lib/include/fwts_acpi.h | 55 +++++++++++++++++++++++++++++++++++++ 13 | 2 files changed, 68 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c 16 | index 318ac668..32d3fa27 100644 17 | --- a/src/acpi/madt/madt.c 18 | +++ b/src/acpi/madt/madt.c 19 | @@ -122,7 +122,7 @@ 20 | 21 | #define SUBTABLE_UNDEFINED 0x00 22 | #define SUBTABLE_VARIABLE 0xff 23 | -#define NUM_SUBTABLE_TYPES 24 24 | +#define NUM_SUBTABLE_TYPES 28 25 | #define MAX_IO_APIC_ID 256 /* IO APIC ID field is 1 byte */ 26 | 27 | #define SBBR_ACPI_MAJOR_VERSION 6 28 | @@ -247,6 +247,15 @@ static struct acpi_madt_subtable_lengths spec_info[] = { 29 | 16, 16, 12, 82, 24, 24, 16, 20, 16, 30 | 15, 23, 21, 13, 19, 17, 15 } 31 | }, 32 | + { /* for ACPI 6.5.next */ 33 | + .major_version = 6, 34 | + .minor_version = 5, 35 | + .madt_version = 6, 36 | + .num_types = 28, 37 | + .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE, 38 | + 16, 16, 12, 82, 24, 24, 16, 20, 16, 39 | + 15, 23, 21, 13, 19, 17, 15, 36, 16, 36, 36 } 40 | + }, 41 | { /* terminator */ 42 | .major_version = 0, 43 | .minor_version = 0, 44 | @@ -516,6 +525,9 @@ static int madt_arch_revision(fwts_framework *fw) 45 | if (fw->target_arch == FWTS_ARCH_ARM64) { 46 | minrev = 3; 47 | arch = "aarch64"; 48 | + } else if (fw->target_arch == FWTS_ARCH_RISCV64) { 49 | + minrev = 5; 50 | + arch = "riscv64"; 51 | } else { 52 | minrev = 1; 53 | arch = "intel"; 54 | diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h 55 | index 481277e5..1cd4aa9d 100644 56 | --- a/src/lib/include/fwts_acpi.h 57 | +++ b/src/lib/include/fwts_acpi.h 58 | @@ -531,6 +531,10 @@ typedef enum { 59 | FWTS_MADT_MSI_PIC, 60 | FWTS_MADT_BIO_PIC, 61 | FWTS_MADT_LPC_PIC, 62 | + FWTS_MADT_RINTC, 63 | + FWTS_MADT_IMSIC, 64 | + FWTS_MADT_APLIC, 65 | + FWTS_MADT_PLIC, 66 | FWTS_MADT_RESERVED, /* does not have defined structure */ 67 | FWTS_MADT_OEM /* does not have defined structure */ 68 | } fwts_acpi_madt_type; 69 | @@ -700,6 +704,57 @@ typedef struct { 70 | uint32_t flag; 71 | } __attribute__ ((packed)) fwts_acpi_madt_core_pic; 72 | 73 | +/* Type 24, FWTS_MADT_RINTC */ 74 | +typedef struct { 75 | + uint8_t version; 76 | + uint8_t reserved; 77 | + uint32_t flags; 78 | + uint64_t hart_id; 79 | + uint32_t uid; 80 | + uint32_t ext_intc_id; 81 | + uint64_t imsic_addr; 82 | + uint32_t imsic_size; 83 | +} __attribute__ ((packed)) fwts_acpi_madt_rintc; 84 | + 85 | +/* Type 25, FWTS_MADT_IMSIC */ 86 | +typedef struct { 87 | + uint8_t version; 88 | + uint8_t reserved; 89 | + uint32_t flags; 90 | + uint16_t num_ids; 91 | + uint16_t num_guest_ids; 92 | + uint8_t guest_index_bits; 93 | + uint8_t hart_index_bits; 94 | + uint8_t group_index_bits; 95 | + uint8_t group_index_shift; 96 | +} __attribute__ ((packed)) fwts_acpi_madt_imsic; 97 | + 98 | +/* Type 26, FWTS_MADT_APLIC */ 99 | +typedef struct { 100 | + uint8_t version; 101 | + uint8_t id; 102 | + uint32_t flags; 103 | + uint8_t hw_id[8]; 104 | + uint16_t num_idcs; 105 | + uint16_t num_sources; 106 | + uint32_t gsi_base; 107 | + uint64_t addr; 108 | + uint32_t size; 109 | +} __attribute__ ((packed)) fwts_acpi_madt_aplic; 110 | + 111 | +/* Type 27, FWTS_MADT_PLIC */ 112 | +typedef struct { 113 | + uint8_t version; 114 | + uint8_t id; 115 | + uint8_t hw_id[8]; 116 | + uint16_t num_irqs; 117 | + uint16_t max_prio; 118 | + uint32_t flags; 119 | + uint32_t size; 120 | + uint64_t base_addr; 121 | + uint32_t gsi_base; 122 | +} __attribute__ ((packed)) fwts_acpi_madt_plic; 123 | + 124 | /* 125 | * ACPI TCPA (Trusted Computing Platform Alliance Capabilities Table) 126 | * http://www.kuro5hin.org/story/2002/10/27/16622/530, 127 | -- 128 | 2.34.1 129 | 130 | -------------------------------------------------------------------------------- /common/patches/fwts/0006-acpi-acpitables-Update-acpitables-test-for-ACPI-6.5.patch: -------------------------------------------------------------------------------- 1 | From 22fe7db366e53e5cd6554e97c0fe043a5a3ef626 Mon Sep 17 00:00:00 2001 2 | From: Haibo Xu 3 | Date: Thu, 10 Aug 2023 17:39:35 +0000 4 | Subject: [PATCH 6/6] acpi: acpitables: Update acpitables test for ACPI 6.5 5 | 6 | --- 7 | src/acpi/acpitables/acpitables.c | 36 ++++++++++++++++++++++++++++++++ 8 | 1 file changed, 36 insertions(+) 9 | 10 | diff --git a/src/acpi/acpitables/acpitables.c b/src/acpi/acpitables/acpitables.c 11 | index 1ab27edf..bd99f5bb 100644 12 | --- a/src/acpi/acpitables/acpitables.c 13 | +++ b/src/acpi/acpitables/acpitables.c 14 | @@ -243,6 +243,39 @@ static const fwts_acpi_table_rev acpi_64_rev[] = { 15 | {NULL, 0xff} // end of table 16 | }; 17 | 18 | +static const fwts_acpi_table_rev acpi_65_rev[] = { 19 | + {"APIC", 6}, 20 | + {"BERT", 1}, 21 | + {"BGRT", 1}, 22 | + {"CCEL", 1}, 23 | + {"CPEP", 1}, 24 | + {"DSDT", 2}, 25 | + {"ECDT", 1}, 26 | + {"EINJ", 2}, 27 | + {"ERST", 1}, 28 | + {"FACP", 6}, 29 | + {"FPDT", 1}, 30 | + {"GTDT", 3}, 31 | + {"HEST", 2}, 32 | + {"MSCT", 1}, 33 | + {"MPST", 1}, 34 | + {"NFIT", 1}, 35 | + {"PCCT", 2}, 36 | + {"PHAT", 1}, 37 | + {"PMTT", 2}, 38 | + {"PPTT", 3}, 39 | + {"RASF", 1}, 40 | + {"RAS2", 1}, 41 | + {"RSDT", 1}, 42 | + {"SBST", 1}, 43 | + {"SDEV", 1}, 44 | + {"SLIT", 1}, 45 | + {"SRAT", 3}, 46 | + {"SSDT", 2}, 47 | + {"SVKL", 1}, 48 | + {"XSDT", 1}, 49 | + {NULL, 0xff} // end of table 50 | +}; 51 | static int acpi_table_check_test2(fwts_framework *fw) 52 | { 53 | const fwts_acpi_table_rev *tables_rev; 54 | @@ -266,6 +299,9 @@ static int acpi_table_check_test2(fwts_framework *fw) 55 | case FWTS_ACPI_VERSION_64: 56 | tables_rev = acpi_64_rev; 57 | break; 58 | + case FWTS_ACPI_VERSION_65: 59 | + tables_rev = acpi_65_rev; 60 | + break; 61 | default: 62 | fwts_log_info_verbatim(fw, "This test does not support ACPI %4.4" PRIx32 ".", version); 63 | return FWTS_SKIP; 64 | -- 65 | 2.34.1 66 | 67 | -------------------------------------------------------------------------------- /common/patches/grub_update_default_gunlib_url.patch: -------------------------------------------------------------------------------- 1 | diff --git a/bootstrap b/bootstrap 2 | index dc2238f4a..c4da6ba38 100755 3 | --- a/bootstrap 4 | +++ b/bootstrap 5 | @@ -47,7 +47,7 @@ PERL="${PERL-perl}" 6 | 7 | me=$0 8 | 9 | -default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git 10 | +default_gnulib_url=https://github.com/coreutils/gnulib.git 11 | 12 | usage() { 13 | cat < " 76 | echo "S->Standalone BRS,F->Full suite" 77 | exit 78 | fi 79 | 80 | if ! [[ $BUILD_TYPE = S ]] && ! [[ $BUILD_TYPE = F ]] ; then 81 | echo "Please provide a Build type." 82 | echo "Usage $0 " 83 | echo "S->Standalone BRS,F->Full suite" 84 | exit 85 | fi 86 | 87 | echo "Target: $BUILD_PLAT" 88 | echo "Build type: $BUILD_TYPE" 89 | 90 | 91 | if [[ $BUILD_TYPE = S ]]; then 92 | BRS_DIR=$TOP_DIR/../../ 93 | else 94 | BRS_DIR=$TOP_DIR/rv-brs-test-suite 95 | fi 96 | 97 | do_build() 98 | { 99 | 100 | pushd $TOP_DIR/$UEFI_PATH 101 | if [[ $arch != "riscv64" ]]; then 102 | export GCC5_RISCV64_PREFIX=riscv64-linux-gnu- 103 | fi 104 | 105 | export EDK2_TOOLCHAIN=$UEFI_TOOLCHAIN 106 | export PACKAGES_PATH=$TOP_DIR/$UEFI_PATH 107 | export PYTHON_COMMAND=/usr/bin/python3 108 | export WORKSPACE=$TOP_DIR/$UEFI_PATH 109 | 110 | #Build base tools 111 | source $TOP_DIR/$UEFI_PATH/edksetup.sh 112 | make -C $TOP_DIR/$UEFI_PATH/BaseTools 113 | build -a RISCV64 -t GCC5 -p MdeModulePkg/MdeModulePkg.dsc 114 | popd 115 | } 116 | 117 | do_clean() 118 | { 119 | pushd $TOP_DIR/$UEFI_PATH 120 | if [[ $arch != "riscv64" ]]; then 121 | CROSS_COMPILE_DIR=$(dirname $CROSS_COMPILE) 122 | PATH="$PATH:$CROSS_COMPILE_DIR" 123 | fi 124 | source $TOP_DIR/$UEFI_PATH/edksetup.sh 125 | make -C $TOP_DIR/$UEFI_PATH/BaseTools clean 126 | 127 | popd 128 | 129 | } 130 | 131 | do_package () 132 | { 133 | if [ $BUILD_TYPE = F ]; then 134 | echo "skip sbsign..." 135 | # sbsign --key $KEYS_DIR/TestDB1.key --cert $KEYS_DIR/TestDB1.crt $TOP_DIR/$UEFI_PATH/Build/MdeModule/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/${TARGET_ARCH}/CapsuleApp.efi --output $TOP_DIR/$UEFI_PATH/Build/MdeModule/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/${TARGET_ARCH}/CapsuleApp.efi 136 | fi 137 | if [ -f $TOP_DIR/$UEFI_PATH/Build/MdeModule/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/${TARGET_ARCH}/CapsuleApp.efi ]; then 138 | echo "CapsuleApp.efi successfully generated at $TOP_DIR/$UEFI_PATH/Build/MdeModule/${UEFI_BUILD_MODE}_${UEFI_TOOLCHAIN}/${TARGET_ARCH}/CapsuleApp.efi" 139 | else 140 | echo "skip sbsign..: CapsuleApp.efi could not be generated. Please check the logs" 141 | fi 142 | 143 | } 144 | 145 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 146 | source $DIR/framework.sh $@ 147 | 148 | -------------------------------------------------------------------------------- /common/scripts/framework.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021, 2023 ARM Limited and Contributors. All rights reserved. 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # 12 | # Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # Neither the name of ARM nor the names of its contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | # POSSIBILITY OF SUCH DAMAGE. 31 | 32 | set -E 33 | 34 | handle_error () 35 | { 36 | local callinfo=$(caller 0) 37 | local script=${callinfo##* } 38 | local lineno=${callinfo%% *} 39 | local func=${callinfo% *} 40 | func=${func#* } 41 | echo 42 | echo -en "${BOLD}${RED}Build failed: error while running ${func} at line " 43 | echo -en "${lineno} in ${script} for ${PLATFORM}[$FLAVOUR]" 44 | echo -e "[$FILESYSTEM_CONFIGURATION].${NORMAL}" 45 | echo 46 | exit 1 47 | } 48 | 49 | trap handle_error ERR 50 | 51 | if [ "$PARALLELISM" != "" ]; then 52 | echo "Parallelism set in environment to $PARALLELISM, not overridding" 53 | else 54 | PARALLELISM=`getconf _NPROCESSORS_ONLN` 55 | fi 56 | 57 | # Directory variables provided by the framework 58 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 59 | 60 | source $DIR/parse_params.sh 61 | set_formatting 62 | 63 | pushd $DIR/.. 64 | TOP_DIR=`pwd` 65 | popd 66 | 67 | PLATDIR=${TOP_DIR}/output 68 | OUTDIR=${PLATDIR} 69 | mkdir -p $OUTDIR 70 | 71 | do_clean 72 | do_build 73 | do_package 74 | 75 | 76 | -------------------------------------------------------------------------------- /common/scripts/get_source.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 4 | # Copyright (c) 2023 Intel Corporation 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # 12 | # Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # Neither the name of ARM nor the names of its contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | # POSSIBILITY OF SUCH DAMAGE. 31 | 32 | TOP_DIR=`pwd` 33 | 34 | get_edk2_src() 35 | { 36 | git clone --depth 1 --single-branch \ 37 | --branch edk2-stable202308 https://github.com/tianocore/edk2.git 38 | pushd $TOP_DIR/edk2 39 | 40 | git submodule update --init 41 | popd 42 | } 43 | 44 | get_sct_src() 45 | { 46 | git clone --single-branch https://github.com/tianocore/edk2-test 47 | pushd $TOP_DIR/edk2-test 48 | git checkout 81dfa8d53d4290366ae41e1f4c2ed6d6c5016c07 49 | popd 50 | } 51 | 52 | get_grub_src() 53 | { 54 | GRUB_SRC_TAG=grub-2.12 55 | echo "Downloading grub source code,Version: ${GRUB_SRC_TAG}" 56 | git clone -b $GRUB_SRC_TAG https://git.savannah.gnu.org/git/grub.git grub 57 | pushd $TOP_DIR/grub 58 | git checkout 5ca9db22e8ed0dbebb2aec53722972de0680a463 59 | echo "Applying Grub patch..." 60 | git apply $TOP_DIR/../../common/patches/grub_update_default_gunlib_url.patch 61 | popd 62 | } 63 | 64 | get_linux_src() 65 | { 66 | LINUX_KERNEL_VERSION=v6.3-rc1 67 | echo "Downloading Linux source code. Version : ${LINUX_KERNEL_VERSION}" 68 | git clone --depth 1 --single-branch --branch acpi_b2_v2_riscv_aia_v11 \ 69 | https://github.com/vlsunil/linux.git linux 70 | pushd $TOP_DIR/linux 71 | git checkout ac5e19d018afa8a37761510bd233ca319a763c42 72 | popd 73 | } 74 | 75 | get_buildroot_src() 76 | { 77 | BUILDROOT_SRC_VERSION=2023.11 78 | echo "Downloading Buildroot source code. TAG : ${BUILDROOT_SRC_VERSION}" 79 | git clone -b $BUILDROOT_SRC_VERSION https://github.com/buildroot/buildroot.git 80 | pushd $TOP_DIR/buildroot/ 81 | echo "Applying Buildroot patch..." 82 | git apply $TOP_DIR/../../common/patches/buildroot_update_fwts_version.patch 83 | git apply $TOP_DIR/../../common/patches/buildroot_enable_busybox_auto_login.patch 84 | cp $TOP_DIR/../../common/patches/fwts/*.patch $TOP_DIR/buildroot/package/fwts/ 85 | popd 86 | } 87 | 88 | get_edk2_test_parser_src() 89 | { 90 | EDK2_TEST_PARSER_VERSION=main 91 | echo "Downloading edk2 test parser source code. TAG : ${EDK2_TEST_PARSER_VERSION}" 92 | git clone -b $EDK2_TEST_PARSER_VERSION https://git.gitlab.arm.com/systemready/edk2-test-parser.git 93 | pushd $TOP_DIR/edk2-test-parser/ 94 | git checkout 5082b6dedd93cd9c786455cc27aaa7b5105c5567 95 | popd 96 | } 97 | 98 | get_sbi_test_src() 99 | { 100 | SBI_TEST_VERSION=riscv/x-tests 101 | echo "Downloading SBI test source code,Version: ${SBI_TEST_VERSION}" 102 | git clone -b $SBI_TEST_VERSION https://gitlab.com/jones-drew/kvm-unit-tests.git 103 | pushd $TOP_DIR/kvm-unit-tests/ 104 | git checkout bbd7e8faa2b31ebb44c54fa6e5d7ee371c56cd11 105 | popd 106 | } 107 | 108 | function check_requirements() { 109 | 110 | # Check if operating system is Ubuntu and version is 22.04 111 | if [ -f /etc/os-release ]; then 112 | . /etc/os-release 113 | OS=$NAME 114 | VER=$VERSION_ID 115 | elif [ -f /etc/lsb-release ]; then 116 | . /etc/lsb-release 117 | OS=$DISTRIB_ID 118 | VER=$DISTRIB_RELEASE 119 | fi 120 | 121 | if [[ "$OS" == "Ubuntu" && ("$VER" == "22.04" || "$VER" == "20.04" )]]; then 122 | echo "$OS $VER Proceeding with the build..." 123 | else 124 | echo "You are running $OS $VER" 125 | echo "Warning: It is recommended to run this build on Ubuntu 22.04/20.04."\ 126 | "However if you choose to proceed with a different version, press 'y' to continue." 127 | read -p "Do you want to continue anyway? (y/n) " choice 128 | case "$choice" in 129 | y|Y ) ;; 130 | * ) exit 0;; 131 | esac 132 | fi 133 | # Check free disk space (at least 20GB) 134 | local disk_space=$(df . -m --output=avail | tail -n 1 | tr -d '[:space:]') 135 | if [[ $disk_space -lt 20*1024 ]]; then 136 | echo "Warning: Only $(expr $disk_space / 1024)GB of free disk space remaining."\ 137 | "The application requires at least 20GB of free disk space during the build and test process." 138 | read -p "Do you want to continue anyway? (y/n) " choice 139 | case "$choice" in 140 | y|Y ) ;; 141 | * ) exit 0;; 142 | esac 143 | fi 144 | 145 | if [[ "$OS" == "Ubuntu" || "$OS" == "Debian GNU/Linux" ]]; then 146 | TOOLS_LIST="git curl mtools gdisk gcc openssl automake autotools-dev libtool \ 147 | bison flex bc uuid-dev python3 libglib2.0-dev libssl-dev autopoint libslirp-dev \ 148 | make g++ gcc-riscv64-unknown-elf gettext dosfstools ninja-build " 149 | if ! dpkg -s $TOOLS_LIST &> /dev/null; then 150 | echo "Atleast one of $TOOLS_LIST is not installed. Install..." 151 | sudo apt install $TOOLS_LIST 152 | fi 153 | fi 154 | 155 | } 156 | 157 | check_requirements 158 | get_edk2_src 159 | get_sct_src 160 | get_grub_src 161 | get_linux_src 162 | get_buildroot_src 163 | get_edk2_test_parser_src 164 | get_sbi_test_src 165 | -------------------------------------------------------------------------------- /common/scripts/parse_params.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # Redistributions of source code must retain the above copyright notice, this 9 | # list of conditions and the following disclaimer. 10 | # 11 | # Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # Neither the name of ARM nor the names of its contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #Print the script that the user explicitly called. 32 | 33 | get_shell_type() { 34 | tty -s && echo "INTERACTIVE" || echo "NON-INTERACTIVE" 35 | } 36 | 37 | set_formatting() { 38 | if [ "$(get_shell_type)" = "INTERACTIVE" ] ; then 39 | export BOLD="\e[1m" 40 | export NORMAL="\e[0m" 41 | export RED="\e[31m" 42 | export GREEN="\e[32m" 43 | export YELLOW="\e[33m" 44 | export BLUE="\e[94m" 45 | export CYAN="\e[36m" 46 | fi 47 | } 48 | 49 | export PARSE_PARAMS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 50 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/BrsBootServicesBBTest.inf: -------------------------------------------------------------------------------- 1 | # 2 | # The material contained herein is not a license, either 3 | # expressly or impliedly, to any intellectual property owned 4 | # or controlled by any of the authors or developers of this 5 | # material or to any contribution thereto. The material 6 | # contained herein is provided on an "AS IS" basis and, to the 7 | # maximum extent permitted by applicable law, this information 8 | # is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | # developers of this material hereby disclaim all other 10 | # warranties and conditions, either express, implied or 11 | # statutory, including, but not limited to, any (if any) 12 | # implied warranties, duties or conditions of merchantability, 13 | # of fitness for a particular purpose, of accuracy or 14 | # completeness of responses, of results, of workmanlike 15 | # effort, of lack of viruses and of lack of negligence, all 16 | # with regard to this material and any contribution thereto. 17 | # Designers must not rely on the absence or characteristics of 18 | # any features or instructions marked "reserved" or 19 | # "undefined." The Unified EFI Forum, Inc. reserves any 20 | # features or instructions so marked for future definition and 21 | # shall have no responsibility whatsoever for conflicts or 22 | # incompatibilities arising from future changes to them. ALSO, 23 | # THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | # QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | # NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | # CONTRIBUTION THERETO. 27 | # 28 | # IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | # ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | # THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | # PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | # CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | # UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | # WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | # DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | # THE POSSIBILITY OF SUCH DAMAGES. 37 | # 38 | # Copyright 2006 - 2016 Unified EFI, Inc. All 39 | # Rights Reserved, subject to all existing rights in all 40 | # matters included within this Test Suite, to which United 41 | # EFI, Inc. makes no claim of right. 42 | # 43 | # Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | # Copyright (c) 2023 Intel Corporation 45 | # 46 | # 47 | #/*++ 48 | # 49 | # Module Name: 50 | # 51 | # BrsBootServicesBBTest.inf 52 | # 53 | # Abstract: 54 | # 55 | # Component description file for BrsBootServices tests. 56 | # 57 | #--*/ 58 | 59 | [Defines] 60 | INF_VERSION = 0x00010005 61 | BASE_NAME = BrsBootServicesBBTest 62 | FILE_GUID = 2688ea92-b293-46ad-a7fa-d8e09ad27c03 63 | MODULE_TYPE = UEFI_DRIVER 64 | VERSION_STRING = 1.0 65 | ENTRY_POINT = InitializeBBTestBrsBootServices 66 | 67 | [Sources.common] 68 | BrsBootServicesBBTestMain.c 69 | BrsBootServicesBBTestFunction.c 70 | Guid.c 71 | 72 | [Packages] 73 | MdePkg/MdePkg.dec 74 | SctPkg/SctPkg.dec 75 | SctPkg/UEFI/UEFI.dec 76 | 77 | [LibraryClasses] 78 | UefiDriverEntryPoint 79 | SctLib 80 | EfiTestLib 81 | 82 | [Protocols] 83 | 84 | [Guids] 85 | gEfiSmbios3TableGuid 86 | gEfiAcpi20TableGuid -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/BrsBootServicesBBTestFunction.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BrsBootServicesBBTestFunction.h 52 | 53 | Abstract: 54 | 55 | Contains definitions and prototypes for test case functions. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSBOOTSERVICES_BB_TEST_FUNCTION_H_ 60 | #define _BRSBOOTSERVICES_BB_TEST_FUNCTION_H_ 61 | 62 | EFI_STATUS 63 | BBTestMemoryMapTest ( 64 | IN EFI_BB_TEST_PROTOCOL *This, 65 | IN VOID *ClientInterface, 66 | IN EFI_TEST_LEVEL TestLevel, 67 | IN EFI_HANDLE SupportHandle 68 | ); 69 | 70 | EFI_STATUS 71 | BBTestAcpiTableTest ( 72 | IN EFI_BB_TEST_PROTOCOL *This, 73 | IN VOID *ClientInterface, 74 | IN EFI_TEST_LEVEL TestLevel, 75 | IN EFI_HANDLE SupportHandle 76 | ); 77 | 78 | EFI_STATUS 79 | BBTestSmbiosTableTest ( 80 | IN EFI_BB_TEST_PROTOCOL *This, 81 | IN VOID *ClientInterface, 82 | IN EFI_TEST_LEVEL TestLevel, 83 | IN EFI_HANDLE SupportHandle 84 | ); 85 | 86 | #endif /* _BRSBOOTSERVICES_BB_TEST_FUNCTION_H_ */ 87 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/BrsBootServicesBBTestMain.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BrsBootServicesBBTestMain.c 52 | 53 | Abstract: 54 | 55 | Test driver for BrsBootServices tests. 56 | 57 | --*/ 58 | 59 | #include "SctLib.h" 60 | #include "BrsBootServicesBBTestMain.h" 61 | #include "BrsBootServicesBBTestFunction.h" 62 | 63 | EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { 64 | BRSBOOTSERVICES_TEST_REVISION, 65 | BRSBOOTSERVICES_TEST_GUID, 66 | L"BrsBootServices Tests", 67 | L"Tests BRS boot services requirements." 68 | }; 69 | 70 | EFI_GUID gSupportProtocolGuid[2] = { 71 | EFI_STANDARD_TEST_LIBRARY_GUID, 72 | EFI_NULL_GUID 73 | }; 74 | 75 | EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { 76 | { 77 | BRSBOOTSERVICES_MEMORYMAP_GUID, 78 | L"MemoryMap", 79 | L"Checks memory map provided by UEFI.", 80 | EFI_TEST_LEVEL_DEFAULT, 81 | gSupportProtocolGuid, 82 | EFI_TEST_CASE_AUTO, 83 | BBTestMemoryMapTest 84 | }, 85 | { 86 | BRSBOOTSERVICES_SMBIOSTABLE_GUID, 87 | L"SmbiosTable", 88 | L"Checks that SMBIOS3 table is provided by UEFI.", 89 | EFI_TEST_LEVEL_DEFAULT, 90 | gSupportProtocolGuid, 91 | EFI_TEST_CASE_AUTO, 92 | BBTestSmbiosTableTest 93 | }, 94 | { 95 | BRSBOOTSERVICES_ACPITABLE_GUID, 96 | L"AcpiTable", 97 | L"Checks that ACPI table is provided by UEFI.", 98 | EFI_TEST_LEVEL_DEFAULT, 99 | gSupportProtocolGuid, 100 | EFI_TEST_CASE_AUTO, 101 | BBTestAcpiTableTest 102 | }, 103 | EFI_NULL_GUID 104 | }; 105 | 106 | EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; 107 | 108 | /** 109 | * The driver's Unload function 110 | * @param ImageHandle The test driver image handle 111 | * @return EFI_SUCCESS Indicates the interface was Uninstalled 112 | */ 113 | EFI_STATUS 114 | BBTestBrsBootServicesUnload ( 115 | IN EFI_HANDLE ImageHandle 116 | ) 117 | { 118 | return EfiUninstallAndFreeBBTestInterface ( 119 | ImageHandle, 120 | gBBTestProtocolInterface 121 | ); 122 | } 123 | 124 | /** 125 | * Creates/installs the BlackBox Interface and eminating Entry Point 126 | * node list. 127 | * @param ImageHandle The test driver image handle 128 | * @param SystemTable Pointer to System Table 129 | * @return EFI_SUCCESS Indicates the interface was installed 130 | * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could not be allocated 131 | * @return EFI_INVALID_PARAMETER: One of the parameters has an invalid value. 132 | */ 133 | EFI_STATUS 134 | InitializeBBTestBrsBootServices ( 135 | IN EFI_HANDLE ImageHandle, 136 | IN EFI_SYSTEM_TABLE *SystemTable 137 | ) 138 | { 139 | 140 | EfiInitializeTestLib (ImageHandle, SystemTable); 141 | SctInitializeLib (ImageHandle, SystemTable); 142 | 143 | return EfiInitAndInstallBBTestInterface ( 144 | &ImageHandle, 145 | &gBBTestProtocolField, 146 | gBBTestEntryField, 147 | BBTestBrsBootServicesUnload, 148 | &gBBTestProtocolInterface 149 | ); 150 | } 151 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/BrsBootServicesBBTestMain.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BrsBootServicesBBTestMain.h 52 | 53 | Abstract: 54 | 55 | Contains definitions for test information and test GUIDs. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSBOOTSERVICES_TEST_MAIN_H_ 60 | #define _BRSBOOTSERVICES_TEST_MAIN_H_ 61 | 62 | #include "Efi.h" 63 | #include "Guid.h" 64 | #include 65 | 66 | #define BRSBOOTSERVICES_TEST_REVISION 0x00010000 67 | 68 | #define BRSBOOTSERVICES_TEST_GUID \ 69 | { 0x236da812, 0x2002, 0x4ad9, {0x88, 0x4d, 0x05, 0x8f, 0xd2, 0xdd, 0x13, 0x86 }} 70 | 71 | #define ACPI_TABLE_EXPECTED_LENGTH 36 72 | #define ACPI_TABLE_CHECKSUM_LENGTH 20 73 | #define SMBIOS30_ANCHOR_STRING "_SM3_" 74 | #define RSDP_SIGNATURE_STRING "RSD PTR " 75 | 76 | EFI_STATUS 77 | InitializeBBTestBrsBootServices ( 78 | IN EFI_HANDLE ImageHandle, 79 | IN EFI_SYSTEM_TABLE *SystemTable 80 | ); 81 | 82 | EFI_STATUS 83 | BBTestBrsBootServicesUnload ( 84 | IN EFI_HANDLE ImageHandle 85 | ); 86 | 87 | // 88 | // Test Case GUIDs 89 | // 90 | 91 | #define BRSBOOTSERVICES_MEMORYMAP_GUID \ 92 | { 0x1b610277, 0xcadb, 0x433d, {0xa7, 0xab, 0xa7, 0x7f, 0xe4, 0x26, 0xfb, 0xfd }} 93 | 94 | #define BRSBOOTSERVICES_ACPITABLE_GUID \ 95 | { 0xbfc24bf8, 0xe8f8, 0x4c80, {0xb3, 0x30, 0xe6, 0xd6, 0x29, 0xd8, 0x43, 0x24 }} 96 | 97 | #define BRSBOOTSERVICES_SMBIOSTABLE_GUID \ 98 | { 0x970c1d8b, 0x17c1, 0x42dd, {0x9b, 0x05, 0x2b, 0x65, 0x37, 0x49, 0x9c, 0xa2 }} 99 | 100 | #endif /* _BRSBOOTSERVICES_TEST_MAIN_H_ */ 101 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/Guid.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.c 52 | 53 | Abstract: 54 | 55 | Global variable assignments for GUIDs used in test assertions. 56 | 57 | --*/ 58 | 59 | #include "Efi.h" 60 | #include "Guid.h" 61 | 62 | EFI_GUID gBrsBootServicesAssertion001Guid = BRSBOOTSERVICES_ASSERTION_001_GUID; 63 | 64 | EFI_GUID gBrsBootServicesAssertion002Guid = BRSBOOTSERVICES_ASSERTION_002_GUID; 65 | 66 | EFI_GUID gBrsBootServicesAssertion003Guid = BRSBOOTSERVICES_ASSERTION_003_GUID; 67 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsBootServices/BlackBoxTest/Guid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.h 52 | 53 | Abstract: 54 | 55 | Definitions for GUIDs used in test assertions. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSBOOTSERVICES_GUID_H_ 60 | #define _BRSBOOTSERVICES_GUID_H_ 61 | 62 | #define BRSBOOTSERVICES_ASSERTION_001_GUID \ 63 | { 0x9e212ddd, 0x1218, 0x45a3, {0x8b, 0x30, 0xaa, 0x80, 0x5e, 0xa3, 0x6f, 0x5e }} 64 | 65 | extern EFI_GUID gBrsBootServicesAssertion001Guid; 66 | 67 | #define BRSBOOTSERVICES_ASSERTION_002_GUID \ 68 | { 0xf89d0d28, 0xcd1f, 0x4557, {0x8d, 0xae, 0x32, 0xdd, 0xab, 0x7e, 0xe3, 0x92 }} 69 | 70 | extern EFI_GUID gBrsBootServicesAssertion002Guid; 71 | 72 | #define BRSBOOTSERVICES_ASSERTION_003_GUID \ 73 | { 0x37704acb, 0x0e42, 0x46e0, {0xa3, 0xb8, 0xb4, 0x07, 0x5d, 0xaa, 0xfa, 0x60 }} 74 | 75 | extern EFI_GUID gBrsBootServicesAssertion003Guid; 76 | 77 | #endif /* _BRSBOOTSERVICES_GUID_H_ */ 78 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/EfiSpecVerLvlBBTest.inf: -------------------------------------------------------------------------------- 1 | # 2 | # The material contained herein is not a license, either 3 | # expressly or impliedly, to any intellectual property owned 4 | # or controlled by any of the authors or developers of this 5 | # material or to any contribution thereto. The material 6 | # contained herein is provided on an "AS IS" basis and, to the 7 | # maximum extent permitted by applicable law, this information 8 | # is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | # developers of this material hereby disclaim all other 10 | # warranties and conditions, either express, implied or 11 | # statutory, including, but not limited to, any (if any) 12 | # implied warranties, duties or conditions of merchantability, 13 | # of fitness for a particular purpose, of accuracy or 14 | # completeness of responses, of results, of workmanlike 15 | # effort, of lack of viruses and of lack of negligence, all 16 | # with regard to this material and any contribution thereto. 17 | # Designers must not rely on the absence or characteristics of 18 | # any features or instructions marked "reserved" or 19 | # "undefined." The Unified EFI Forum, Inc. reserves any 20 | # features or instructions so marked for future definition and 21 | # shall have no responsibility whatsoever for conflicts or 22 | # incompatibilities arising from future changes to them. ALSO, 23 | # THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | # QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | # NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | # CONTRIBUTION THERETO. 27 | # 28 | # IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | # ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | # THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | # PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | # CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | # UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | # WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | # DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | # THE POSSIBILITY OF SUCH DAMAGES. 37 | # 38 | # Copyright 2006 - 2016 Unified EFI, Inc. All 39 | # Rights Reserved, subject to all existing rights in all 40 | # matters included within this Test Suite, to which United 41 | # EFI, Inc. makes no claim of right. 42 | # 43 | # Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | # Copyright (c) 2023 Intel Corporation 45 | # 46 | # 47 | #/*++ 48 | # 49 | # Module Name: 50 | # 51 | # EfiSpecVerLvlBBTest.inf 52 | # 53 | # Abstract: 54 | # 55 | # Component description file for BRS Specification Version Level test. 56 | # 57 | #--*/ 58 | 59 | [Defines] 60 | INF_VERSION = 0x00010019 61 | BASE_NAME = EfiSpecVerLvlBBTest 62 | FILE_GUID = f865a18a-9b47-420d-97ae-676d8016a513 63 | MODULE_TYPE = UEFI_DRIVER 64 | VERSION_STRING = 1.0 65 | ENTRY_POINT = InitializeBBTestEfiSpecVerLvl 66 | 67 | [Sources.common] 68 | EfiSpecVerLvlBBTestFunction.c 69 | EfiSpecVerLvlBBTestMain.c 70 | Guid.c 71 | 72 | [Packages] 73 | MdePkg/MdePkg.dec 74 | SctPkg/SctPkg.dec 75 | SctPkg/UEFI/UEFI.dec 76 | 77 | [LibraryClasses] 78 | EfiTestLib 79 | SctLib 80 | UefiDriverEntryPoint 81 | 82 | [Protocols] 83 | gBlackBoxEfiBlockIoProtocolGuid 84 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/EfiSpecVerLvlBBTestFunction.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | EfiSpecVerLvlBBTestFunction.c 52 | 53 | Abstract: 54 | 55 | Test case definitions for EfiSpecVerLvl test. 56 | 57 | --*/ 58 | 59 | #include "EfiSpecVerLvlBBTestMain.h" 60 | #include "Guid.h" 61 | #include "SctLib.h" 62 | #include "EfiSpecVerLvlBBTestFunction.h" 63 | 64 | /** Entrypoint for EFI Specification Version Level Test. 65 | * 66 | * @param This a pointer of EFI_BB_TEST_PROTOCOL. 67 | * @param ClientInterface a pointer to the interface to be tested. 68 | * @param TestLevel test "thoroughness" control. 69 | * @param SupportHandle a handle containing protocols required. 70 | * @return EFI_SUCCESS Finish the test successfully. 71 | */ 72 | 73 | // 74 | // BRS 8.1 75 | // 76 | 77 | EFI_STATUS 78 | BBTestEfiSpecVerLvlTest ( 79 | IN EFI_BB_TEST_PROTOCOL *This, 80 | IN VOID *ClientInterface, 81 | IN EFI_TEST_LEVEL TestLevel, 82 | IN EFI_HANDLE SupportHandle 83 | ) 84 | { 85 | 86 | EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; 87 | EFI_STATUS Status; 88 | UINTN CurHrRev; 89 | 90 | // Get the Standard Library Interface 91 | Status = gtBS->HandleProtocol ( 92 | SupportHandle, 93 | &gEfiStandardTestLibraryGuid, 94 | (VOID **) &StandardLib 95 | ); 96 | if (EFI_ERROR (Status)) { 97 | return Status; 98 | } 99 | 100 | CurHrRev = gtBS->Hdr.Revision; // Reading revision of the EFI Specification. 101 | 102 | // Check if EFI Specification version is less than 2.7 103 | if (gtBS->Hdr.Revision < EFI_2_70_SYSTEM_TABLE_REVISION){ 104 | StandardLib->RecordAssertion ( 105 | StandardLib, 106 | EFI_TEST_ASSERTION_FAILED, 107 | gTestGenericFailureGuid, 108 | L"EFI Specification Version is below 2.7", 109 | L"%a:%d:Current EFI Header Rev=0x%X", 110 | __FILE__, 111 | __LINE__, 112 | CurHrRev 113 | ); 114 | return EFI_INCOMPATIBLE_VERSION; 115 | } else { 116 | StandardLib->RecordAssertion ( 117 | StandardLib, 118 | EFI_TEST_ASSERTION_PASSED, 119 | gEfiSpecVerLvlAssertion01Guid, 120 | L"TestEfiSpecVerLvl", 121 | L"%a:%d:Current EFI Header Rev=0x%X", 122 | __FILE__, 123 | __LINE__, 124 | CurHrRev 125 | ); 126 | 127 | return EFI_SUCCESS; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/EfiSpecVerLvlBBTestFunction.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | EfiSpecVerLvlBBTestFunction.h 52 | 53 | Abstract: 54 | 55 | Contains definitions and prototypes used in the test functions. 56 | 57 | --*/ 58 | 59 | #ifndef _EFISPECVERLVL_BB_TEST_FUNCTION_H_ 60 | #define _EFISPECVERLVL_BB_TEST_FUNCTION_H_ 61 | 62 | #include 63 | 64 | EFI_STATUS 65 | BBTestEfiSpecVerLvlTest ( 66 | IN EFI_BB_TEST_PROTOCOL *This, 67 | IN VOID *ClientInterface, 68 | IN EFI_TEST_LEVEL TestLevel, 69 | IN EFI_HANDLE SupportHandle 70 | ); 71 | 72 | #endif /* _EFISPECVERLVL_BB_TEST_FUNCTION_H_ */ 73 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/EfiSpecVerLvlBBTestMain.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | or controlled by any of the authors or developers of this 4 | material or to any contribution thereto. The material 5 | contained herein is provided on an "AS IS" basis and, to the 6 | maximum extent permitted by applicable law, this information 7 | is provided AS IS AND WITH ALL FAULTS, and the authors and 8 | developers of this material hereby disclaim all other 9 | warranties and conditions, either express, implied or 10 | statutory, including, but not limited to, any (if any) 11 | implied warranties, duties or conditions of merchantability, 12 | of fitness for a particular purpose, of accuracy or 13 | completeness of responses, of results, of workmanlike 14 | effort, of lack of viruses and of lack of negligence, all 15 | with regard to this material and any contribution thereto. 16 | Designers must not rely on the absence or characteristics of 17 | any features or instructions marked "reserved" or 18 | "undefined." The Unified EFI Forum, Inc. reserves any 19 | features or instructions so marked for future definition and 20 | shall have no responsibility whatsoever for conflicts or 21 | incompatibilities arising from future changes to them. ALSO, 22 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 23 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 24 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 25 | CONTRIBUTION THERETO. 26 | 27 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 28 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 29 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 30 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 31 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 32 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 33 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 34 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 35 | THE POSSIBILITY OF SUCH DAMAGES. 36 | 37 | Copyright 2006 - 2016 Unified EFI, Inc. All 38 | Rights Reserved, subject to all existing rights in all 39 | matters included within this Test Suite, to which United 40 | EFI, Inc. makes no claim of right. 41 | 42 | Copyright (c) 2016, ARM Ltd. All rights reserved.
43 | Copyright (c) 2023 Intel Corporation 44 | 45 | --*/ 46 | /*++ 47 | 48 | Module Name: 49 | 50 | EfiSpecVerLvlBBTestMain.c 51 | 52 | Abstract: 53 | 54 | Test driver for BRS system environment configuration tests. 55 | 56 | --*/ 57 | 58 | #include "SctLib.h" 59 | #include "EfiSpecVerLvlBBTestFunction.h" 60 | #include "EfiSpecVerLvlBBTestMain.h" 61 | 62 | EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { 63 | EFISPECVERLVL_TEST_REVISION, 64 | EFISPECVERLVL_TEST_GUID, 65 | L"BRS UEFI Specification Version Level Test", 66 | L"Check the UEFI Specification Version Level to make sure it conforms to RISC-v BRS." 67 | }; 68 | 69 | EFI_GUID gSupportProtocolGuid[2] = { 70 | EFI_STANDARD_TEST_LIBRARY_GUID, 71 | EFI_NULL_GUID 72 | }; 73 | 74 | EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { 75 | { 76 | EFISPECVERLVL_GUID, 77 | L"TestEfiSpecVerLvl", 78 | L"Check the EFI Specification Version Level.", 79 | EFI_TEST_LEVEL_DEFAULT, 80 | gSupportProtocolGuid, 81 | EFI_TEST_CASE_AUTO, 82 | BBTestEfiSpecVerLvlTest 83 | }, 84 | EFI_NULL_GUID 85 | }; 86 | 87 | EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; 88 | 89 | /** The driver's Unload function. 90 | * @param ImageHandle The test driver image handle 91 | * @return EFI_SUCCESS Indicates the interface was uninstalled 92 | */ 93 | EFI_STATUS 94 | BBTestEfiSpecVerLvlUnload ( 95 | IN EFI_HANDLE ImageHandle 96 | ) 97 | { 98 | return EfiUninstallAndFreeBBTestInterface ( 99 | ImageHandle, 100 | gBBTestProtocolInterface 101 | ); 102 | } 103 | 104 | /** Creates/installs the BlackBox Interface and emanating Entry Point node list. 105 | * @param ImageHandle The test driver image handle 106 | * @param SystemTable Pointer to System Table 107 | * @return EFI_SUCCESS Indicates the interface was installed 108 | * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could not be allocated 109 | * @return EFI_INVALID_PARAMETER One of the parameters has an invalid value. 110 | */ 111 | EFI_STATUS 112 | InitializeBBTestEfiSpecVerLvl ( 113 | IN EFI_HANDLE ImageHandle, 114 | IN EFI_SYSTEM_TABLE *SystemTable 115 | ) 116 | { 117 | 118 | EfiInitializeTestLib (ImageHandle, SystemTable); 119 | 120 | return EfiInitAndInstallBBTestInterface ( 121 | &ImageHandle, 122 | &gBBTestProtocolField, 123 | gBBTestEntryField, 124 | BBTestEfiSpecVerLvlUnload, 125 | &gBBTestProtocolInterface 126 | ); 127 | } 128 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/EfiSpecVerLvlBBTestMain.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | EfiSpecVerLvlBBTestMain.h 52 | 53 | Abstract: 54 | 55 | Contains definitions for test information and test GUIDs. 56 | 57 | --*/ 58 | 59 | #ifndef _EFISPECVERLVL_TEST_MAIN_H_ 60 | #define _EFISPECVERLVL_TEST_MAIN_H_ 61 | 62 | #include "Efi.h" 63 | #include 64 | 65 | 66 | #define EFISPECVERLVL_TEST_REVISION 0x00010000 67 | 68 | #define EFISPECVERLVL_TEST_GUID \ 69 | {0xd6e40d12, 0x7a51, 0x4454, {0xb4, 0xfd, 0x4c, 0x93, 0x88, 0x7e, 0xd6, 0xcf}} 70 | 71 | EFI_STATUS 72 | InitializeBBTestEfiSpecVerLvl ( 73 | IN EFI_HANDLE ImageHandle, 74 | IN EFI_SYSTEM_TABLE *SystemTable 75 | ); 76 | 77 | // 78 | // Entry GUIDs 79 | // 80 | 81 | #define EFISPECVERLVL_GUID \ 82 | {0x6e46b2e2, 0x2535, 0x4c8e, {0x82, 0x5a, 0x84, 0x5d, 0xc2, 0xbe, 0xed, 0xdf}} 83 | 84 | 85 | #endif /* _EFISPECVERLVL_TEST_MAIN_H_ */ 86 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/Guid.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.c 52 | 53 | Abstract: 54 | 55 | GUID assignments for test progress assertions. 56 | 57 | --*/ 58 | 59 | #include "Efi.h" 60 | #include "Guid.h" 61 | 62 | EFI_GUID gEfiSpecVerLvlAssertion01Guid = EFISPECVERLVL_ASSERTION_001_GUID; 63 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiEfiSpecVerLvl/BlackBoxTest/Guid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Ltd. All rights reserved.
44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.h 52 | 53 | Abstract: 54 | 55 | Definitions of GUIDs used for test progress assertions. 56 | 57 | --*/ 58 | 59 | #ifndef _EFISPECVERSION_GUID_H_ 60 | #define _EFISPECVERSION_GUID_H_ 61 | 62 | #define EFISPECVERLVL_ASSERTION_001_GUID \ 63 | {0x14932290, 0x563b, 0x4d20, {0x95, 0xa7, 0xee, 0xc0, 0x2d, 0xbb, 0x1b, 0x13}} 64 | 65 | extern EFI_GUID gEfiSpecVerLvlAssertion01Guid; 66 | 67 | #endif /* _EFISPECVERSION_GUID_H_ */ 68 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/Guid.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | 45 | --*/ 46 | /*++ 47 | 48 | Module Name: 49 | 50 | Guid.c 51 | 52 | Abstract: 53 | 54 | Global variable assignments for GUIDs used in test assertions. 55 | 56 | --*/ 57 | 58 | #include "Efi.h" 59 | #include "Guid.h" 60 | 61 | EFI_GUID gRequiredUefiProtocolsAssertion001Guid = REQUIREDUEFIPROTOCOLS_ASSERTION_001_GUID; 62 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/Guid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | 45 | --*/ 46 | /*++ 47 | 48 | Module Name: 49 | 50 | Guid.h 51 | 52 | Abstract: 53 | 54 | Definitions for GUIDs used in test assertions. 55 | 56 | --*/ 57 | 58 | #ifndef _REQUIREDUEFIPROTOCOLS_GUID_H_ 59 | #define _REQUIREDUEFIPROTOCOLS_GUID_H_ 60 | 61 | #define REQUIREDUEFIPROTOCOLS_ASSERTION_001_GUID \ 62 | { 0x6092f275, 0x19ca, 0x413a, {0xac, 0xc8, 0x60, 0xd6, 0xe0, 0xca, 0x70, 0x54 }} 63 | 64 | extern EFI_GUID gRequiredUefiProtocolsAssertion001Guid; 65 | 66 | #endif /* _REQUIREDUEFIPROTOCOLS_GUID_H_ */ 67 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTest.inf: -------------------------------------------------------------------------------- 1 | # 2 | # The material contained herein is not a license, either 3 | # expressly or impliedly, to any intellectual property owned 4 | # or controlled by any of the authors or developers of this 5 | # material or to any contribution thereto. The material 6 | # contained herein is provided on an "AS IS" basis and, to the 7 | # maximum extent permitted by applicable law, this information 8 | # is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | # developers of this material hereby disclaim all other 10 | # warranties and conditions, either express, implied or 11 | # statutory, including, but not limited to, any (if any) 12 | # implied warranties, duties or conditions of merchantability, 13 | # of fitness for a particular purpose, of accuracy or 14 | # completeness of responses, of results, of workmanlike 15 | # effort, of lack of viruses and of lack of negligence, all 16 | # with regard to this material and any contribution thereto. 17 | # Designers must not rely on the absence or characteristics of 18 | # any features or instructions marked "reserved" or 19 | # "undefined." The Unified EFI Forum, Inc. reserves any 20 | # features or instructions so marked for future definition and 21 | # shall have no responsibility whatsoever for conflicts or 22 | # incompatibilities arising from future changes to them. ALSO, 23 | # THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | # QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | # NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | # CONTRIBUTION THERETO. 27 | # 28 | # IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | # ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | # THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | # PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | # CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | # UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | # WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | # DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | # THE POSSIBILITY OF SUCH DAMAGES. 37 | # 38 | # Copyright 2006 - 2016 Unified EFI, Inc. All 39 | # Rights Reserved, subject to all existing rights in all 40 | # matters included within this Test Suite, to which United 41 | # EFI, Inc. makes no claim of right. 42 | # 43 | # Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | # 45 | # 46 | #/*++ 47 | # 48 | # Module Name: 49 | # 50 | # RequiredUefiProtocolsBBTest.inf 51 | # 52 | # Abstract: 53 | # 54 | # Component description file for RequiredUefiProtocols tests. 55 | # 56 | #--*/ 57 | 58 | [Defines] 59 | INF_VERSION = 0x00010005 60 | BASE_NAME = RequiredUefiProtocolsBBTest 61 | FILE_GUID = acc875f3-9c75-4392-9b95-fcb97d48890e 62 | MODULE_TYPE = UEFI_DRIVER 63 | VERSION_STRING = 1.0 64 | ENTRY_POINT = InitializeBBTestRequiredUefiProtocols 65 | 66 | [Sources.common] 67 | RequiredUefiProtocolsBBTestMain.c 68 | RequiredUefiProtocolsBBTestFunction.c 69 | Guid.c 70 | 71 | [Packages] 72 | MdePkg/MdePkg.dec 73 | SctPkg/SctPkg.dec 74 | SctPkg/UEFI/UEFI.dec 75 | 76 | [LibraryClasses] 77 | UefiDriverEntryPoint 78 | SctLib 79 | EfiTestLib 80 | 81 | [Protocols] 82 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | RequiredUefiProtocolsBBTestFunction.c 52 | 53 | Abstract: 54 | 55 | Test case function definitions for RequiredUefiProtocols. 56 | 57 | --*/ 58 | 59 | #include "RequiredUefiProtocolsBBTestMain.h" 60 | #include "RequiredUefiProtocolsBBTestFunction.h" 61 | #include "SctLib.h" 62 | #include "Guid.h" 63 | 64 | /** 65 | * Entrypoint for MediaIoProtocols Test. 66 | * @param This a pointer of EFI_BB_TEST_PROTOCOL. 67 | * @param ClientInterface a pointer to the interface to be tested. 68 | * @param TestLevel test "thoroughness" control. 69 | * @param SupportHandle a handle containing protocols required. 70 | * @return EFI_SUCCESS Finish the test successfully. 71 | */ 72 | 73 | EFI_STATUS 74 | BBTestMediaIoProtocolsTest ( 75 | IN EFI_BB_TEST_PROTOCOL *This, 76 | IN VOID *ClientInterface, 77 | IN EFI_TEST_LEVEL TestLevel, 78 | IN EFI_HANDLE SupportHandle 79 | ) 80 | { 81 | 82 | EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; 83 | EFI_STATUS Status; 84 | EFI_TEST_ASSERTION AssertionType; 85 | EFI_HANDLE *HandleBuffer; 86 | UINTN NumberOfHandles; 87 | BRS_REQUIRED_PROTOCOL Protocol[] = { 88 | {EFI_LOAD_FILE_PROTOCOL_GUID, L"EFI_LOAD_FILE_PROTOCOL"}, 89 | {gEfiNullGuid, 0} 90 | }; 91 | UINT32 i; 92 | 93 | // 94 | // Get the Standard Library Interface 95 | // 96 | Status = gtBS->HandleProtocol ( 97 | SupportHandle, 98 | &gEfiStandardTestLibraryGuid, 99 | (VOID **) &StandardLib 100 | ); 101 | if (EFI_ERROR (Status)) { 102 | return Status; 103 | } 104 | 105 | // 106 | // Looking for Protocols 107 | // 108 | i = 0; 109 | while (SctCompareGuid (&Protocol[i].guid, &gEfiNullGuid) != 0){ 110 | Status = gBS->LocateHandleBuffer ( 111 | ByProtocol, 112 | &Protocol[i].guid, 113 | NULL, 114 | &NumberOfHandles, 115 | &HandleBuffer 116 | ); 117 | 118 | if ((Status == EFI_NOT_FOUND) && (NumberOfHandles == 0)){ 119 | // Protocol not found 120 | StandardLib->RecordAssertion ( 121 | StandardLib, 122 | EFI_TEST_ASSERTION_FAILED, 123 | gRequiredUefiProtocolsAssertion001Guid, 124 | L"MediaIoProtocols", 125 | L"%a:%d:%s Not Found", 126 | __FILE__, 127 | __LINE__, 128 | Protocol[i].name 129 | ); 130 | } 131 | else { 132 | // Protocol found 133 | StandardLib->RecordAssertion ( 134 | StandardLib, 135 | EFI_TEST_ASSERTION_PASSED, 136 | gRequiredUefiProtocolsAssertion001Guid, 137 | L"MediaIoProtocols", 138 | L"%a:%d:%s Found", 139 | __FILE__, 140 | __LINE__, 141 | Protocol[i].name 142 | ); 143 | } 144 | 145 | i++; 146 | } 147 | 148 | return EFI_SUCCESS; 149 | } 150 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | RequiredUefiProtocolsBBTestFunction.h 52 | 53 | Abstract: 54 | 55 | Contains definitions and prototypes for test case functions. 56 | 57 | --*/ 58 | 59 | #ifndef _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ 60 | #define _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ 61 | 62 | /* 63 | * GUIDs of protocols we're looking for are here as to avoid 64 | * compilation errors in the case that they do not exist in the 65 | * system. 66 | */ 67 | 68 | #define EFI_LOAD_FILE_PROTOCOL_GUID \ 69 | {0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B}} 70 | 71 | #define EFI_LOAD_FILE2_PROTOCOL_GUID \ 72 | {0x4006C0C1, 0xFCB3, 0x403E, {0x99, 0x6D, 0x4A, 0x6C, 0x87, 0x24, 0xE0, 0x6D}} 73 | 74 | typedef struct { 75 | EFI_GUID guid; 76 | UINT16 *name; 77 | } BRS_REQUIRED_PROTOCOL; 78 | 79 | EFI_STATUS 80 | BBTestMediaIoProtocolsTest ( 81 | IN EFI_BB_TEST_PROTOCOL *This, 82 | IN VOID *ClientInterface, 83 | IN EFI_TEST_LEVEL TestLevel, 84 | IN EFI_HANDLE SupportHandle 85 | ); 86 | 87 | #endif /* _REQUIREDUEFIPROTOCOLS_BB_TEST_FUNCTION_H_ */ 88 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | Copyright (c) 2023 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | RequiredUefiProtocolsBBTestMain.c 52 | 53 | Abstract: 54 | 55 | Test driver for RequiredUefiProtocols tests. 56 | 57 | --*/ 58 | 59 | #include "SctLib.h" 60 | #include "RequiredUefiProtocolsBBTestMain.h" 61 | #include "RequiredUefiProtocolsBBTestFunction.h" 62 | 63 | EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { 64 | REQUIREDUEFIPROTOCOLS_TEST_REVISION, 65 | REQUIREDUEFIPROTOCOLS_TEST_GUID, 66 | L"RequiredUefiProtocols Tests", 67 | L"Checks that UEFI protocols required by RISC-V BRS." 68 | }; 69 | 70 | EFI_GUID gSupportProtocolGuid[2] = { 71 | EFI_STANDARD_TEST_LIBRARY_GUID, 72 | EFI_NULL_GUID 73 | }; 74 | 75 | EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { 76 | { 77 | REQUIREDUEFIPROTOCOLS_MEDIAIOPROTOCOLS_GUID, 78 | L"MediaIoProtocols", 79 | L"Checks to make sure various media IO protocols are supported.", 80 | EFI_TEST_LEVEL_DEFAULT, 81 | gSupportProtocolGuid, 82 | EFI_TEST_CASE_AUTO, 83 | BBTestMediaIoProtocolsTest 84 | }, 85 | EFI_NULL_GUID 86 | }; 87 | 88 | EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; 89 | 90 | /** 91 | * The driver's Unload function 92 | * @param ImageHandle The test driver image handle 93 | * @return EFI_SUCCESS Indicates the interface was Uninstalled 94 | */ 95 | EFI_STATUS 96 | BBTestRequiredUefiProtocolsUnload ( 97 | IN EFI_HANDLE ImageHandle 98 | ) 99 | { 100 | return EfiUninstallAndFreeBBTestInterface ( 101 | ImageHandle, 102 | gBBTestProtocolInterface 103 | ); 104 | } 105 | 106 | /** 107 | * Creates/installs the BlackBox Interface and eminating Entry Point 108 | * node list. 109 | * @param ImageHandle The test driver image handle 110 | * @param SystemTable Pointer to System Table 111 | * @return EFI_SUCCESS Indicates the interface was installed 112 | * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could not be allocated 113 | * @return EFI_INVALID_PARAMETER: One of the parameters has an invalid value. 114 | */ 115 | EFI_STATUS 116 | InitializeBBTestRequiredUefiProtocols ( 117 | IN EFI_HANDLE ImageHandle, 118 | IN EFI_SYSTEM_TABLE *SystemTable 119 | ) 120 | { 121 | 122 | EfiInitializeTestLib (ImageHandle, SystemTable); 123 | 124 | return EfiInitAndInstallBBTestInterface ( 125 | &ImageHandle, 126 | &gBBTestProtocolField, 127 | gBBTestEntryField, 128 | BBTestRequiredUefiProtocolsUnload, 129 | &gBBTestProtocolInterface 130 | ); 131 | } 132 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestMain.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved. 44 | 45 | --*/ 46 | /*++ 47 | 48 | Module Name: 49 | 50 | RequiredUefiProtocolsBBTestMain.h 51 | 52 | Abstract: 53 | 54 | Contains definitions for test information and test GUIDs. 55 | 56 | --*/ 57 | 58 | #ifndef _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ 59 | #define _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ 60 | 61 | #include "Efi.h" 62 | #include "Guid.h" 63 | #include 64 | 65 | #define REQUIREDUEFIPROTOCOLS_TEST_REVISION 0x00010000 66 | 67 | #define REQUIREDUEFIPROTOCOLS_TEST_GUID \ 68 | { 0x6b4d5d18, 0xf55f, 0x4fc5, {0x84, 0x96, 0xf1, 0x00, 0x22, 0x37, 0x5c, 0x04 }} 69 | 70 | EFI_STATUS 71 | InitializeBBTestRequiredUefiProtocols ( 72 | IN EFI_HANDLE ImageHandle, 73 | IN EFI_SYSTEM_TABLE *SystemTable 74 | ); 75 | 76 | EFI_STATUS 77 | BBTestBootRequiredUefiProtocols ( 78 | IN EFI_HANDLE ImageHandle 79 | ); 80 | 81 | // 82 | // Entry GUIDs 83 | // 84 | 85 | #define REQUIREDUEFIPROTOCOLS_MEDIAIOPROTOCOLS_GUID \ 86 | { 0x24d52c4c, 0xafeb, 0x49ea, {0xa7, 0x77, 0x8f, 0xe1, 0x9f, 0x32, 0x20, 0x66 }} 87 | 88 | #endif /* _REQUIREDUEFIPROTOCOLS_TEST_MAIN_H_ */ 89 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/BRSIRuntimeServicesBBTest.inf: -------------------------------------------------------------------------------- 1 | # 2 | # The material contained herein is not a license, either 3 | # expressly or impliedly, to any intellectual property owned 4 | # or controlled by any of the authors or developers of this 5 | # material or to any contribution thereto. The material 6 | # contained herein is provided on an "AS IS" basis and, to the 7 | # maximum extent permitted by applicable law, this information 8 | # is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | # developers of this material hereby disclaim all other 10 | # warranties and conditions, either express, implied or 11 | # statutory, including, but not limited to, any (if any) 12 | # implied warranties, duties or conditions of merchantability, 13 | # of fitness for a particular purpose, of accuracy or 14 | # completeness of responses, of results, of workmanlike 15 | # effort, of lack of viruses and of lack of negligence, all 16 | # with regard to this material and any contribution thereto. 17 | # Designers must not rely on the absence or characteristics of 18 | # any features or instructions marked "reserved" or 19 | # "undefined." The Unified EFI Forum, Inc. reserves any 20 | # features or instructions so marked for future definition and 21 | # shall have no responsibility whatsoever for conflicts or 22 | # incompatibilities arising from future changes to them. ALSO, 23 | # THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | # QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | # NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | # CONTRIBUTION THERETO. 27 | # 28 | # IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | # ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | # THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | # PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | # CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | # UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | # WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | # DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | # THE POSSIBILITY OF SUCH DAMAGES. 37 | # 38 | # Copyright 2006 - 2016 Unified EFI, Inc. All 39 | # Rights Reserved, subject to all existing rights in all 40 | # matters included within this Test Suite, to which United 41 | # EFI, Inc. makes no claim of right. 42 | # 43 | # Copyright (c) 2016, ARM. All rights reserved.
44 | # Copyright (c) 2024 Intel Corporation 45 | # 46 | #/*++ 47 | # 48 | # Module Name: 49 | # 50 | # BRSIRuntimeServicesBBTest.inf 51 | # 52 | # Abstract: 53 | # 54 | # Component description file for BRSIRuntimeServices tests. 55 | # 56 | #--*/ 57 | 58 | [Defines] 59 | INF_VERSION = 0x00010005 60 | BASE_NAME = BRSIRuntimeServicesBBTest 61 | FILE_GUID = 9d865654-a0be-4236-8343-9536f3831d58 62 | MODULE_TYPE = UEFI_DRIVER 63 | VERSION_STRING = 1.0 64 | ENTRY_POINT = InitializeBBTestBRSIRuntimeServices 65 | 66 | [Sources.common] 67 | Guid.c 68 | BRSIRuntimeServicesBBTestFunction.c 69 | BRSIRuntimeServicesBBTestMain.c 70 | 71 | [Packages] 72 | MdePkg/MdePkg.dec 73 | SctPkg/SctPkg.dec 74 | SctPkg/UEFI/UEFI.dec 75 | 76 | [LibraryClasses] 77 | EfiTestLib 78 | SctLib 79 | UefiDriverEntryPoint 80 | 81 | [Protocols] 82 | gEfiTestRecoveryLibraryGuid -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/BRSIRuntimeServicesBBTestFunction.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved.
44 | Copyright (c) 2024 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BRSIRuntimeServicesBBTestFunction.h 52 | 53 | Abstract: 54 | 55 | Header file for BRSIRuntimeServicesBBTestFunction.h. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSIRUNTIMESERVICES_BB_TEST_FUNCTION_H_ 60 | #define _BRSIRUNTIMESERVICES_BB_TEST_FUNCTION_H_ 61 | 62 | #include 63 | 64 | #define TEST_VAR_NAME (L"SCT_NON_VOLATILE_TEST") 65 | #define UEFI_VARIABLE_TEST_VALUE 0xDEADBEEF 66 | 67 | EFI_STATUS 68 | BBTestRuntimeServices ( 69 | IN EFI_BB_TEST_PROTOCOL *This, 70 | IN VOID *ClientInterface, 71 | IN EFI_TEST_LEVEL TestLevel, 72 | IN EFI_HANDLE SupportHandle 73 | ); 74 | 75 | EFI_STATUS 76 | BBTestResetShutdown ( 77 | IN EFI_BB_TEST_PROTOCOL *This, 78 | IN VOID *ClientInterface, 79 | IN EFI_TEST_LEVEL TestLevel, 80 | IN EFI_HANDLE SupportHandle 81 | ); 82 | 83 | EFI_STATUS 84 | BBTestNonVolatileVariable ( 85 | IN EFI_BB_TEST_PROTOCOL *This, 86 | IN VOID *ClientInterface, 87 | IN EFI_TEST_LEVEL TestLevel, 88 | IN EFI_HANDLE SupportHandle 89 | ); 90 | 91 | #endif /* _BRSIRUNTIMESERVICES_BB_TEST_FUNCTION_H_ */ 92 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/BRSIRuntimeServicesBBTestMain.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved.
44 | Copyright (c) 2024 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BRSIRuntimeServicesBBTestMain.c 52 | 53 | Abstract: 54 | 55 | Test driver for BRSIRuntimeServices tests. 56 | 57 | --*/ 58 | 59 | #include "SctLib.h" 60 | #include "BRSIRuntimeServicesBBTestFunction.h" 61 | #include "BRSIRuntimeServicesBBTestMain.h" 62 | 63 | 64 | EFI_TPL TplArray [TPL_ARRAY_SIZE] = { 65 | TPL_APPLICATION, 66 | TPL_CALLBACK, 67 | TPL_NOTIFY 68 | }; 69 | 70 | EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = { 71 | BRSIRUNTIMESERVICES_TEST_REVISION, 72 | BRSIRUNTIMESERVICES_TEST_GUID, 73 | L"BRSIRuntimeServices Tests", 74 | L"Tests to test Runtime Services Exception Level, Memory Map, Real Time Clock , Reset, Shutdown and Set Variable." 75 | }; 76 | 77 | EFI_GUID gSupportProtocolGuid[2] = { 78 | EFI_STANDARD_TEST_LIBRARY_GUID, 79 | EFI_NULL_GUID 80 | }; 81 | 82 | EFI_BB_TEST_ENTRY_FIELD gBBTestEntryField[] = { 83 | { 84 | BRSIRUNTIMESERVICES_TEST_CASE_GUID, 85 | L"Runtime Services Test", 86 | L"Test to check runtime services exist or not.", 87 | EFI_TEST_LEVEL_DEFAULT, 88 | gSupportProtocolGuid, 89 | EFI_TEST_CASE_AUTO, 90 | BBTestRuntimeServices 91 | }, 92 | { 93 | BRSIRUNTIMESERVICES_TEST_CASE_RESETSHUTDOWN_GUID, 94 | L"ResetSystem Shutdown Test", 95 | L"Manual Test for ResetSystem Shutdown.", 96 | EFI_TEST_LEVEL_DEFAULT, 97 | gSupportProtocolGuid, 98 | EFI_TEST_CASE_MANUAL, 99 | BBTestResetShutdown 100 | }, 101 | { 102 | BRSIRUNTIMESERVICES_TEST_CASE_NONVOLATILEVARIABLE_GUID, 103 | L"Non-volatile Variable Reset Test", 104 | L"Ensures that non-volatile UEFI variables can survive cold resets.", 105 | EFI_TEST_LEVEL_DEFAULT, 106 | gSupportProtocolGuid, 107 | EFI_TEST_CASE_AUTO, 108 | BBTestNonVolatileVariable 109 | }, 110 | EFI_NULL_GUID 111 | }; 112 | 113 | EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; 114 | 115 | /** 116 | * The driver's Unload function 117 | * @param ImageHandle The test driver image handle 118 | * @return EFI_SUCCESS Indicates the interface was Uninstalled 119 | */ 120 | EFI_STATUS 121 | BBTestBRSIRuntimeServicesUnload ( 122 | IN EFI_HANDLE ImageHandle 123 | ) 124 | { 125 | return EfiUninstallAndFreeBBTestInterface ( 126 | ImageHandle, 127 | gBBTestProtocolInterface 128 | ); 129 | } 130 | 131 | /** 132 | * Creates/installs the BlackBox Interface and eminating Entry Point 133 | * node list. 134 | * @param ImageHandle The test driver image handle 135 | * @param SystemTable Pointer to System Table 136 | * @return EFI_SUCCESS Indicates the interface was installed 137 | * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could not be allocated 138 | * @return EFI_INVALID_PARAMETER: One of the parameters has an invalid value. 139 | */ 140 | EFI_STATUS 141 | InitializeBBTestBRSIRuntimeServices ( 142 | IN EFI_HANDLE ImageHandle, 143 | IN EFI_SYSTEM_TABLE *SystemTable 144 | ) 145 | { 146 | 147 | EfiInitializeTestLib (ImageHandle, SystemTable); 148 | SctInitializeLib (ImageHandle, SystemTable); 149 | 150 | return EfiInitAndInstallBBTestInterface ( 151 | &ImageHandle, 152 | &gBBTestProtocolField, 153 | gBBTestEntryField, 154 | BBTestBRSIRuntimeServicesUnload, 155 | &gBBTestProtocolInterface 156 | ); 157 | } 158 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/BRSIRuntimeServicesBBTestMain.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved.
44 | Copyright (c) 2024 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | BRSIRuntimeServicesBBTestMain.h 52 | 53 | Abstract: 54 | 55 | Header file for BRSIRuntimeServicesBBTestMain.c. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSIRUNTIMESERVICES_TEST_MAIN_H_ 60 | #define _BRSIRUNTIMESERVICES_TEST_MAIN_H_ 61 | 62 | #include "Efi.h" 63 | 64 | #define BRSIRUNTIMESERVICES_TEST_REVISION 0x00010000 65 | 66 | #define BRSIRUNTIMESERVICES_TEST_GUID \ 67 | { 0x1c3c483b, 0x3ba3, 0x42ab, {0x80, 0xec, 0x5a, 0xe7, 0x9d, 0x31, 0xf1, 0x93 }} 68 | 69 | #define BRSIRUNTIMESERVICES_NONVOLATILEVARIABLE_RESET_GUID \ 70 | { 0xc7303991, 0xe0d4, 0x48b1, {0x82, 0x9d, 0x5a, 0xa2, 0xbc, 0x31, 0x0c, 0x4a }} 71 | 72 | #define VENDOR_GUID \ 73 | { 0x9f228f94, 0x9b2d, 0x4a21, {0xae, 0xf3, 0x64, 0x77, 0xde, 0xdd, 0x9c, 0xca }} 74 | 75 | #define TPL_ARRAY_SIZE 3 76 | 77 | typedef struct _RESET_DATA { 78 | UINTN Step; 79 | UINTN TplIndex; 80 | UINT32 RepeatTimes; 81 | } RESET_DATA; 82 | 83 | EFI_STATUS 84 | InitializeBBTestBRSIRuntimeServices ( 85 | IN EFI_HANDLE ImageHandle, 86 | IN EFI_SYSTEM_TABLE *SystemTable 87 | ); 88 | 89 | EFI_STATUS 90 | BBTestBRSIRuntimeServices ( 91 | IN EFI_HANDLE ImageHandle 92 | ); 93 | 94 | // 95 | // Entry GUIDs 96 | // 97 | 98 | #define BRSIRUNTIMESERVICES_TEST_CASE_GUID \ 99 | { 0xe5a45402, 0xeda8, 0x4bfd, {0x86, 0x17, 0x4a, 0xe5, 0xa6, 0x97, 0xb7, 0x2c }} 100 | 101 | #define BRSIRUNTIMESERVICES_TEST_CASE_RESETSHUTDOWN_GUID \ 102 | { 0x94011d32, 0x68b9, 0x4556, {0xa5, 0x74, 0x5d, 0x34, 0xd7, 0x9b, 0x12, 0x65 }} 103 | 104 | #define BRSIRUNTIMESERVICES_TEST_CASE_NONVOLATILEVARIABLE_GUID \ 105 | { 0xea2fdafd, 0xbcc3, 0x4f37, {0x9c, 0xf4, 0x81, 0x7f, 0x86, 0x40, 0x15, 0x28 }} 106 | 107 | #endif /* _BRSIRUNTIMESERVICES_TEST_MAIN_H_ */ 108 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/Guid.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved.
44 | Copyright (c) 2024 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.c 52 | 53 | Abstract: 54 | 55 | GUIDs auto-generated for EFI test assertion. 56 | 57 | --*/ 58 | 59 | #include "Efi.h" 60 | #include "Guid.h" 61 | 62 | EFI_GUID gBRSIRuntimeServicesAssertion001Guid = BRSIRUNTIMESERVICES_ASSERTION_001_GUID; 63 | 64 | EFI_GUID gBRSIRuntimeServicesAssertion002Guid = BRSIRUNTIMESERVICES_ASSERTION_002_GUID; 65 | 66 | EFI_GUID gBRSIRuntimeServicesAssertion003Guid = BRSIRUNTIMESERVICES_ASSERTION_003_GUID; 67 | 68 | EFI_GUID gBRSIRuntimeServicesAssertion004Guid = BRSIRUNTIMESERVICES_ASSERTION_004_GUID; 69 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/BrsiRuntimeServices/BlackBoxTest/Guid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | The material contained herein is not a license, either 3 | expressly or impliedly, to any intellectual property owned 4 | or controlled by any of the authors or developers of this 5 | material or to any contribution thereto. The material 6 | contained herein is provided on an "AS IS" basis and, to the 7 | maximum extent permitted by applicable law, this information 8 | is provided AS IS AND WITH ALL FAULTS, and the authors and 9 | developers of this material hereby disclaim all other 10 | warranties and conditions, either express, implied or 11 | statutory, including, but not limited to, any (if any) 12 | implied warranties, duties or conditions of merchantability, 13 | of fitness for a particular purpose, of accuracy or 14 | completeness of responses, of results, of workmanlike 15 | effort, of lack of viruses and of lack of negligence, all 16 | with regard to this material and any contribution thereto. 17 | Designers must not rely on the absence or characteristics of 18 | any features or instructions marked "reserved" or 19 | "undefined." The Unified EFI Forum, Inc. reserves any 20 | features or instructions so marked for future definition and 21 | shall have no responsibility whatsoever for conflicts or 22 | incompatibilities arising from future changes to them. ALSO, 23 | THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, 24 | QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 25 | NON-INFRINGEMENT WITH REGARD TO THE TEST SUITE AND ANY 26 | CONTRIBUTION THERETO. 27 | 28 | IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR 29 | ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR 30 | THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST 31 | PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, 32 | CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER 33 | UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 34 | WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS 35 | DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF 36 | THE POSSIBILITY OF SUCH DAMAGES. 37 | 38 | Copyright 2006 - 2016 Unified EFI, Inc. All 39 | Rights Reserved, subject to all existing rights in all 40 | matters included within this Test Suite, to which United 41 | EFI, Inc. makes no claim of right. 42 | 43 | Copyright (c) 2016, ARM Corporation. All rights reserved.
44 | Copyright (c) 2024 Intel Corporation 45 | 46 | --*/ 47 | /*++ 48 | 49 | Module Name: 50 | 51 | Guid.h 52 | 53 | Abstract: 54 | 55 | GUIDs auto-generated for EFI test assertion. 56 | 57 | --*/ 58 | 59 | #ifndef _BRSIRUNTIMESERVICES_GUID_H_ 60 | #define _BRSIRUNTIMESERVICES_GUID_H_ 61 | 62 | #define BRSIRUNTIMESERVICES_ASSERTION_001_GUID \ 63 | { 0x3f88d5f0, 0x8dd8, 0x4548, {0xab, 0xa7, 0xbc, 0xc8, 0xe5, 0xa8, 0x81, 0x6b }} 64 | 65 | extern EFI_GUID gBRSIRuntimeServicesAssertion001Guid; 66 | 67 | #define BRSIRUNTIMESERVICES_ASSERTION_002_GUID \ 68 | { 0x95a65a7e, 0x9b86, 0x4d53, {0xbc, 0x95, 0xf7, 0x03, 0x60, 0x39, 0x76, 0x95 }} 69 | 70 | extern EFI_GUID gBRSIRuntimeServicesAssertion002Guid; 71 | 72 | #define BRSIRUNTIMESERVICES_ASSERTION_003_GUID \ 73 | { 0x3e580191, 0x3c9d, 0x4009, {0x93, 0x18, 0x1b, 0x17, 0x16, 0x5d, 0x0e, 0x29 }} 74 | 75 | extern EFI_GUID gBRSIRuntimeServicesAssertion003Guid; 76 | 77 | #define BRSIRUNTIMESERVICES_ASSERTION_004_GUID \ 78 | { 0x6d5c768c, 0xda42, 0x4fb0, {0xa2, 0x95, 0x84, 0x16, 0x4d, 0x01, 0x05, 0xb2 }} 79 | 80 | extern EFI_GUID gBRSIRuntimeServicesAssertion004Guid; 81 | 82 | #endif /* _BRSIRUNTIMESERVICES_GUID_H_ */ 83 | -------------------------------------------------------------------------------- /common/sct-tests/brsi-tests/build_brs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2006 - 2015 Unified EFI, Inc.
4 | # Copyright (c) 2011 - 2020, ARM Ltd. All rights reserved.
5 | # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
6 | # Copyright (c) 2023 Intel Corporation 7 | # 8 | # This program and the accompanying materials 9 | # are licensed and made available under the terms and conditions of the BSD License 10 | # which accompanies this distribution. The full text of the license may be found at 11 | # http://opensource.org/licenses/bsd-license.php 12 | # 13 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 | # 16 | ## 17 | 18 | SctpackageDependencyList=(SctPkg BaseTools) 19 | 20 | function get_build_arch 21 | { 22 | case `uname -m` in 23 | arm*) 24 | BUILD_ARCH=ARM;; 25 | aarch64*) 26 | BUILD_ARCH=AARCH64;; 27 | riscv64*) 28 | BUILD_ARCH=RISCV64;; 29 | *) 30 | BUILD_ARCH=other;; 31 | esac 32 | } 33 | 34 | function set_cross_compile 35 | { 36 | get_build_arch 37 | 38 | echo "Target: $SCT_TARGET_ARCH" 39 | echo "Build: $BUILD_ARCH" 40 | if [ "$SCT_TARGET_ARCH" = "$BUILD_ARCH" ]; then 41 | TEMP_CROSS_COMPILE= 42 | elif [ "$SCT_TARGET_ARCH" == "AARCH64" ]; then 43 | if [ X"$CROSS_COMPILE_64" != X"" ]; then 44 | TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" 45 | else 46 | TEMP_CROSS_COMPILE=aarch64-linux-gnu- 47 | fi 48 | elif [ "$SCT_TARGET_ARCH" == "ARM" ]; then 49 | if [ X"$CROSS_COMPILE_32" != X"" ]; then 50 | TEMP_CROSS_COMPILE="$CROSS_COMPILE_32" 51 | else 52 | TEMP_CROSS_COMPILE=arm-linux-gnueabihf- 53 | fi 54 | elif [ "$SCT_TARGET_ARCH" == "RISCV64" ]; then 55 | if [ X"$CROSS_COMPILE_64" != X"" ]; then 56 | TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" 57 | else 58 | TEMP_CROSS_COMPILE=riscv64-unknown-elf- 59 | fi 60 | else 61 | echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" >&2 62 | fi 63 | } 64 | 65 | function get_gcc_version 66 | { 67 | gcc_version=$($1 -dumpversion) 68 | 69 | if [ ${gcc_version%%.*} -ge 5 ]; then 70 | gcc_version=5 71 | fi 72 | 73 | case $gcc_version in 74 | 4.6*|4.7*|4.8*|4.9*|5*) 75 | echo GCC$(echo ${gcc_version} | awk -F. '{print $1$2}') 76 | ;; 77 | *) 78 | echo "Unknown toolchain version '$gcc_version'" >&2 79 | echo "Attempting to build using GCC49 profile." >&2 80 | echo GCC49 81 | ;; 82 | esac 83 | } 84 | 85 | function get_clang_version 86 | { 87 | clang_version=`$1 --version | head -1 | sed 's/^.*version\s*\([0-9]*\).\([0-9]*\).*/\1\2/g'` 88 | echo "CLANG$clang_version" 89 | } 90 | 91 | 92 | GetBaseToolsBinSubDir() { 93 | # 94 | # Figure out a uniq directory name from the uname command 95 | # 96 | UNAME_DIRNAME=`uname -sm` 97 | UNAME_DIRNAME=${UNAME_DIRNAME// /-} 98 | UNAME_DIRNAME=${UNAME_DIRNAME//\//-} 99 | echo $UNAME_DIRNAME 100 | } 101 | 102 | GetEdkToolsPathBinDirectory() { 103 | # 104 | # Figure out a uniq directory name from the uname 105 | # command 106 | # 107 | BIN_SUB_DIR=`GetBaseToolsBinSubDir` 108 | 109 | if [ -e $EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR ] 110 | then 111 | EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR 112 | else 113 | EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/BinWrappers/PosixLike 114 | fi 115 | echo $EDK_TOOLS_PATH_BIN 116 | } 117 | 118 | PrintUsage() { 119 | # 120 | #Print Help 121 | # 122 | echo "Usage:" 123 | echo " $0 \ 124 | \ 125 | [build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]" 126 | } 127 | 128 | #Iterate through the SCT package dependency list and check if they exist in the current directory 129 | for pkg in ${names[@]} 130 | do 131 | if [ ! -d `pwd`/$name] 132 | then 133 | echo "Couldn't build SCT:" 134 | echo The directory `pwd`/$name does not exist. 135 | exit -1 136 | fi 137 | done 138 | 139 | export EFI_SOURCE=`pwd` 140 | 141 | # check if the last command was successful 142 | status=$? 143 | if test $status -ne 0; then 144 | echo Could not Run the edksetup.sh script 145 | exit -1 146 | fi 147 | 148 | SCT_TARGET_ARCH=${1} 149 | 150 | # 151 | # Pick a default tool type for a given OS 152 | # 153 | case `uname` in 154 | Linux*) 155 | case ${2} in 156 | RVCT | rvct) 157 | TARGET_TOOLS=RVCTLINUX 158 | ;; 159 | 160 | ARMGCC | armgcc) 161 | TARGET_TOOLS=ARMGCC 162 | ;; 163 | 164 | GCC* | gcc*) 165 | set_cross_compile 166 | CROSS_COMPILE="$TEMP_CROSS_COMPILE" 167 | export TARGET_TOOLS=`get_gcc_version "$CROSS_COMPILE"gcc` 168 | ;; 169 | 170 | *) 171 | echo "Couldn't build SCT:" 172 | PrintUsage 173 | exit -1 174 | ;; 175 | esac 176 | ;; 177 | CYGWIN*) 178 | case ${2} in 179 | RVCT | rvct) 180 | TARGET_TOOLS=RVCT31CYGWIN 181 | ;; 182 | 183 | ARMGCC | armgcc) 184 | TARGET_TOOLS=ARMGCCCYGWIN 185 | ;; 186 | 187 | *) 188 | echo "Couldn't build SCT:" 189 | PrintUsage 190 | exit -1 191 | ;; 192 | esac 193 | ;; 194 | *) 195 | echo "Couldn't build SCT:" 196 | echo "Unknown OS, Use this script either in Unix or Cygwin environment". 197 | PrintUsage 198 | exit -1 199 | ;; 200 | esac 201 | 202 | # Drop parsed command line arguments 203 | shift 2 204 | 205 | echo "TOOLCHAIN is ${TARGET_TOOLS}" 206 | export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE 207 | echo "Toolchain prefix: ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE" 208 | 209 | SCT_BUILD=DEBUG 210 | if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then 211 | SCT_BUILD=$1 212 | shift 213 | fi 214 | 215 | # 216 | # Setup workspace if it is not set 217 | # 218 | if [ -z "${WORKSPACE:-}" ]; then 219 | echo Initializing workspace 220 | export WORKSPACE=$PWD 221 | export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/SctPkg 222 | # We do not pass BuildArmSct.sh arguments to edksetup.sh 223 | while (( "$#" )); do 224 | shift 225 | done 226 | . edk2/edksetup.sh 227 | else 228 | echo Building from: $WORKSPACE 229 | fi 230 | 231 | if [[ ! -e $EDK_TOOLS_PATH/Source/C/bin ]] 232 | then 233 | # build the tools if they don't yet exist 234 | echo Building tools: $EDK_TOOLS_PATH 235 | make -C $EDK_TOOLS_PATH 236 | status=$? 237 | if test $status -ne 0 238 | then 239 | echo Error while building EDK tools 240 | exit -1 241 | fi 242 | else 243 | echo using prebuilt tools 244 | fi 245 | 246 | rm -f $EDK_TOOLS_PATH/Source/C/bin/GenBin 247 | 248 | # build the GenBin if it doesn't yet exist 249 | echo Building GenBin 250 | make -C SctPkg/Tools/Source/GenBin 251 | status=$? 252 | if test $status -ne 0 253 | then 254 | echo Error while building GenBin 255 | exit -1 256 | fi 257 | 258 | # Copy GenBin file to Base tools bin directory 259 | DEST_DIR=`GetEdkToolsPathBinDirectory` 260 | # Ensure the directory exist 261 | mkdir -p $DEST_DIR 262 | cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin 263 | 264 | # 265 | # Build the packages needed for the SCT 266 | # Set $DSC_EXTRA to any extra packages needed for the build 267 | # 268 | for DSC in SctPkg/UEFI/BRS_SCT.dsc $DSC_EXTRA 269 | do 270 | build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $@ 271 | # Check if there is any error 272 | status=$? 273 | if test $status -ne 0 274 | then 275 | echo Could not build package $DSC 276 | exit -1 277 | fi 278 | done 279 | 280 | # 281 | # If the argument is clean, then don't have to generate Sct binary. 282 | # 283 | for arg in "$@" 284 | do 285 | if [ $arg == clean ] || [ $arg == cleanall ] 286 | then 287 | # no need to post process if we are doing a clean 288 | exit 1 289 | fi 290 | done 291 | 292 | # 293 | # Change directory to Build directory 294 | # 295 | cd Build/UefiSct/${SCT_BUILD}_${TARGET_TOOLS} 296 | pwd 297 | 298 | # 299 | # Run a script to generate Sct binary for the target architecture 300 | # 301 | ../../../SctPkg/CommonGenFramework.sh brs_sct $SCT_TARGET_ARCH Install$SCT_TARGET_ARCH.efi 302 | 303 | status=$? 304 | if test $status -ne 0 305 | then 306 | echo Could not generate UEFI SCT binary 307 | exit -1 308 | else 309 | echo The SCT binary "SctPackage${SCT_TARGET_ARCH}" is located at "$EFI_SOURCE/Build/UefiSct/${SCT_BUILD}_${TARGET_TOOLS}" 310 | fi 311 | -------------------------------------------------------------------------------- /docs/Network_Test_Environment_Setup.md: -------------------------------------------------------------------------------- 1 | In general, a series of modules related to the Network are enabled by default. However, it is noticed that most Network test items are failed during SCT test execution. The most likely reason is the lack of a UNDI driver built in the current platform firmware codebase. RiscVVirt('-machine virt') comes with e1000 as the default NIC device. However, as this device lacks an integrated UEFI UNDI driver, it cannot provide the foundational services to enable the network. 2 | The following proposals could be the reference solutions: 3 | 1. Build Intel UNDI driver binary to the FD. 4 | 2. Build UsbNetwork/NetworkCommon.inf to the FD. 5 | 1. Build edk2-platforms/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiRuntimeDxe.inf to the FD. 6 | 1. Build 3rd party UNDI driver to the FD. 7 | 8 | From a testing perspective, solution 3 is the recommended approach, here are two recommended steps: 9 | * Build UndiRuntimeDxe to your firmware FD, with the following patch: edk2-platforms/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiRuntimeDxe.inf 10 | * Append NIC 'i82557b' to the qemu command line. 11 | So, if you intend to enable the edk2 network stack with QEMU in the boot flow, it is suggested to use the following command: 12 | 13 | ``` 14 | ./qemu-system-riscv64 -nographic -m 8G -smp 2 \ 15 | -machine virt,pflash0=pflash0,pflash1=pflash1 \ 16 | -blockdev node-name=pflash0,driver=file,read-only=on,filename=$FW_DIR/RISCV_SP_CODE.fd \ 17 | -blockdev node-name=pflash1,driver=file,filename=$FW_DIR/RISCV_SP_VARS.fd \ 18 | -bios $Sbi_DIR/fw_dynamic.bin \ 19 | -drive file=$Img_DIR/brs_live_image.img,if=ide,format=raw \ 20 | -device i82557b,netdev=net2 \ 21 | -netdev type=user,id=net2 22 | ``` 23 | 24 | From a product implementation perspective, it is not recommended to directly use UndiRuntimeDxe as the provider for the UNDI services. It is more appropriate to provide the UNDI services based on the NIC device integrated into the platform. -------------------------------------------------------------------------------- /docs/RV-BRS-Test-Suite_Developer_Guide.md: -------------------------------------------------------------------------------- 1 | # RV BRS Test Suite Developer Guide 2 | 3 | This guide provides instructions for developers to add user-defined test cases, update components, build single components, verify private changes, and contribute upstream. 4 | 5 | ## Adding User-Defined UEFI-SCT Test Cases 6 | To add a user-defined SCT test case in the BRS test suite, please follow the steps below: 7 | 8 | 1. Create a new directory for your test under the `common/sct-tests/brsi-tests` directory. 9 | 2. Add source files (`.inf`, `.c`, `.h`, etc.) to this directory. 10 | 3. Update the `common/sct-tests/brsi-tests/BRS_SCT.dsc` Driver Source Code file by adding the new directory path within the `` element. 11 | 4. Build the project by running:`rv-brs_commit/brsi/scripts$ ./build-scripts/build-sct.sh` 12 | 5. Update image with `rv-brs_commit/brsi/scripts$ ./build-scripts/build_image.sh` 13 | 6. Follow `README.md` to run testcase to verify whether the testcase works as expected. 14 | 7. Refer to the EDK2 community [support page](https://github.com/tianocore/tianocore.github.io/wiki/Community-Support) for more information on SCT development and related issues. Also, here is a commit example that adds a new testcase https://github.com/tianocore/edk2-test/pull/65. 15 | 16 | ## Upstreaming Changes to UEFI-SCT 17 | If you want to upstream changes to UEFI-SCT, follow these steps: 18 | 19 | 1. Clone the [UEFI-SCT GitHub repository](https://github.com/tianocore/edk2-test/tree/master/uefi-sct). 20 | 2. Adhere to the UEFI-SCT contribution guidelines and follow the [EDK2 Git workflow](https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute) to commit to the UEFI-SCT repository. 21 | 22 | Note: Use the patched file located in `common/patches` and apply the patch within the `script/brsi/scripts/build-scripts/build_brsi.sh` before changes are accepted. 23 | 24 | ## Updating Components version in BRS Test Suite 25 | To update components, such as UEFI-SCT or linux, along with a private component in the BRS test suite, follow these steps: 26 | 27 | 1. Update the `` and/or `` element(s) in the `brsi/scripts/build-scripts/get_source.sh` file. 28 | 2. Remove the old directory and run `brsi/scripts/build-scripts/get_brsi_source.sh` to update the component. 29 | 3. Follow the `README.md` to build the project and confirm that the updated component version is included in the final image. 30 | 31 | ### Updating FWTS version in BRS Test Suite 32 | Since the FWTS was a builtin package of buildroot, its version depend on that of buildroot. If you need a different FWTS, a fresh patch was needed to update the FWTS version(`common/patches/build_fwts_version.patch`). Once you updated the aforementioned patch, please remove the old buildroot source directory and run the `get_brsi_source.sh` again to include the changes. 33 | 34 | For any issues or further queries, please feel free to raise them as a GitHub issue. 35 | --------------------------------------------------------------------------------