summaryrefslogtreecommitdiffstats
path: root/lib/efi_selftest/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* efi_selftest: compiler flags for efi_selftest_miniapp_exception.oMarek BehĂșn2021-05-241-0/+2
| | | | | | | | | | | | | Add $(CFLAGS_EFI) and remove $(CFLAGS_NON_EFI) for efi_selftest_miniapp_exception.o. The removal is needed when compiling with LTO - this object file needs to be compiled without -flto. The adding is for consistency with other miniapps. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi: ESRT creation testsJose Marinho2021-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commmit exercises the ESRT creation in a EFI selftest. A fake FMP, with TEST_ESRT_NUM_ENTRIES FW images, is installed in the system leading to the corresponding ESRT entries being populated. The ESRT entries are checked against the datastructure used to initialize the FMP. Invocation from the sandbox platform: add to sandbox_defconfig: +CONFIG_CMD_BOOTEFI_SELFTEST=y make sandbox_capsule_defconfig all ./u-boot -d arch/sandbox/dts/test.dtb bootefi selftest CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: Remove loadfile2 for initrd selftestsIlias Apalodimas2021-03-251-1/+0
| | | | | | | | | | We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: compiler flags for dtbdump.oHeinrich Schuchardt2021-02-211-1/+1
| | | | | | Fix a typo. Apply the correct compiler flags to dtbdump.o. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: provide initrddump test toolHeinrich Schuchardt2021-01-201-0/+6
| | | | | | | | Provide an UEFI application to save the initial RAM disk provided by U-Boot via the Load File2 protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* efi_selftest: don't compile dtbdump if GENERATE_ACPI_TABLEHeinrich Schuchardt2021-01-201-2/+3
| | | | | | | If we are using ACPI tables instead of a device tree, we don't need the dtbdump.efi test tool. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: test EFI_LOAD_FILE_PROTOCOLHeinrich Schuchardt2020-12-101-0/+3
| | | | | | | A unit test is supplied to test the support for the EFI_LOAD_FILE_PROTOCOL and the EFI_LOAD_FILE2_PROTOCOL by the LoadImage() boot service. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: clean up MakefileHeinrich Schuchardt2020-12-101-8/+6
| | | | | | | | Bring all obj-y entries together. Sort *.o targets. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: provide unit test for the EFI_TCG2_PROTOCOLHeinrich Schuchardt2020-11-141-0/+1
| | | | | | Provide a minimal test for the EFI_TCG2_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: add tool to download dtbHeinrich Schuchardt2020-11-091-0/+5
| | | | | | | | | | | For validating the fixed up device tree we need a tool to need to save it to a file. dtbdump.efi copies the configuration table with the device tree to a file on the same partition from which dtbdump.efi was invoked. The file name can be entered on the console. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: simplify MakefileHeinrich Schuchardt2020-09-061-6/+0
| | | | | | | CONFIG_EFI_LOADER cannot be selected for ARMv7-M CPUs. So don't check it in the Makefile. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: add a test for ResetSystem()Heinrich Schuchardt2020-08-241-0/+1
| | | | | | | | | | | The unit test will reset the system by calling the ResetSystem() runtime service before or after ExitBootServices() according to the users choice by setting environment variable efi_selftest to: * 'reset system' or * 'reset system runtime'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: block device test requires CONFIG_DOS_PARTITIONHeinrich Schuchardt2020-08-011-1/+1
| | | | | | | | Do not execute the block device test if CONFIG_DOS_PARTITION=n. Imply CONFIG_DOS_PARTITION in Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: SNP test depends on networkHeinrich Schuchardt2020-08-011-1/+2
| | | | | | If CONFIG_NET=n, testing the simple network protocol makes no sense. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: test CalculateCrc32, CopyMem, SetMemHeinrich Schuchardt2020-03-221-0/+1
| | | | | | Provide unit tests for CalculateCrc32(), CopyMem(), SetMem(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: add selftests for loadfile2 used to load initramfsIlias Apalodimas2020-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a unit test loading an initial ramdisk using the EFI_LOAD_FILE2_PROTOCOL. The test is only executed on request. An example usage - given a file image with a file system in partition 1 holding file initrd - is: * Configure the sandbox with CONFIG_EFI_SELFTEST=y CONFIG_EFI_LOAD_FILE2_INITRD=y CONFIG_EFI_INITRD_FILESPEC="host 0:1 initrd" * Run ./u-boot and execute host bind 0 image setenv efi_selftest load initrd bootefi selftest This would provide a test output like: Testing EFI API implementation Selected test: 'load initrd' Setting up 'load initrd' Setting up 'load initrd' succeeded Executing 'load initrd' Loaded 12378613 bytes CRC32 2997478465 Executing 'load initrd' succeeded Now the size and CRC32 can be compared to the provided file. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: unit test for EFI_RNG_PROTOCOLHeinrich Schuchardt2020-01-071-0/+1
| | | | | | | | | Provide a unit test for the EFI_RNG_PROTOCOL. The list of algorithms is read. Two random numbers are generated. The test checks that the two numbers differ. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: enable all UEFI unit tests on the sandboxHeinrich Schuchardt2019-11-121-2/+5
| | | | | | | As we can build relocation code for the sandbox now we should enable the unit tests that had to be disabled up to now. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: use standalone UEFI program for exceptionHeinrich Schuchardt2019-08-291-1/+9
| | | | | | | To fully demonstrate crash outputs for UEFI images provide a standalone UEFI application that tries to invoke an illegal opcode. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: enable Exit() unit test on x86_64Heinrich Schuchardt2019-08-291-3/+3
| | | | | | Enable unit tests for StartImage() and Exit() unit tests on x86_64. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGEHeinrich Schuchardt2019-07-161-0/+1
| | | | | | | | Provide a unit test for SetVirtualAddressMap() and ConvertPointer(). As ConvertPointer() is not implemented yet this will spit out some warnings. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: test variable services at runtimeHeinrich Schuchardt2019-07-061-0/+1
| | | | | | | | | Provide a unit test for the variable services at runtime. Currently we expect EFI_UNSUPPORTED to be returned as the runtime implementation is still missing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: unit test for OpenProtocolInformation()Heinrich Schuchardt2019-06-011-0/+1
| | | | | | | Provide a unit test that checks that the open protocol information is correctly updated when opening and closing protocols. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: Kconfig entries for GetTime(), SetTime()Heinrich Schuchardt2019-06-011-1/+1
| | | | | | | The GetTime() and the SetTime() runtime services are not obligatory. So let's make them customizable. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: rename Unicode collation protocol 2 variablesHeinrich Schuchardt2019-05-191-1/+2
| | | | | | | Rename variables to make it clear they refer to the Unicode collation protocol identified by the EFI_UNICODE_PROTOCOL2_GUID. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: make device path to text protocol customizableHeinrich Schuchardt2019-05-121-1/+1
| | | | | | | The device path to text protocol is not needed for EBBR compliance. So let's make it a customizable option. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: make Unicode collation protocol customizableHeinrich Schuchardt2019-05-121-1/+2
| | | | | | | | | | The Unicode collation protocol is not needed for EBBR compliance. So let's make it a customizable option. The Unicode capitalization table is only needed by this protocol. So let it depend on the Unicode collation protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: unit test for RegisterProtocolNotify()Heinrich Schuchardt2019-05-071-0/+1
| | | | | | Provide a unit test for the RegisterProtocolNotify() boot service. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: need either ACPI table or device treeHeinrich Schuchardt2019-04-231-1/+0
| | | | | | | | | | | | | The EBBR specification prescribes that we should have either an ACPI table or a device tree but not both. Let us enforce this condition in the `bootefi` command. If the bootefi command is called without a device tree parameter use a previously device tree or fall back to the internal device tree. The fdt unit test should not be run on boards with an ACPI table. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: do not run FDT test with ACPI table.Heinrich Schuchardt2019-04-231-0/+4
| | | | | | | | | | | The EBBR specification prescribes that we should have either an ACPI table or a device tree but not both. So do not run the device tree unit test on boards with an ACPI table. Hence there is no need any longer to make it 'on request' only. Do not pass $fdtcontroladdr to `bootefi selftest`. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: LoadImage from file device pathHeinrich Schuchardt2019-02-161-0/+3
| | | | | | | Provide a unit test that calls LoadImage() with a file device path and executes the application via StartImage(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: Make HII a config optionAlexander Graf2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the HII protocols by default. Instead, let's make it a config option that people can play with This way, we can stabilize the code in tree without breaking any users. Once someone figures out, why this breaks iPXE (probably a NULL dereference), we can enable it by default. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - Remove HII selftest as well v2 -> v3: - Make config option
* efi_selftest: add HII database protocols testAKASHI Takahiro2019-02-131-0/+1
| | | | | | | This efi_selftest tests HII database protocol and HII string protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: consistent build flags for EFI applicationsHeinrich Schuchardt2019-02-131-2/+2
| | | | | | | | At the same time adding and removing the -Os flag does not make any sense. Actually it leads to -Os not being used. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: allow building on ARMv7-MHeinrich Schuchardt2019-02-131-3/+3
| | | | | | | | | ARMv7-M only supports the Thumb instruction set. Our current crt0 code does not support it. With the patch we can build all unit tests of the EFI subsystem that do not require crt0. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: add test for memory allocationHeinrich Schuchardt2018-12-021-0/+1
| | | | | | | | This unit test checks the following runtime services: AllocatePages, FreePages, GetMemoryMap Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: test handling of exceptionsHeinrich Schuchardt2018-12-021-0/+1
| | | | | | | | | Test the handling of execptions by trying to execute an undefined instruction. For 32bit ARM we expect \selftest to be listed as loaded image. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: simplify lib/efi_selftest/MakefileHeinrich Schuchardt2018-12-021-8/+2
| | | | | | | | | | We should not make anything in lib/efi_selftest if CONFIG_CMD_BOOTEFI_SELFTEST is not defined. We can make that test in lib/Makefile Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOLHeinrich Schuchardt2018-09-231-0/+1
| | | | | | | Provide a unit test for the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: EFI_UNICODE_COLLATION_PROTOCOLHeinrich Schuchardt2018-09-231-0/+1
| | | | | | | Provide a unit test for the EFI_UNICODE_COLLATION_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: test for loaded image protocolHeinrich Schuchardt2018-09-231-0/+1
| | | | | | | | Verify that the loaded image protocol is installed on the image handle. Verify that the loaded image protocol points to the system table. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: unit test for GetTime()Heinrich Schuchardt2018-07-251-0/+1
| | | | | | | Provide a unit test for the GetTime() runtime service. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: unit test for CalculateCrc32()Heinrich Schuchardt2018-07-251-0/+1
| | | | | | | | | This unit test checks the CalculateCrc32 bootservice and checks the headers of the system table, the boot services tablle, and the runtime services table before and after ExitBootServices(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: test InstallConfigurationTable()Heinrich Schuchardt2018-07-251-0/+1
| | | | | | | | | | Provide a unit test for InstallConfigurationTable(). A table is installed, updated, removed. The table entry and the triggering of events is checked. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Disable miniapps on sandboxAlexander Graf2018-07-251-1/+1
| | | | | | | | | | In the sandbox environment we can not easily build efi stub binaries right now, so let's disable the respective test cases for the efi selftest suite. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: test unaligned memory accessHeinrich Schuchardt2018-06-031-0/+4
| | | | | | | | According to the UEFI spec unaligned memory access should be enabled on CPUs supporting it. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: unit test for variable servicesHeinrich Schuchardt2018-06-031-0/+1
| | | | | | | Provide a unit test for variable services. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* SPDX: Convert a few files that were missed beforeTom Rini2018-05-101-4/+2
| | | | | | | | | | | As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by: Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_selftest: test EFI_DEVICE_PATH_UTILITIES_PROTOCOLHeinrich Schuchardt2018-04-231-0/+1
| | | | | | | Provide unit tests for the EFI_DEVICE_PATH_UTILITIES_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_selftest: unit test for event groupsHeinrich Schuchardt2018-04-041-0/+1
| | | | | | | | | | Supply a unit test for event groups. Create multiple events in an event group. Signal each event once and check that all events are notified once in each round. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>