1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

dfu: add callback for flush and initiated operation

Add weak callback to allow board specific behavior
- flush
- initiated

This patch prepare usage of DFU back end for communication with
STM32CubeProgrammer on stm32mp1 platform with stm32prog command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
Patrick Delaunay
2019-10-14 09:28:07 +02:00
committed by Marek Vasut
parent ec44cace4b
commit 067c13c70b
3 changed files with 49 additions and 0 deletions

View File

@@ -183,6 +183,28 @@ int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
/**
* dfu_initiated_callback - weak callback called on DFU transaction start
*
* It is a callback function called by DFU stack when a DFU transaction is
* initiated. This function allows to manage some board specific behavior on
* DFU targets.
*
* @param dfu - pointer to the dfu_entity, which should be initialized
*
*/
void dfu_initiated_callback(struct dfu_entity *dfu);
/**
* dfu_flush_callback - weak callback called at the end of the DFU write
*
* It is a callback function called by DFU stack after DFU manifestation.
* This function allows to manage some board specific behavior on DFU targets
*
* @param dfu - pointer to the dfu_entity, which should be flushed
*
*/
void dfu_flush_callback(struct dfu_entity *dfu);
/*
* dfu_defer_flush - pointer to store dfu_entity for deferred flashing.
* It should be NULL when not used.