From: Simon Glass <sjg@chromium.org>
Export the qfw_locate_file() function to allow other modules to locate
files in the QEMU firmware config without loading them into memory.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
(no changes since v1)
drivers/qfw/qfw.c | 4 ++--
include/qfw.h | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
@@ -212,8 +212,8 @@ int qemu_fwcfg_setup_kernel(struct udevice *qfw_dev, ulong load_addr,
return 0;
}
-static int qfw_locate_file(struct udevice *dev, const char *fname,
- enum fw_cfg_selector *selectp, ulong *sizep)
+int qfw_locate_file(struct udevice *dev, const char *fname,
+ enum fw_cfg_selector *selectp, ulong *sizep)
{
struct fw_file *file;
int ret;
@@ -464,6 +464,18 @@ int qfw_load_file(struct udevice *dev, const char *fname, ulong addr);
*/
int qfw_get_file(struct udevice *dev, const char *fname, struct abuf *loader);
+/**
+ * qfw_locate_file() - Locate a file in the QEMU firmware config
+ *
+ * @dev: UCLASS_QFW device
+ * @fname: Filename to locate
+ * @selectp: Returns the selector for the file
+ * @sizep: Returns the size of the file
+ * Return: 0 on success, -EINVAL if firmware list cannot be read or file not found
+ */
+int qfw_locate_file(struct udevice *dev, const char *fname,
+ enum fw_cfg_selector *selectp, ulong *sizep);
+
/**
* cmd_qfw_e820() - Execute the 'qfw e820' command for x86
*