mirror of
https://github.com/torvalds/linux.git
synced 2026-05-03 22:12:32 -04:00
To implement the devlink device flash functionality, the driver needs to access both the device memory and the internal flash memory. The flash memory is accessed using a device-specific program (called the flash utility). This flash utility must be downloaded by the driver into the device memory and then executed by the device CPU. Once running, the flash utility provides a flash API to access the flash memory itself. During this operation, the normal functionality provided by the standard firmware is not available. Therefore, the driver must ensure that DPLL callbacks and monitoring functions are not executed during the flash operation. Add all necessary functions for downloading the utility to device memory, entering and exiting flash mode, and performing flash operations. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Link: https://patch.msgid.link/20250909091532.11790-3-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
30 lines
933 B
C
30 lines
933 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef __ZL3073X_FLASH_H
|
|
#define __ZL3073X_FLASH_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct netlink_ext_ack;
|
|
struct zl3073x_dev;
|
|
|
|
int zl3073x_flash_mode_enter(struct zl3073x_dev *zldev, const void *util_ptr,
|
|
size_t util_size, struct netlink_ext_ack *extack);
|
|
|
|
int zl3073x_flash_mode_leave(struct zl3073x_dev *zldev,
|
|
struct netlink_ext_ack *extack);
|
|
|
|
int zl3073x_flash_page(struct zl3073x_dev *zldev, const char *component,
|
|
u32 page, u32 addr, const void *data, size_t size,
|
|
struct netlink_ext_ack *extack);
|
|
|
|
int zl3073x_flash_page_copy(struct zl3073x_dev *zldev, const char *component,
|
|
u32 src_page, u32 dst_page,
|
|
struct netlink_ext_ack *extack);
|
|
|
|
int zl3073x_flash_sectors(struct zl3073x_dev *zldev, const char *component,
|
|
u32 page, u32 addr, const void *data, size_t size,
|
|
struct netlink_ext_ack *extack);
|
|
|
|
#endif /* __ZL3073X_FLASH_H */
|