Merge tag 'v2021.10-rc4' into next
[platform/kernel/u-boot.git] / include / dfu.h
index a767ade..f686898 100644 (file)
@@ -33,6 +33,8 @@ enum dfu_layout {
        DFU_FS_EXT3,
        DFU_FS_EXT4,
        DFU_RAM_ADDR,
+       DFU_SKIP,
+       DFU_SCRIPT,
 };
 
 enum dfu_op {
@@ -98,12 +100,6 @@ struct virt_internal_data {
 };
 
 #define DFU_NAME_SIZE                  32
-#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE           (1024*1024*8)   /* 8 MiB */
-#endif
-#ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
-#define CONFIG_SYS_DFU_MAX_FILE_SIZE CONFIG_SYS_DFU_DATA_BUF_SIZE
-#endif
 #ifndef DFU_DEFAULT_POLL_TIMEOUT
 #define DFU_DEFAULT_POLL_TIMEOUT 0
 #endif
@@ -381,6 +377,17 @@ void dfu_initiated_callback(struct dfu_entity *dfu);
  */
 void dfu_flush_callback(struct dfu_entity *dfu);
 
+/**
+ * dfu_error_callback() - weak callback called at the DFU write error
+ *
+ * It is a callback function called by DFU stack after DFU write error.
+ * This function allows to manage some board specific behavior on DFU targets
+ *
+ * @dfu:       pointer to the dfu_entity which cause the error
+ * @msg:       the message of the error
+ */
+void dfu_error_callback(struct dfu_entity *dfu, const char *msg);
+
 int dfu_transaction_initiate(struct dfu_entity *dfu, bool read);
 void dfu_transaction_cleanup(struct dfu_entity *dfu);
 
@@ -496,6 +503,8 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
 }
 #endif
 
+extern bool dfu_reinit_needed;
+
 #if CONFIG_IS_ENABLED(DFU_WRITE_ALT)
 /**
  * dfu_write_by_name() - write data to DFU medium