]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/dfu.h
mx31pdk: add CONFIG_SPL_LIBGENERIC_SUPPORT
[karo-tx-uboot.git] / include / dfu.h
index 527e69f90bdf704ffc2393fce6ae67a763bf7743..a107f4b13e308aa17f2eb64ef7b5e402d02c6d95 100644 (file)
@@ -52,14 +52,23 @@ 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;
 }
 
-#define DFU_NAME_SIZE 32
-#define DFU_CMD_BUF_SIZE 128
-#define DFU_DATA_BUF_SIZE (1024*1024*8) /* 8 MiB */
+#define DFU_NAME_SIZE                  32
+#define DFU_CMD_BUF_SIZE               128
+#define DFU_DATA_BUF_SIZE              (1024*1024*8)   /* 8 MiB */
 #ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
 #define CONFIG_SYS_DFU_MAX_FILE_SIZE   (4 << 20)       /* 4 MiB */
 #endif
@@ -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_ */