diff options
author | Tom Rini <trini@konsulko.com> | 2020-11-01 10:56:37 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-11-01 10:56:37 -0500 |
commit | 41cab8edbcf38bce5cddf54957618dd4205d008f (patch) | |
tree | efe29a6e552133360d8303fc44b025ecf2cc1b95 /include | |
parent | 2c31d7e746766f47a007f39c030706e493a9cc77 (diff) | |
parent | af11423eb06d68784647b879cac57d7b6619d095 (diff) | |
download | u-boot-41cab8edbcf38bce5cddf54957618dd4205d008f.tar.gz u-boot-41cab8edbcf38bce5cddf54957618dd4205d008f.tar.bz2 u-boot-41cab8edbcf38bce5cddf54957618dd4205d008f.zip |
Merge tag 'efi-2020-01-rc2-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc2 (2)
The series contains the following enhancements
* preparatory patches for UEFI capsule updates
* initialization of the emulated RTC using an environment variable
and a bug fix
* If DisconnectController() is called for a child controller that is the
only child of the driver, the driver must be disconnected.
Diffstat (limited to 'include')
-rw-r--r-- | include/charset.h | 2 | ||||
-rw-r--r-- | include/dfu.h | 57 | ||||
-rw-r--r-- | include/efi_loader.h | 3 | ||||
-rw-r--r-- | include/image.h | 12 |
4 files changed, 58 insertions, 16 deletions
diff --git a/include/charset.h b/include/charset.h index 5564f3bce5..cc650a2ce7 100644 --- a/include/charset.h +++ b/include/charset.h @@ -219,7 +219,7 @@ size_t u16_strlen(const void *in); size_t u16_strsize(const void *in); /** - * u16_strlen - count non-zero words + * u16_strnlen() - count non-zero words * * This function matches wscnlen_s() if the -fshort-wchar compiler flag is set. * In the EFI context we explicitly need a function handling u16 strings. diff --git a/include/dfu.h b/include/dfu.h index 84abdc79ac..a767adee41 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -158,6 +158,9 @@ struct dfu_entity { unsigned int inited:1; }; +struct list_head; +extern struct list_head dfu_list; + #ifdef CONFIG_SET_DFU_ALT_INFO /** * set_dfu_alt_info() - set dfu_alt_info environment variable @@ -493,28 +496,52 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr, } #endif +#if CONFIG_IS_ENABLED(DFU_WRITE_ALT) /** - * dfu_tftp_write() - write TFTP data to DFU medium + * dfu_write_by_name() - write data to DFU medium + * @dfu_entity_name: Name of DFU entity to write + * @addr: Address of data buffer to write + * @len: Number of bytes + * @interface: Destination DFU medium (e.g. "mmc") + * @devstring: Instance number of destination DFU medium (e.g. "1") + * + * This function is storing data received on DFU supported medium which + * is specified by @dfu_entity_name. * - * This function is storing data received via TFTP on DFU supported medium. + * Return: 0 - on success, error code - otherwise + */ +int dfu_write_by_name(char *dfu_entity_name, void *addr, + unsigned int len, char *interface, char *devstring); + +/** + * dfu_write_by_alt() - write data to DFU medium + * @dfu_alt_num: DFU alt setting number + * @addr: Address of data buffer to write + * @len: Number of bytes + * @interface: Destination DFU medium (e.g. "mmc") + * @devstring: Instance number of destination DFU medium (e.g. "1") * - * @dfu_entity_name: name of DFU entity to write - * @addr: address of data buffer to write - * @len: number of bytes - * @interface: destination DFU medium (e.g. "mmc") - * @devstring: instance number of destination DFU medium (e.g. "1") + * This function is storing data received on DFU supported medium which + * is specified by @dfu_alt_name. * - * Return: 0 on success, otherwise error code + * Return: 0 - on success, error code - otherwise */ -#if CONFIG_IS_ENABLED(DFU_TFTP) -int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, - char *interface, char *devstring); +int dfu_write_by_alt(int dfu_alt_num, void *addr, unsigned int len, + char *interface, char *devstring); #else -static inline int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, - unsigned int len, char *interface, - char *devstring) +static inline int dfu_write_by_name(char *dfu_entity_name, void *addr, + unsigned int len, char *interface, + char *devstring) +{ + puts("write support for DFU not available!\n"); + return -ENOSYS; +} + +static inline int dfu_write_by_alt(int dfu_alt_num, void *addr, + unsigned int len, char *interface, + char *devstring) { - puts("TFTP write support for DFU not available!\n"); + puts("write support for DFU not available!\n"); return -ENOSYS; } #endif diff --git a/include/efi_loader.h b/include/efi_loader.h index 7eea5566fd..f550ced568 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -804,6 +804,9 @@ bool efi_image_parse(void *efi, size_t len, struct efi_image_regions **regp, /* runtime implementation of memcpy() */ void efi_memcpy_runtime(void *dest, const void *src, size_t n); +/* commonly used helper function */ +u16 *efi_create_indexed_name(u16 *buffer, const char *name, unsigned int index); + #else /* CONFIG_IS_ENABLED(EFI_LOADER) */ /* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */ diff --git a/include/image.h b/include/image.h index 4094ee588a..00bc03bebe 100644 --- a/include/image.h +++ b/include/image.h @@ -1602,4 +1602,16 @@ struct fit_loadable_tbl { .handler = _handler, \ } +/** + * fit_update - update storage with FIT image + * @fit: Pointer to FIT image + * + * Update firmware on storage using FIT image as input. + * The storage area to be update will be identified by the name + * in FIT and matching it to "dfu_alt_info" variable. + * + * Return: 0 on success, non-zero otherwise + */ +int fit_update(const void *fit); + #endif /* __IMAGE_H__ */ |