diff options
| author | Tom Rini <[email protected]> | 2025-10-09 13:50:59 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-09 13:50:59 -0600 |
| commit | 8cc77c78b0bc44aab44aa00e9a0ceab14ffe2017 (patch) | |
| tree | d2d86c319404adb0d6311615c9c513983dcfc51d /include | |
| parent | a1fd7a9589bf150c6f79d3a37fbc426f00a8af94 (diff) | |
| parent | 50fc92938623be4a1cf1993c703812643afc9cdd (diff) | |
Merge patch series "fw_loader: Split from fs_loader into separate library file"
This series from Marek Vasut <[email protected]> splits
the fw_loader "script" code out from the fs_loader code as the former
does not require the latter.
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
| -rw-r--r-- | include/fs_loader.h | 25 | ||||
| -rw-r--r-- | include/fw_loader.h | 34 |
2 files changed, 34 insertions, 25 deletions
diff --git a/include/fs_loader.h b/include/fs_loader.h index 3afd9e62b4a..7e16e0f7030 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -65,29 +65,4 @@ int request_firmware_into_buf(struct udevice *dev, */ int get_fs_loader(struct udevice **dev); -/** - * request_firmware_into_buf_via_script() - - * Load firmware using a U-Boot script and copy to buffer - * @buf: Pointer to a pointer where the firmware buffer will be stored. - * @max_size: Maximum allowed size for the firmware to be loaded. - * @script_name: Name of the U-Boot script to execute for firmware loading. - * @retsize: Return the actual firmware data size (optional). - * - * Executes a U-Boot script (@script_name) that loads firmware into - * memory and sets the environment variables 'fw_addr' (address) and - * 'fw_size' (size in bytes). On success, copies the firmware - * from the given address to user buffer @buf. - * - * The script must set these environment variables: - * fw_addr - Address where firmware is loaded in memory - * fw_size - Size of the firmware in bytes - * - * The script should be defined in the U-Boot environment, for example: - * env set script_name 'load mmc 0:1 ${loadaddr} firmware.bin && - * env set fw_addr ${loadaddr} && env set fw_size ${filesize} - * Return: 0 on success, negative value on error. - */ -int request_firmware_into_buf_via_script(void *buf, size_t max_size, - const char *script_name, - size_t *retsize); #endif diff --git a/include/fw_loader.h b/include/fw_loader.h new file mode 100644 index 00000000000..35574482b2b --- /dev/null +++ b/include/fw_loader.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Lucien Jheng <[email protected]> + */ +#ifndef _FW_LOADER_H_ +#define _FW_LOADER_H_ + +/** + * request_firmware_into_buf_via_script() - + * Load firmware using a U-Boot script and copy to buffer + * @buf: Pointer to a pointer where the firmware buffer will be stored. + * @max_size: Maximum allowed size for the firmware to be loaded. + * @script_name: Name of the U-Boot script to execute for firmware loading. + * @retsize: Return the actual firmware data size (optional). + * + * Executes a U-Boot script (@script_name) that loads firmware into + * memory and sets the environment variables 'fw_addr' (address) and + * 'fw_size' (size in bytes). On success, copies the firmware + * from the given address to user buffer @buf. + * + * The script must set these environment variables: + * fw_addr - Address where firmware is loaded in memory + * fw_size - Size of the firmware in bytes + * + * The script should be defined in the U-Boot environment, for example: + * env set script_name 'load mmc 0:1 ${loadaddr} firmware.bin && + * env set fw_addr ${loadaddr} && env set fw_size ${filesize} + * Return: 0 on success, negative value on error. + */ +int request_firmware_into_buf_via_script(void *buf, size_t max_size, + const char *script_name, + size_t *retsize); + +#endif |
