From 0703f5923baa92026fab87272ca208825901809e Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Wed, 2 Jun 2021 10:11:19 +0200 Subject: doc: usage: reorder commands in index.rst Reorder alphabetically the command in the index of usage in U-Boot documentation. Signed-off-by: Patrick Delaunay Reviewed-by: Heinrich Schuchardt --- doc/usage/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/usage/index.rst b/doc/usage/index.rst index c1f9b6a53b..41b247bc62 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -34,12 +34,12 @@ Shell commands load loady mbr - mmc md + mmc pstore qfw + reset sbi + scp03 size true - scp03 - reset -- cgit From ed9720d0550693cd8a9087906cc8264f86f59fd7 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Wed, 2 Jun 2021 13:56:45 +0200 Subject: doc: usage: man-page for pinmux command Provide a man-page for the pinmux command. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- doc/usage/index.rst | 1 + doc/usage/pinmux.rst | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 doc/usage/pinmux.rst diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 41b247bc62..e5717b7141 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -36,6 +36,7 @@ Shell commands mbr md mmc + pinmux pstore qfw reset diff --git a/doc/usage/pinmux.rst b/doc/usage/pinmux.rst new file mode 100644 index 0000000000..9f4392cd0d --- /dev/null +++ b/doc/usage/pinmux.rst @@ -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. -- cgit From 6b8d9c92fc5bebc190a3926be8bd1937ea459b0b Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 4 Jun 2021 18:51:46 +0200 Subject: cmd: Add dependency for ums command Add the missing dependency for the command ums: - CONFIG_BLK: call of blk_* functions in usb_mass_storage.c - CONFIG_USB_GADGET: required to select CONFIG_USB_FUNCTION_MASS_STORAGE Signed-off-by: Patrick Delaunay Reviewed-by: Heinrich Schuchardt --- cmd/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index f962bb7141..a9fb4eead2 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -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" -- cgit From 6a1d65e59f43ffcaf19fc75fd272bc4cc6dbe85d Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 4 Jun 2021 18:51:47 +0200 Subject: doc: usage: man-page for ums command Provide a man-page for the ums command - USB Mass Storage. Signed-off-by: Patrick Delaunay Reviewed-by: Heinrich Schuchardt --- doc/usage/index.rst | 1 + doc/usage/ums.rst | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 doc/usage/ums.rst diff --git a/doc/usage/index.rst b/doc/usage/index.rst index e5717b7141..843b4371f1 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -44,3 +44,4 @@ Shell commands scp03 size true + ums diff --git a/doc/usage/ums.rst b/doc/usage/ums.rst new file mode 100644 index 0000000000..3cde5fa1f2 --- /dev/null +++ b/doc/usage/ums.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +ums command +=========== + +Synopsis +-------- + +:: + + ums [] + +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 `) +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). -- cgit From 3dca77b1dc1b6dbf9c8b51572fe4b0553cef009f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 25 May 2021 18:00:13 +0200 Subject: efi_loader: partition numbers are hexadecimal If we want to address partition 15 of virtio block device 11, we have to write: virtio b:f When calling sprintf() we must use %x for the device and partition numbers. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_disk.c | 4 ++-- lib/efi_loader/efi_var_file.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 307d5d759b..988907ecb9 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -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); diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c index b171d2d1a8..de076b8cbc 100644 --- a/lib/efi_loader/efi_var_file.c +++ b/lib/efi_loader/efi_var_file.c @@ -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); -- cgit From e27b0ff1b7135f966c1379acde48134dd6b15545 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 2 Jun 2021 19:28:22 +0200 Subject: efi_loader: efi_capsule_delete_file() NULL dereference If opening a file fails, the file handle pointer is not valid and must not be dereferenced. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 9ead0d2c78..60309d4a07 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -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; } -- cgit From b95e5edc424a14c1d03848c03f92389a945d3e61 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 9 Jun 2021 00:21:24 +0200 Subject: efi_loader: fix Sphinx warning Brackets '[' need to be escaped to avoid a build warning lib/efi_loader/efi_image_loader.c:223: WARNING: Inline strong start-string without end-string. Signed-off-by: Heinrich Schuchardt Reviewed-by: Masahisa Kojima --- lib/efi_loader/efi_image_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index bcd57f7fcc..a0eb63fceb 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -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. -- cgit