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.
This commit is contained in:
Tom Rini
2020-11-01 10:56:37 -05:00
20 changed files with 390 additions and 107 deletions

View File

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

View File

@@ -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 via TFTP on DFU supported medium.
* This function is storing data received on DFU supported medium which
* is specified by @dfu_entity_name.
*
* @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")
*
* 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_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")
*
* This function is storing data received on DFU supported medium which
* is specified by @dfu_alt_name.
*
* Return: 0 - on success, error code - otherwise
*/
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("TFTP write support for DFU not available!\n");
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("write support for DFU not available!\n");
return -ENOSYS;
}
#endif

View File

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

View File

@@ -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__ */