Pull request for efi-2022-04-rc6

Documentation:
 
 * Move VxWorks and Plan 9 to HTML documentation
 * Move all command man-pages to a separate directory
 
 Test:
 
 * Fix pylint errors
 
 UEFI
 
 * Fix build flags for initrddump.efi
 
 QEMU
 
 * Remove unused function to get RNG device
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmJF4KwACgkQxIHbvCwF
 GsRehg/6A9iY76CS53cRZEwA1xVxxepBAQ6PsU4qGV6UBBGZnC8POkTZ0DNZtzwv
 UYO6kbf1OQg36QS2LXgzPkLa65SpPyulq4MNMycGnI7MFstcdoDPBzw3RWfcVwuc
 bS1hdAjR6KbX4pKKsEExJ3cF61UHR4R33ENrPYba9RdSV6hFo9WTne9g4po/JAB5
 981ip9xTvfXXLTVsr3/OH0/EnicIP8ln/gkYsfxo8BLNLbdUR0VAMGPDK90uUS55
 srsL2czCrrpRQ0uC2tyf7kHlKGiyRUZKY7VCUfbSCxrxr9WwOdVso/bi7ka9UcsL
 W80SjmFosSSW1tRUydqqiGTHYS05Qmpuk+Kaz6REsA3UVSq/Su5dKPYmFIUqF3QD
 HPi35k+y26/bG2npTVSr0lPLfrS/6AJhxVW5H7Cj6RrkTMyog42dn4cTloy+EWdF
 6Gbtbn0kARRVxJjvZKz4MfaqZMZMpRlkxGmFEXDlWobCMvyBPeS0X7w6JriRnL3u
 sxX9kE0/TgrbeWE8AbkWnSIsnfRqPFtv8PEq+E6iIHuT1eRKpwqYB5//UMuS6c7P
 agla5b0d31bTKbUVKNvuOWLDotPeTKOszPfuuE7IXx+jDavnV7hFqVUp4+Z2tM5V
 z2PC5riOO+i73DgeTTZbGIpSwOskoy4H69OmpbKxx5mMil/4a9I=
 =S3H5
 -----END PGP SIGNATURE-----

Merge tag 'efi-2022-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc6

Documentation:

* Move VxWorks and Plan 9 to HTML documentation
* Move all command man-pages to a separate directory

Test:

* Fix pylint errors

UEFI

* Fix build flags for initrddump.efi

QEMU

* Remove unused function to get RNG device
This commit is contained in:
Tom Rini 2022-03-31 22:35:34 -04:00
commit 5aa5a9b0d2
43 changed files with 128 additions and 136 deletions

View file

@ -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

View file

@ -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
--------

View file

@ -102,5 +102,3 @@ Return value
------------
The return value $? is always 0 (true).

View file

@ -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.
CONFIG_MMC_SPEED_MODE_SET should be enabled. The requested speed mode is
passed as a decimal number according to the following table:
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
========== ==========================
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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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),)

View file

@ -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)
check_call(f'virt-make-fs --partition=gpt --size=+1M --type=vfat {mnt_point} {image_path}',
shell=True)
print(image_path)
yield image_path
return image_path

View file

@ -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 ' \

View file

@ -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)):