aboutsummaryrefslogtreecommitdiff
path: root/include/dfu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/dfu.h')
-rw-r--r--include/dfu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index 43814b38ec6..7e0a99908ca 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -14,6 +14,7 @@
#include <common.h>
#include <linux/list.h>
#include <mmc.h>
+#include <spi_flash.h>
#include <linux/usb/composite.h>
enum dfu_device_type {
@@ -21,6 +22,7 @@ enum dfu_device_type {
DFU_DEV_ONENAND,
DFU_DEV_NAND,
DFU_DEV_RAM,
+ DFU_DEV_SF,
};
enum dfu_layout {
@@ -70,6 +72,14 @@ struct ram_internal_data {
unsigned int size;
};
+struct sf_internal_data {
+ struct spi_flash *dev;
+
+ /* RAW programming */
+ u64 start;
+ u64 size;
+};
+
#define DFU_NAME_SIZE 32
#define DFU_CMD_BUF_SIZE 128
#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
@@ -97,6 +107,7 @@ struct dfu_entity {
struct mmc_internal_data mmc;
struct nand_internal_data nand;
struct ram_internal_data ram;
+ struct sf_internal_data sf;
} data;
long (*get_medium_size)(struct dfu_entity *dfu);
@@ -182,5 +193,16 @@ static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr,
}
#endif
+#ifdef CONFIG_DFU_SF
+extern int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s);
+#else
+static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
+ char *s)
+{
+ puts("SF support not available!\n");
+ return -1;
+}
+#endif
+
int dfu_add(struct usb_configuration *c);
#endif /* __DFU_ENTITY_H_ */