mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 06:52:34 -04:00
Add functionality for loading firmware files provided by the vendor to be flashed into the device's internal flash memory. The firmware consists of several components, such as the firmware executable itself, chip-specific customizations, and configuration files. The firmware file contains at least a flash utility, which is executed on the device side, and one or more flashable components. Each component has its own specific properties, such as the address where it should be loaded during flashing, one or more destination flash pages, and the flashing method that should be used. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Link: https://patch.msgid.link/20250909091532.11790-4-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef _ZL3073X_FW_H
|
|
#define _ZL3073X_FW_H
|
|
|
|
/*
|
|
* enum zl3073x_fw_component_id - Identifiers for possible flash components
|
|
*/
|
|
enum zl3073x_fw_component_id {
|
|
ZL_FW_COMPONENT_INVALID = -1,
|
|
ZL_FW_COMPONENT_UTIL = 0,
|
|
ZL_FW_COMPONENT_FW1,
|
|
ZL_FW_COMPONENT_FW2,
|
|
ZL_FW_COMPONENT_FW3,
|
|
ZL_FW_COMPONENT_CFG0,
|
|
ZL_FW_COMPONENT_CFG1,
|
|
ZL_FW_COMPONENT_CFG2,
|
|
ZL_FW_COMPONENT_CFG3,
|
|
ZL_FW_COMPONENT_CFG4,
|
|
ZL_FW_COMPONENT_CFG5,
|
|
ZL_FW_COMPONENT_CFG6,
|
|
ZL_FW_NUM_COMPONENTS
|
|
};
|
|
|
|
/**
|
|
* struct zl3073x_fw_component - Firmware component
|
|
* @id: Flash component ID
|
|
* @size: Size of the buffer
|
|
* @data: Pointer to buffer with component data
|
|
*/
|
|
struct zl3073x_fw_component {
|
|
enum zl3073x_fw_component_id id;
|
|
size_t size;
|
|
void *data;
|
|
};
|
|
|
|
/**
|
|
* struct zl3073x_fw - Firmware bundle
|
|
* @component: firmware components array
|
|
*/
|
|
struct zl3073x_fw {
|
|
struct zl3073x_fw_component *component[ZL_FW_NUM_COMPONENTS];
|
|
};
|
|
|
|
struct zl3073x_fw *zl3073x_fw_load(struct zl3073x_dev *zldev, const char *data,
|
|
size_t size, struct netlink_ext_ack *extack);
|
|
void zl3073x_fw_free(struct zl3073x_fw *fw);
|
|
|
|
int zl3073x_fw_flash(struct zl3073x_dev *zldev, struct zl3073x_fw *zlfw,
|
|
struct netlink_ext_ack *extack);
|
|
|
|
#endif /* _ZL3073X_FW_H */
|