summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/emulation/qemu-arm/qemu-arm.c42
-rw-r--r--doc/usage/cmd/acpi.rst (renamed from doc/usage/acpi.rst)0
-rw-r--r--doc/usage/cmd/addrmap.rst (renamed from doc/usage/addrmap.rst)0
-rw-r--r--doc/usage/cmd/askenv.rst (renamed from doc/usage/askenv.rst)0
-rw-r--r--doc/usage/cmd/base.rst (renamed from doc/usage/base.rst)0
-rw-r--r--doc/usage/cmd/bootefi.rst (renamed from doc/usage/bootefi.rst)0
-rw-r--r--doc/usage/cmd/booti.rst (renamed from doc/usage/booti.rst)0
-rw-r--r--doc/usage/cmd/bootmenu.rst (renamed from doc/usage/bootmenu.rst)0
-rw-r--r--doc/usage/cmd/button.rst (renamed from doc/usage/button.rst)0
-rw-r--r--doc/usage/cmd/cbsysinfo.rst (renamed from doc/usage/x86/cbsysinfo.rst)0
-rw-r--r--doc/usage/cmd/conitrace.rst (renamed from doc/usage/conitrace.rst)0
-rw-r--r--doc/usage/cmd/echo.rst (renamed from doc/usage/echo.rst)0
-rw-r--r--doc/usage/cmd/exception.rst (renamed from doc/usage/exception.rst)0
-rw-r--r--doc/usage/cmd/exit.rst (renamed from doc/usage/exit.rst)0
-rw-r--r--doc/usage/cmd/extension.rst (renamed from doc/usage/extension.rst)4
-rw-r--r--doc/usage/cmd/false.rst (renamed from doc/usage/false.rst)0
-rw-r--r--doc/usage/cmd/fatinfo.rst (renamed from doc/usage/fatinfo.rst)0
-rw-r--r--doc/usage/cmd/fatload.rst (renamed from doc/usage/fatload.rst)0
-rw-r--r--doc/usage/cmd/for.rst (renamed from doc/usage/for.rst)0
-rw-r--r--doc/usage/cmd/load.rst (renamed from doc/usage/load.rst)0
-rw-r--r--doc/usage/cmd/loady.rst (renamed from doc/usage/loady.rst)0
-rw-r--r--doc/usage/cmd/mbr.rst (renamed from doc/usage/mbr.rst)0
-rw-r--r--doc/usage/cmd/md.rst (renamed from doc/usage/md.rst)2
-rw-r--r--doc/usage/cmd/mmc.rst (renamed from doc/usage/mmc.rst)36
-rw-r--r--doc/usage/cmd/pinmux.rst (renamed from doc/usage/pinmux.rst)0
-rw-r--r--doc/usage/cmd/pstore.rst (renamed from doc/usage/pstore.rst)0
-rw-r--r--doc/usage/cmd/qfw.rst (renamed from doc/usage/qfw.rst)0
-rw-r--r--doc/usage/cmd/reset.rst (renamed from doc/usage/reset.rst)0
-rw-r--r--doc/usage/cmd/sbi.rst (renamed from doc/usage/sbi.rst)0
-rw-r--r--doc/usage/cmd/scp03.rst (renamed from doc/usage/scp03.rst)0
-rw-r--r--doc/usage/cmd/setexpr.rst (renamed from doc/usage/setexpr.rst)0
-rw-r--r--doc/usage/cmd/sf.rst (renamed from doc/usage/sf.rst)0
-rw-r--r--doc/usage/cmd/size.rst (renamed from doc/usage/size.rst)0
-rw-r--r--doc/usage/cmd/true.rst (renamed from doc/usage/true.rst)0
-rw-r--r--doc/usage/cmd/ums.rst (renamed from doc/usage/ums.rst)0
-rw-r--r--doc/usage/cmd/wdt.rst (renamed from doc/usage/wdt.rst)0
-rw-r--r--doc/usage/index.rst79
-rw-r--r--doc/usage/os/plan9.rst (renamed from doc/README.plan9)12
-rw-r--r--doc/usage/os/vxworks.rst (renamed from doc/README.vxworks)31
-rw-r--r--lib/efi_loader/Makefile2
-rw-r--r--test/py/tests/test_efi_bootmgr/conftest.py14
-rw-r--r--test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py13
-rw-r--r--test/py/tests/test_efi_fit.py31
43 files changed, 129 insertions, 137 deletions
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index 16d5a97167a..c9e886e44a5 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -107,48 +107,6 @@ void enable_caches(void)
dcache_enable();
}
-#if defined(CONFIG_EFI_RNG_PROTOCOL)
-#include <efi_loader.h>
-#include <efi_rng.h>
-
-#include <dm/device-internal.h>
-
-efi_status_t platform_get_rng_device(struct udevice **dev)
-{
- int ret;
- efi_status_t status = EFI_DEVICE_ERROR;
- struct udevice *bus, *devp;
-
- for (uclass_first_device(UCLASS_VIRTIO, &bus); bus;
- uclass_next_device(&bus)) {
- for (device_find_first_child(bus, &devp); devp;
- device_find_next_child(&devp)) {
- if (device_get_uclass_id(devp) == UCLASS_RNG) {
- *dev = devp;
- status = EFI_SUCCESS;
- break;
- }
- }
- }
-
- if (status != EFI_SUCCESS) {
- debug("No rng device found\n");
- return EFI_DEVICE_ERROR;
- }
-
- if (*dev) {
- ret = device_probe(*dev);
- if (ret)
- return EFI_DEVICE_ERROR;
- } else {
- debug("Couldn't get child device\n");
- return EFI_DEVICE_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-#endif /* CONFIG_EFI_RNG_PROTOCOL */
-
#ifdef CONFIG_ARM64
#define __W "w"
#else
diff --git a/doc/usage/acpi.rst b/doc/usage/cmd/acpi.rst
index 14bafc8e352..14bafc8e352 100644
--- a/doc/usage/acpi.rst
+++ b/doc/usage/cmd/acpi.rst
diff --git a/doc/usage/addrmap.rst b/doc/usage/cmd/addrmap.rst
index 472fd547f32..472fd547f32 100644
--- a/doc/usage/addrmap.rst
+++ b/doc/usage/cmd/addrmap.rst
diff --git a/doc/usage/askenv.rst b/doc/usage/cmd/askenv.rst
index 5c4ca35d4cd..5c4ca35d4cd 100644
--- a/doc/usage/askenv.rst
+++ b/doc/usage/cmd/askenv.rst
diff --git a/doc/usage/base.rst b/doc/usage/cmd/base.rst
index db9cd4d9783..db9cd4d9783 100644
--- a/doc/usage/base.rst
+++ b/doc/usage/cmd/base.rst
diff --git a/doc/usage/bootefi.rst b/doc/usage/cmd/bootefi.rst
index 282f22aac96..282f22aac96 100644
--- a/doc/usage/bootefi.rst
+++ b/doc/usage/cmd/bootefi.rst
diff --git a/doc/usage/booti.rst b/doc/usage/cmd/booti.rst
index d631fb571de..d631fb571de 100644
--- a/doc/usage/booti.rst
+++ b/doc/usage/cmd/booti.rst
diff --git a/doc/usage/bootmenu.rst b/doc/usage/cmd/bootmenu.rst
index 1f094ad6ed2..1f094ad6ed2 100644
--- a/doc/usage/bootmenu.rst
+++ b/doc/usage/cmd/bootmenu.rst
diff --git a/doc/usage/button.rst b/doc/usage/cmd/button.rst
index ea417627577..ea417627577 100644
--- a/doc/usage/button.rst
+++ b/doc/usage/cmd/button.rst
diff --git a/doc/usage/x86/cbsysinfo.rst b/doc/usage/cmd/cbsysinfo.rst
index 8c03a85169d..8c03a85169d 100644
--- a/doc/usage/x86/cbsysinfo.rst
+++ b/doc/usage/cmd/cbsysinfo.rst
diff --git a/doc/usage/conitrace.rst b/doc/usage/cmd/conitrace.rst
index d9916c865ee..d9916c865ee 100644
--- a/doc/usage/conitrace.rst
+++ b/doc/usage/cmd/conitrace.rst
diff --git a/doc/usage/echo.rst b/doc/usage/cmd/echo.rst
index 861abdfd1eb..861abdfd1eb 100644
--- a/doc/usage/echo.rst
+++ b/doc/usage/cmd/echo.rst
diff --git a/doc/usage/exception.rst b/doc/usage/cmd/exception.rst
index 27df88bd5c9..27df88bd5c9 100644
--- a/doc/usage/exception.rst
+++ b/doc/usage/cmd/exception.rst
diff --git a/doc/usage/exit.rst b/doc/usage/cmd/exit.rst
index 769223c4775..769223c4775 100644
--- a/doc/usage/exit.rst
+++ b/doc/usage/cmd/exit.rst
diff --git a/doc/usage/extension.rst b/doc/usage/cmd/extension.rst
index 2b88398b18b..6366cf56e72 100644
--- a/doc/usage/extension.rst
+++ b/doc/usage/cmd/extension.rst
@@ -1,8 +1,8 @@
.. SPDX-License-Identifier: GPL-2.0+
.. Copyright 2021, Kory Maincent <kory.maincent@bootlin.com>
-U-Boot extension board usage (CONFIG_EXTENSION)
-===============================================
+extension command
+=================
Synopsis
--------
diff --git a/doc/usage/false.rst b/doc/usage/cmd/false.rst
index a17fe860217..a17fe860217 100644
--- a/doc/usage/false.rst
+++ b/doc/usage/cmd/false.rst
diff --git a/doc/usage/fatinfo.rst b/doc/usage/cmd/fatinfo.rst
index af2eba43447..af2eba43447 100644
--- a/doc/usage/fatinfo.rst
+++ b/doc/usage/cmd/fatinfo.rst
diff --git a/doc/usage/fatload.rst b/doc/usage/cmd/fatload.rst
index 93acb27a536..93acb27a536 100644
--- a/doc/usage/fatload.rst
+++ b/doc/usage/cmd/fatload.rst
diff --git a/doc/usage/for.rst b/doc/usage/cmd/for.rst
index f9e504979c3..f9e504979c3 100644
--- a/doc/usage/for.rst
+++ b/doc/usage/cmd/for.rst
diff --git a/doc/usage/load.rst b/doc/usage/cmd/load.rst
index 1efee773179..1efee773179 100644
--- a/doc/usage/load.rst
+++ b/doc/usage/cmd/load.rst
diff --git a/doc/usage/loady.rst b/doc/usage/cmd/loady.rst
index 2819cc72aef..2819cc72aef 100644
--- a/doc/usage/loady.rst
+++ b/doc/usage/cmd/loady.rst
diff --git a/doc/usage/mbr.rst b/doc/usage/cmd/mbr.rst
index bddf2f612aa..bddf2f612aa 100644
--- a/doc/usage/mbr.rst
+++ b/doc/usage/cmd/mbr.rst
diff --git a/doc/usage/md.rst b/doc/usage/cmd/md.rst
index 4c1073ea354..7e9944e0dc3 100644
--- a/doc/usage/md.rst
+++ b/doc/usage/cmd/md.rst
@@ -102,5 +102,3 @@ Return value
------------
The return value $? is always 0 (true).
-
-
diff --git a/doc/usage/mmc.rst b/doc/usage/cmd/mmc.rst
index 02b5d7b1c77..55e3f9cf98c 100644
--- a/doc/usage/mmc.rst
+++ b/doc/usage/cmd/mmc.rst
@@ -85,22 +85,26 @@ The 'mmc dev' command shows or set current mmc device.
mode
speed mode to set.
- CONFIG_MMC_SPEED_MODE_SET should be enabled. The required speed mode is
- passed as the index from the following list.
-
- 0 - MMC_LEGACY
- 1 - MMC_HS
- 2 - SD_HS
- 3 - MMC_HS_52
- 4 - MMC_DDR_52
- 5 - UHS_SDR12
- 6 - UHS_SDR25
- 7 - UHS_SDR50
- 8 - UHS_DDR50
- 9 - UHS_SDR104
- 10 - MMC_HS_200
- 11 - MMC_HS_400
- 12 - MMC_HS_400_ES
+ CONFIG_MMC_SPEED_MODE_SET should be enabled. The requested speed mode is
+ passed as a decimal number according to the following table:
+
+ ========== ==========================
+ Speed mode Description
+ ========== ==========================
+ 0 MMC legacy
+ 1 MMC High Speed (26MHz)
+ 2 SD High Speed (50MHz)
+ 3 MMC High Speed (52MHz)
+ 4 MMC DDR52 (52MHz)
+ 5 UHS SDR12 (25MHz)
+ 6 UHS SDR25 (50MHz)
+ 7 UHS SDR50 (100MHz)
+ 8 UHS DDR50 (50MHz)
+ 9 UHS SDR104 (208MHz)
+ 10 HS200 (200MHz)
+ 11 HS400 (200MHz)
+ 12 HS400ES (200MHz)
+ ========== ==========================
A speed mode can be set only if it has already been enabled in the device tree
diff --git a/doc/usage/pinmux.rst b/doc/usage/cmd/pinmux.rst
index 9f4392cd0db..9f4392cd0db 100644
--- a/doc/usage/pinmux.rst
+++ b/doc/usage/cmd/pinmux.rst
diff --git a/doc/usage/pstore.rst b/doc/usage/cmd/pstore.rst
index 1c8374513aa..1c8374513aa 100644
--- a/doc/usage/pstore.rst
+++ b/doc/usage/cmd/pstore.rst
diff --git a/doc/usage/qfw.rst b/doc/usage/cmd/qfw.rst
index b3704b92d6d..b3704b92d6d 100644
--- a/doc/usage/qfw.rst
+++ b/doc/usage/cmd/qfw.rst
diff --git a/doc/usage/reset.rst b/doc/usage/cmd/reset.rst
index 384d5d60f81..384d5d60f81 100644
--- a/doc/usage/reset.rst
+++ b/doc/usage/cmd/reset.rst
diff --git a/doc/usage/sbi.rst b/doc/usage/cmd/sbi.rst
index 96d8861057f..96d8861057f 100644
--- a/doc/usage/sbi.rst
+++ b/doc/usage/cmd/sbi.rst
diff --git a/doc/usage/scp03.rst b/doc/usage/cmd/scp03.rst
index 7ff87ed85ac..7ff87ed85ac 100644
--- a/doc/usage/scp03.rst
+++ b/doc/usage/cmd/scp03.rst
diff --git a/doc/usage/setexpr.rst b/doc/usage/cmd/setexpr.rst
index 2e511b12905..2e511b12905 100644
--- a/doc/usage/setexpr.rst
+++ b/doc/usage/cmd/setexpr.rst
diff --git a/doc/usage/sf.rst b/doc/usage/cmd/sf.rst
index 71bd1be5175..71bd1be5175 100644
--- a/doc/usage/sf.rst
+++ b/doc/usage/cmd/sf.rst
diff --git a/doc/usage/size.rst b/doc/usage/cmd/size.rst
index f0c35e48265..f0c35e48265 100644
--- a/doc/usage/size.rst
+++ b/doc/usage/cmd/size.rst
diff --git a/doc/usage/true.rst b/doc/usage/cmd/true.rst
index f9ef71b2d1b..f9ef71b2d1b 100644
--- a/doc/usage/true.rst
+++ b/doc/usage/cmd/true.rst
diff --git a/doc/usage/ums.rst b/doc/usage/cmd/ums.rst
index 3cde5fa1f2a..3cde5fa1f2a 100644
--- a/doc/usage/ums.rst
+++ b/doc/usage/cmd/ums.rst
diff --git a/doc/usage/wdt.rst b/doc/usage/cmd/wdt.rst
index 8d80433c1fa..8d80433c1fa 100644
--- a/doc/usage/wdt.rst
+++ b/doc/usage/cmd/wdt.rst
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 630a6cb28ab..8a54d9cb030 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -18,38 +18,47 @@ Shell commands
.. toctree::
:maxdepth: 1
- acpi
- addrmap
- askenv
- base
- bootefi
- booti
- bootmenu
- button
- x86/cbsysinfo
- conitrace
- echo
- exception
- extension
- exit
- false
- fatinfo
- fatload
- for
- load
- loady
- mbr
- md
- mmc
- pinmux
- pstore
- qfw
- reset
- sbi
- sf
- scp03
- setexpr
- size
- true
- ums
- wdt
+ cmd/acpi
+ cmd/addrmap
+ cmd/askenv
+ cmd/base
+ cmd/bootefi
+ cmd/booti
+ cmd/bootmenu
+ cmd/button
+ cmd/cbsysinfo
+ cmd/conitrace
+ cmd/echo
+ cmd/exception
+ cmd/extension
+ cmd/exit
+ cmd/false
+ cmd/fatinfo
+ cmd/fatload
+ cmd/for
+ cmd/load
+ cmd/loady
+ cmd/mbr
+ cmd/md
+ cmd/mmc
+ cmd/pinmux
+ cmd/pstore
+ cmd/qfw
+ cmd/reset
+ cmd/sbi
+ cmd/sf
+ cmd/scp03
+ cmd/setexpr
+ cmd/size
+ cmd/true
+ cmd/ums
+ cmd/wdt
+
+Booting OS
+----------
+
+.. toctree::
+ :maxdepth: 1
+
+ os/plan9
+ os/vxworks
diff --git a/doc/README.plan9 b/doc/usage/os/plan9.rst
index 2d3d0e0cf62..f91712c0094 100644
--- a/doc/README.plan9
+++ b/doc/usage/os/plan9.rst
@@ -1,3 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Steven Stallion
+.. June 2013
+
+Plan 9
+======
+
Plan 9 from Bell Labs kernel images require additional setup to pass
configuration information to the kernel. An environment variable named
confaddr must be defined with the same value as CONFADDR (see mem.h).
@@ -10,9 +17,6 @@ bootargs environment variable will be copied.
If no command line arguments or bootargs are defined, CONFADDR is left
uninitialized to permit manual configuration. For example, PC-style
-configuration could be simulated by issuing a fatload in bootcmd:
+configuration could be simulated by issuing a fatload in bootcmd::
# setenv bootcmd fatload mmc 0 $confaddr plan9.ini; ...; bootm
-
-Steven Stallion
-June 2013
diff --git a/doc/README.vxworks b/doc/usage/os/vxworks.rst
index 12a0d744d8a..0fe33d2d34c 100644
--- a/doc/README.vxworks
+++ b/doc/usage/os/vxworks.rst
@@ -1,11 +1,10 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2013, Miao Yan <miao.yan@windriver.com>
-# Copyright (C) 2015-2018, Bin Meng <bmeng.cn@gmail.com>
-# Copyright (C) 2019, Lihua Zhao <lihua.zhao@windriver.com>
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2013, Miao Yan <miao.yan@windriver.com>
+.. Copyright (C) 2015-2018, Bin Meng <bmeng.cn@gmail.com>
+.. Copyright (C) 2019, Lihua Zhao <lihua.zhao@windriver.com>
-VxWorks Support
-===============
+VxWorks
+=======
This document describes the information about U-Boot loading VxWorks kernel.
@@ -14,13 +13,13 @@ Status
U-Boot supports loading VxWorks kernels via 'bootvx' and 'bootm' commands.
For booting old kernels (6.9.x) on PowerPC and ARM, and all kernel versions
on other architectures, 'bootvx' shall be used. For booting VxWorks 7 kernels
-on PowerPC and ARM, 'bootm' shall be used.
+on PowerPC/ARM/RISC-V, 'bootm' shall be used.
With CONFIG_EFI_LOADER option, it's possible to chain load a VxWorks x86 kernel
via the UEFI boot loader application for VxWorks loaded by 'bootefi' command.
-VxWorks 7 on PowerPC and ARM
----------------------------
+VxWorks 7 on PowerPC/ARM/RISC-V
+-------------------------------
From VxWorks 7, VxWorks starts adopting device tree as its hardware description
mechanism (for PowerPC and ARM), thus requiring boot interface changes.
This section will describe the new interface.
@@ -37,17 +36,26 @@ is cleared. The calling convention is described below:
For PowerPC, the calling convention of the new VxWorks entry point conforms to
the ePAPR standard, which is shown below (see ePAPR for more details):
+.. code-block:: c
+
void (*kernel_entry)(fdt_addr, 0, 0, EPAPR_MAGIC, boot_IMA, 0, 0)
For ARM, the calling convention is shown below:
+.. code-block:: c
+
void (*kernel_entry)(void *fdt_addr)
When using the Linux compatible standard DTB, the calling convention of VxWorks
entry point is exactly the same as the Linux kernel.
+For RISC-V, there is no legacy bootm flow as VxWorks always uses the same boot
+interface as the Linux kernel, with the calling convention below::
+
+ void (*kernel_entry)(unsigned long hartid, void *fdt_addr)
+
When booting a VxWorks 7 kernel (uImage format), the parameters passed to bootm
-is like below:
+is like below::
bootm <kernel image address> - <device tree address>
@@ -108,6 +116,7 @@ BIOS of the graphics card first.
CONFIG_FRAMEBUFFER_SET_VESA_MODE need remain set but care must be taken
at which VESA mode is to be set. The supported pixel format is 32-bit
RGBA, hence the available VESA mode can only be one of the following:
+
* FRAMEBUFFER_VESA_MODE_10F
* FRAMEBUFFER_VESA_MODE_112
* FRAMEBUFFER_VESA_MODE_115
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index befed7144e7..034d26cf010 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -16,7 +16,7 @@ CFLAGS_helloworld.o := $(CFLAGS_EFI) -Os -ffreestanding
CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
CFLAGS_dtbdump.o := $(CFLAGS_EFI) -Os -ffreestanding
CFLAGS_REMOVE_dtbdump.o := $(CFLAGS_NON_EFI)
-CFLAGS_initrddump_exit.o := $(CFLAGS_EFI) -Os -ffreestanding
+CFLAGS_initrddump.o := $(CFLAGS_EFI) -Os -ffreestanding
CFLAGS_REMOVE_initrddump.o := $(CFLAGS_NON_EFI)
ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
diff --git a/test/py/tests/test_efi_bootmgr/conftest.py b/test/py/tests/test_efi_bootmgr/conftest.py
index 69008fddce7..a0a754afbe1 100644
--- a/test/py/tests/test_efi_bootmgr/conftest.py
+++ b/test/py/tests/test_efi_bootmgr/conftest.py
@@ -4,9 +4,9 @@
"""
import os
-import pytest
import shutil
-from subprocess import call, check_call
+from subprocess import check_call
+import pytest
@pytest.fixture(scope='session')
def efi_bootmgr_data(u_boot_config):
@@ -14,7 +14,7 @@ def efi_bootmgr_data(u_boot_config):
tests
Args:
- u_boot_config: U-boot configuration.
+ u_boot_config -- U-boot configuration.
Return:
A path to disk image to be used for testing
@@ -34,9 +34,7 @@ def efi_bootmgr_data(u_boot_config):
shutil.copyfile(u_boot_config.build_dir + '/lib/efi_loader/initrddump.efi',
mnt_point + '/initrddump.efi')
- check_call('virt-make-fs --partition=gpt --size=+1M --type=vfat {} {}'
- .format(mnt_point, image_path), shell=True)
-
- print(image_path)
+ check_call(f'virt-make-fs --partition=gpt --size=+1M --type=vfat {mnt_point} {image_path}',
+ shell=True)
- yield image_path
+ return image_path
diff --git a/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py b/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py
index f87e0a20b80..75a6e7c9629 100644
--- a/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py
+++ b/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0+
+""" Unit test for UEFI bootmanager
+"""
import pytest
@@ -6,7 +8,16 @@ import pytest
@pytest.mark.buildconfigspec('cmd_efidebug')
@pytest.mark.buildconfigspec('cmd_bootefi_bootmgr')
def test_efi_bootmgr(u_boot_console, efi_bootmgr_data):
- u_boot_console.run_command(cmd = 'host bind 0 {}'.format(efi_bootmgr_data))
+ """ Unit test for UEFI bootmanager
+ The efidebug command is used to set up UEFI load options.
+ The bootefi bootmgr loads initrddump.efi as a payload.
+ The crc32 of the loaded initrd.img is checked
+
+ Args:
+ u_boot_console -- U-Boot console
+ efi_bootmgr_data -- Path to the disk image used for testing.
+ """
+ u_boot_console.run_command(cmd = f'host bind 0 {efi_bootmgr_data}')
u_boot_console.run_command(cmd = 'efidebug boot add ' \
'-b 0001 label-1 host 0:1 initrddump.efi ' \
diff --git a/test/py/tests/test_efi_fit.py b/test/py/tests/test_efi_fit.py
index 068a35a559d..92d071f7839 100644
--- a/test/py/tests/test_efi_fit.py
+++ b/test/py/tests/test_efi_fit.py
@@ -203,7 +203,7 @@ def test_efi_fit_launch(u_boot_console):
"""Compute the path of a given (temporary) file.
Args:
- file_name: The name of a file within U-Boot build dir.
+ file_name -- The name of a file within U-Boot build dir.
Return:
The computed file path.
"""
@@ -217,8 +217,8 @@ def test_efi_fit_launch(u_boot_console):
build dir and, optionally, compresses the file using gzip.
Args:
- fname: The target file name within U-Boot build dir.
- comp: Flag to enable gzip compression.
+ fname -- The target file name within U-Boot build dir.
+ comp -- Flag to enable gzip compression.
Return:
The path of the created file.
"""
@@ -238,8 +238,8 @@ def test_efi_fit_launch(u_boot_console):
Creates a DTS file and compiles it to a DTB.
Args:
- fdt_type: The type of the FDT, i.e. internal, user.
- comp: Flag to enable gzip compression.
+ fdt_type -- The type of the FDT, i.e. internal, user.
+ comp -- Flag to enable gzip compression.
Return:
The path of the created file.
"""
@@ -252,7 +252,7 @@ def test_efi_fit_launch(u_boot_console):
# Generate a test FDT file.
dts = make_fpath('test-efi-fit-%s.dts' % fdt_type)
- with open(dts, 'w') as file:
+ with open(dts, 'w', encoding='ascii') as file:
file.write(FDT_DATA % fdt_params)
# Build the test FDT.
@@ -268,7 +268,7 @@ def test_efi_fit_launch(u_boot_console):
Runs 'mkimage' to create a FIT image within U-Boot build dir.
Args:
- comp: Enable gzip compression for the EFI binary and FDT blob.
+ comp -- Enable gzip compression for the EFI binary and FDT blob.
Return:
The path of the created file.
"""
@@ -285,7 +285,7 @@ def test_efi_fit_launch(u_boot_console):
# Generate a test ITS file.
its_path = make_fpath('test-efi-fit-helloworld.its')
- with open(its_path, 'w') as file:
+ with open(its_path, 'w', encoding='ascii') as file:
file.write(ITS_DATA % its_params)
# Build the test ITS.
@@ -298,8 +298,9 @@ def test_efi_fit_launch(u_boot_console):
"""Load the FIT image using the 'host load' command and return its address.
Args:
- fit: Dictionary describing the FIT image to load, see env__efi_fit_test_file
- in the comment at the beginning of this file.
+ fit -- Dictionary describing the FIT image to load, see
+ env__efi_fit_test_file in the comment at the beginning of
+ this file.
Return:
The address where the file has been loaded.
"""
@@ -325,8 +326,8 @@ def test_efi_fit_launch(u_boot_console):
CRC32 are validated.
Args:
- fit: Dictionary describing the FIT image to load, see env__efi_fit_tftp_file
- in the comment at the beginning of this file.
+ fit -- Dictionary describing the FIT image to load, see env__efi_fit_tftp_file
+ in the comment at the beginning of this file.
Return:
The address where the file has been loaded.
"""
@@ -377,9 +378,9 @@ def test_efi_fit_launch(u_boot_console):
Eventually the 'Hello, world' message is expected in the U-Boot console.
Args:
- enable_fdt: Flag to enable using the FDT blob inside FIT image.
- enable_comp: Flag to enable GZIP compression on EFI and FDT
- generated content.
+ enable_fdt -- Flag to enable using the FDT blob inside FIT image.
+ enable_comp -- Flag to enable GZIP compression on EFI and FDT
+ generated content.
"""
with cons.log.section('FDT=%s;COMP=%s' % (enable_fdt, enable_comp)):