Pull request for efi-2021-07-rc5

Documentation:
 
 * pinmux and ums man-page
 
 Bug fixes:
 
 * Consider that partition numbers as hexadecimal.
 * Avoid a possible NULL dereference in efi_capsule_delete_file().
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmDAmosACgkQxIHbvCwF
 GsTVnhAAlWvjH4ioojYP4M0vfSIJZzWHMgvyxJ1eoTTK6vfpVUQGG7rvtt6484oV
 HovXZlYu9vISYzazmLwv0tpzuXKqObWwnx7lzfMNihyYhzbhqtEG9DWm6y3srCVj
 PYKEqf3LZQBb69SHN9aguPvC8fpzACTAhUoBjb8Zzyf40+iPdX5HrPRDbANd2N+h
 sIhxpKDegu1jiLzY1+s7hfGYL5sRYbkGzv+juKcDK0W1Ltb9SMWrzBdHOqjsPkw8
 UhIGnySRSmVEXzdkdwSiTJ3Rfm/Oek07Ui0AC2XvPCRZ2Zovt6sZ/fseSs1JNf45
 iBk0WTkirmjyuWysBKn9afiPTxYTnX54EMwkuHidHd8kNWs2UB1N2RC2WCychgll
 8l3gnT3ApA18WgCsSXUo4uh/QXRnW9xWP4CtWC7rmgH+GxZpzpzmKyjYQNO0iiDK
 SD+cDlLs77YeqcE9ZDfdTSoEWAVzrgWvFt9mQnzrMcEfR1LYspY2fub7h90jYFXx
 uPSL82lf++bo6lxDHRy/tH4uIPf1TnaOzPSvKSJF6MDj/JY1oQwO1Xks16ZDqNl0
 e6MINd7Giaq3dOHxLXBzTzoMKRtYVHXzvep0jbZwhb36gwqVjdIsNJSBr4yon0n4
 HqZePt+3LDUdzsgvbi0goz4q5xjTLxIsqid25/dj2dS+rNWq0bI=
 =LS0d
 -----END PGP SIGNATURE-----

Merge tag 'efi-2021-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc5

Documentation:

* pinmux and ums man-page

Bug fixes:

* Consider that partition numbers as hexadecimal.
* Avoid a possible NULL dereference in efi_capsule_delete_file().
This commit is contained in:
Tom Rini 2021-06-09 08:20:24 -04:00
commit 5e425a31d3
8 changed files with 167 additions and 9 deletions

View file

@ -1346,8 +1346,11 @@ config CMD_ROCKUSB
config CMD_USB_MASS_STORAGE
bool "UMS usb mass storage"
select USB_FUNCTION_MASS_STORAGE
depends on BLK && USB_GADGET
help
USB mass storage support
Enables the command "ums" and the USB mass storage support to the
export a block device: U-Boot, the USB device, acts as a simple
external hard drive plugged on the host USB port.
config CMD_PVBLOCK
bool "Xen para-virtualized block device"

View file

@ -34,12 +34,14 @@ Shell commands
load
loady
mbr
mmc
md
mmc
pinmux
pstore
qfw
reset
sbi
scp03
size
true
scp03
reset
ums

95
doc/usage/pinmux.rst Normal file
View file

@ -0,0 +1,95 @@
.. SPDX-License-Identifier: GPL-2.0+:
pinmux command
==============
Synopsis
--------
::
pinmux list
pinmux dev [pincontroller-name]
pinmux status [-a | pin-name]
Description
-----------
The pinmux command is used to show the pin-controller muxing.
The 'pinmux list' command diplays the available pin-controller.
The 'pinmux dev' command selects the pin-controller for next commands.
pincontroller-name
name of the pin-controller to select
The 'pinmux status' command displays the pin muxing information.
\-a
display pin muxing of all pin-controllers.
pin-name
name of the pin to display
Example
-------
::
=> pinmux list
| Device | Driver | Parent
| pinctrl-gpio | sandbox_pinctrl_gpio | root_driver
| pinctrl | sandbox_pinctrl | root_driver
=>
=> pinmux dev pinctrl
dev: pinctrl
=>
=> pinmux status
P0 : UART TX.
P1 : UART RX.
P2 : I2S SCK.
P3 : I2S SD.
P4 : I2S WS.
P5 : GPIO0 bias-pull-up input-disable.
P6 : GPIO1 drive-open-drain.
P7 : GPIO2 bias-pull-down input-enable.
P8 : GPIO3 bias-disable.
=>
=> pinmux status P0
P0 : UART TX.
=>
=> pinmux status -a
--------------------------
pinctrl-gpio:
a0 : gpio input .
a1 : gpio input .
a2 : gpio input .
a3 : gpio input .
a4 : gpio input .
a5 : gpio output .
a6 : gpio output .
a7 : gpio input .
a8 : gpio input .
a9 : gpio input .
--------------------------
pinctrl:
P0 : UART TX.
P1 : UART RX.
P2 : I2S SCK.
P3 : I2S SD.
P4 : I2S WS.
P5 : GPIO0 bias-pull-up input-disable.
P6 : GPIO1 drive-open-drain.
P7 : GPIO2 bias-pull-down input-enable.
P8 : GPIO3 bias-disable.
Configuration
-------------
The pinmux command is only available if CONFIG_CMD_PINMUX=y.
Return value
------------
The return value $? is set to 0 (true) if the command succeded and to 1 (false)
otherwise.

57
doc/usage/ums.rst Normal file
View file

@ -0,0 +1,57 @@
.. SPDX-License-Identifier: GPL-2.0+
ums command
===========
Synopsis
--------
::
ums <dev> [<interface>] <devnum[:partnum]>
Description
-----------
Use the USB Mass Storage class (also known as UMS) to make accessible an U-Boot
block device (fully or with :ref:`U-Boot's partition syntax <partitions>`)
to a USB host and to enable file transfers. U-Boot, the USB device, acts as a
simple external hard drive plugged on the host USB port.
This command "ums" stays in the USB's treatment loop until user enters Ctrl-C.
dev
USB gadget device number
interface
interface for accessing the block device (mmc, sata, scsi, usb, ....)
defaults is "mmc"
devnum
device number for selected interface
partnum
partition number or 0 to expose all partitions, defaults to 0
Example
-------
::
=> ums 0 mmc 0
=> ums 0 usb 1:2
Configuration
-------------
The ums command is only available if CONFIG_CMD_USB_MASS_STORAGE=y
and depends on CONFIG_USB_USB_GADGET and CONFIG_BLK.
Return value
------------
The return value $? is set to 0 (true) when the USB stack was successfully
started and interrupted, with Ctrl-C or after USB cable issue (detection
timeout or cable removal).
If an error occurs, the return value $? is set to 1 (false).

View file

@ -901,7 +901,8 @@ static efi_status_t efi_capsule_delete_file(const u16 *filename)
/* ignore an error */
EFI_CALL((*dirh->close)(dirh));
ret = EFI_CALL((*fh->delete)(fh));
if (ret == EFI_SUCCESS)
ret = EFI_CALL((*fh->delete)(fh));
return ret;
}

View file

@ -476,7 +476,7 @@ static efi_status_t efi_disk_add_dev(
efi_system_partition.if_type = desc->if_type;
efi_system_partition.devnum = desc->devnum;
efi_system_partition.part = part;
EFI_PRINT("EFI system partition: %s %d:%d\n",
EFI_PRINT("EFI system partition: %s %x:%x\n",
blk_get_if_type_name(desc->if_type),
desc->devnum, part);
}
@ -521,7 +521,7 @@ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
if (part_get_info(desc, part, &info))
continue;
snprintf(devname, sizeof(devname), "%s:%d", pdevname,
snprintf(devname, sizeof(devname), "%s:%x", pdevname,
part);
ret = efi_disk_add_dev(parent, dp, if_typename, desc, diskid,
&info, part, NULL);

View file

@ -220,7 +220,7 @@ static void efi_set_code_and_data_type(
* @end: End address of region (excluded)
* @nocheck: flag against overlapped regions
*
* Take one entry of region [@start, @end[ and insert it into the list.
* Take one entry of region \[@start, @end\[ and insert it into the list.
*
* * If @nocheck is false, the list will be sorted ascending by address.
* Overlapping entries will not be allowed.

View file

@ -35,7 +35,7 @@ static efi_status_t __maybe_unused efi_set_blk_dev_to_system_partition(void)
log_err("No EFI system partition\n");
return EFI_DEVICE_ERROR;
}
snprintf(part_str, PART_STR_LEN, "%u:%u",
snprintf(part_str, PART_STR_LEN, "%x:%x",
efi_system_partition.devnum, efi_system_partition.part);
r = fs_set_blk_dev(blk_get_if_type_name(efi_system_partition.if_type),
part_str, FS_TYPE_ANY);