summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-06-11 16:03:36 -0600
committerTom Rini <trini@ti.com>2014-08-09 11:16:59 -0400
commit6f12ebf6ea7bcae1b6d9ff090b5c1e7452be90e9 (patch)
tree6fc4e5046839b55b3ffc6d4e6cd9a8a215dc7bf8 /include
parentcb7bd2e07e70aed7802e28619ce93d15d7ce10dc (diff)
downloadu-boot-imx-6f12ebf6ea7bcae1b6d9ff090b5c1e7452be90e9.zip
u-boot-imx-6f12ebf6ea7bcae1b6d9ff090b5c1e7452be90e9.tar.gz
u-boot-imx-6f12ebf6ea7bcae1b6d9ff090b5c1e7452be90e9.tar.bz2
dfu: add SF backend
This allows SPI Flash to be programmed using DFU. Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/dfu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index 43814b3..7e0a999 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_ */