summaryrefslogtreecommitdiff
path: root/include/dfu.h
diff options
context:
space:
mode:
authorPantelis Antoniou <panto@antoniou-consulting.com>2013-03-14 05:32:52 +0000
committerMarek Vasut <marex@denx.de>2013-04-10 15:22:24 +0200
commitc6631764c2a64efc91c84077ca65f4fee153f133 (patch)
tree6cf8185fc3e3a7b093241c46f948290af408be62 /include/dfu.h
parentc4df2f41005063cf1d1dcddeed4bd7f12a5dff77 (diff)
downloadu-boot-imx-c6631764c2a64efc91c84077ca65f4fee153f133.zip
u-boot-imx-c6631764c2a64efc91c84077ca65f4fee153f133.tar.gz
u-boot-imx-c6631764c2a64efc91c84077ca65f4fee153f133.tar.bz2
dfu: NAND specific routines for DFU operation
Support for NAND storage devices to work with the DFU framework. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Tom Rini <trini@ti.com> Acked-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'include/dfu.h')
-rw-r--r--include/dfu.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index cc99268..a107f4b 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -52,6 +52,15 @@ struct mmc_internal_data {
unsigned int part;
};
+struct nand_internal_data {
+ /* RAW programming */
+ u64 start;
+ u64 size;
+
+ unsigned int dev;
+ unsigned int part;
+};
+
static inline unsigned int get_mmc_blk_size(int dev)
{
return find_mmc_device(dev)->read_bl_len;
@@ -74,6 +83,7 @@ struct dfu_entity {
union {
struct mmc_internal_data mmc;
+ struct nand_internal_data nand;
} data;
int (*read_medium)(struct dfu_entity *dfu,
@@ -96,6 +106,8 @@ struct dfu_entity {
long r_left;
long b_left;
+ u32 bad_skip; /* for nand use */
+
unsigned int inited:1;
};
@@ -120,4 +132,15 @@ static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s)
return -1;
}
#endif
+
+#ifdef CONFIG_DFU_NAND
+extern int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s);
+#else
+static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
+{
+ puts("NAND support not available!\n");
+ return -1;
+}
+#endif
+
#endif /* __DFU_ENTITY_H_ */