diff options
| author | Tom Rini <[email protected]> | 2024-08-24 14:03:28 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-08-24 14:03:28 -0600 |
| commit | ee2af844ba1b27b2e959c4e649e4b769fbeb4074 (patch) | |
| tree | 602c42364f4987b315667ccce5c245779d071da8 | |
| parent | a481740629af5e51732b86b6ead61dc5aa5a440d (diff) | |
| parent | dcd1b63b7072749f98ea0a87565d0ae5c8ddfb65 (diff) | |
Merge tag 'efi-2024-10-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-10-rc4
Documentation:
* Add description of the pwm command
UEFI
* Correct printf codes in mkeficapsule
* Allow CONFIG_EFI_LOADER_BOUNCE_BUFFER on all architectures
* Free memory in efi_get_dp_from_boot()
| -rw-r--r-- | doc/usage/cmd/pwm.rst | 91 | ||||
| -rw-r--r-- | doc/usage/index.rst | 1 | ||||
| -rw-r--r-- | lib/efi_loader/Kconfig | 1 | ||||
| -rw-r--r-- | lib/efi_loader/efi_helper.c | 5 | ||||
| -rw-r--r-- | tools/mkeficapsule.c | 7 |
5 files changed, 99 insertions, 6 deletions
diff --git a/doc/usage/cmd/pwm.rst b/doc/usage/cmd/pwm.rst new file mode 100644 index 00000000000..522acb5afa3 --- /dev/null +++ b/doc/usage/cmd/pwm.rst @@ -0,0 +1,91 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: pwm (command) + +pwm command +=========== + +Synopsis +-------- + +:: + + pwm invert <pwm_dev_num> <channel> <polarity> + pwm config <pwm_dev_num> <channel> <period_ns> <duty_ns> + pwm enable <pwm_dev_num> <channel> + pwm disable <pwm_dev_num> <channel> + + +Description +----------- + +The ``pwm`` command is used to access and configure PWM (Pulse Width Modulation) +signals. + +pwm invert +---------- + +* If the value of ``polarity`` is 0, the default polarity is used. +* If the value of ``polarity`` is 1, the polarity is inverted. + +pwm config +---------- + +Configure the period and duty period in nanoseconds. + +pwm enable +---------- + +Enable output on the configured device and channel. + +pwm disable +----------- + +Disable output on the configured device and channel. + +pwm_dev_num + Device number of the pulse width modulation device + +channel + Output channel of the PWM device + +polarity + * 0 - Use normal polarity + * 1 - Use inverted polarity + +duty_ns + Duty period in ns + +period_ns + Period time in ns + +Examples +-------- + +Configure device 0, channel 0 to 20 µs period and 14 µs (that is, 70%) duty period:: + + => pwm config 0 0 20000 14000 + +Enable output on the configured device and channel:: + + => pwm enable 0 0 + +Disable output on the configured device and channel:: + + => pwm disable 0 0 + +Invert the signal on the configured device and channel:: + + => pwm invert 0 0 1 + +Configuration +------------- + +The ``pwm`` command is only available if CONFIG_CMD_PWM=y. + +Return value +------------ + +If the command succeeds, the return value ``$?`` is set to 0. If an error occurs, the +return value ``$?`` is set to 1. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 1f6518b77c4..6a218c46b4e 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -93,6 +93,7 @@ Shell commands cmd/pinmux cmd/printenv cmd/pstore + cmd/pwm cmd/qfw cmd/read cmd/reset diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 1179c31bb13..6ffefa9103f 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -364,7 +364,6 @@ endif config EFI_LOADER_BOUNCE_BUFFER bool "EFI Applications use bounce buffers for DMA operations" - depends on ARM64 help Some hardware does not support DMA to full 64bit addresses. For this hardware we can create a bounce buffer so that payloads don't have to diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index 65d2116381a..916f43da26c 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -74,6 +74,7 @@ out: */ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t *guid) { + struct efi_device_path *file_path = NULL; struct efi_load_option lo; void *var_value; efi_uintn_t size; @@ -92,11 +93,11 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t *guid) if (ret != EFI_SUCCESS) goto err; - return efi_dp_from_lo(&lo, guid); + file_path = efi_dp_from_lo(&lo, guid); err: free(var_value); - return NULL; + return file_path; } /** diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index f28008a0829..1b53151d41a 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -5,6 +5,7 @@ */ #include <getopt.h> +#include <inttypes.h> #include <pe.h> #include <stdbool.h> #include <stdint.h> @@ -691,7 +692,7 @@ static uint32_t dump_fmp_payload_header( static void dump_capsule_auth_header( struct efi_firmware_image_authentication *capsule_auth_hdr) { - printf("EFI_FIRMWARE_IMAGE_AUTH.MONOTONIC_COUNT\t\t: %08lX\n", + printf("EFI_FIRMWARE_IMAGE_AUTH.MONOTONIC_COUNT\t\t: %08" PRIX64 "\n", capsule_auth_hdr->monotonic_count); printf("EFI_FIRMWARE_IMAGE_AUTH.AUTH_INFO.HDR.dwLENGTH\t: %08X\n", capsule_auth_hdr->auth_info.hdr.dwLength); @@ -724,9 +725,9 @@ static void dump_fmp_capsule_image_header( image_hdr->update_image_size); printf("FMP_CAPSULE_IMAGE_HDR.UPDATE_VENDOR_CODE_SIZE\t: %08X\n", image_hdr->update_vendor_code_size); - printf("FMP_CAPSULE_IMAGE_HDR.UPDATE_HARDWARE_INSTANCE\t: %08lX\n", + printf("FMP_CAPSULE_IMAGE_HDR.UPDATE_HARDWARE_INSTANCE\t: %08" PRIX64 "\n", image_hdr->update_hardware_instance); - printf("FMP_CAPSULE_IMAGE_HDR.IMAGE_CAPSULE_SUPPORT\t: %08lX\n", + printf("FMP_CAPSULE_IMAGE_HDR.IMAGE_CAPSULE_SUPPORT\t: %08" PRIX64 "\n", image_hdr->image_capsule_support); printf("--------\n"); |
