zte's code,first commit

Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/boot/common/src/uboot/include/linux/mtd/zftl.h b/boot/common/src/uboot/include/linux/mtd/zftl.h
new file mode 100644
index 0000000..30f2ed7
--- /dev/null
+++ b/boot/common/src/uboot/include/linux/mtd/zftl.h
@@ -0,0 +1,72 @@
+/*
+ * Linux driver for NAND NV Flash Translation Layer
+ * Copyright (C) 2016, ZIXC Corporation.
+ */
+
+
+#ifndef __MTD_NV_FTL_H__
+#define __MTD_NV_FTL_H__
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/zftl_ecc.h>
+
+
+
+/* error define */
+#define CAN_NOT_FIND_FREE_BLOCK  5  /* ÕÒ²»µ½¿ÕÏп飬½¨ÒéÔö¼ÓZFTL·ÖÇøµÄ´óС */
+#define NAND_READ_WRITE_ERROR    6
+
+/*
+ * zftl partition
+ */
+
+
+/* these info are used in blockRepTable */
+#define BLOCK_NIL         0xFFFF    /* ´Ë¿éûÓÐÓ³Éä¹ØÏµ */
+
+
+/* these info are used in BlockTable */
+#define BLOCK_FREE         0x00 
+#define BLOCK_USED         0x55 
+#define BLOCK_BAD          0xAA 
+#define BLOCK_DIRTY        0x11 
+
+
+struct ZFTLrecord {
+    nand_info_t *nand;
+    unsigned char *blockbuf;        /* ¿é»º´æ */
+    unsigned char *oobbuf;          /* OOB»º´æ */
+    unsigned char *blockTable; 
+	unsigned short *blockRepTable; 
+    unsigned short *versionTable;   /* Ö»ÓÃÔÚ¿ª»ú¹ÒÔØµÄʱºò */	
+    uint32_t erasesize;
+    uint32_t writesize;
+    unsigned int erasesize_shift;
+	unsigned int writesize_shift;
+    uint32_t oobsize;
+    uint32_t firstBlock;            /* µÚÒ»¿éµÄ¿éºÅ */
+    uint32_t numBlocks;             /* ×ܵĿéÊý */
+	uint32_t lastFreeBlock;
+};
+
+struct zftl_oob {
+    __u8 head[CONFIG_ZFLT_HEAD_BYTE];           /* zftlͷ */
+    __u8 used;
+    __u8 version;
+	__u16 logicBlockID;    /* ·ÖÇøÄ򵀮«ÒÆ¿éºÅ */
+}__attribute__((packed));
+
+
+
+
+struct zftl_packed_tags {
+	struct zftl_oob t;
+	struct zftl_ecc_other ecc;
+};
+
+
+void * zftl_get_ZFTLrecord(uint32_t offset);
+int zftl_write(struct ZFTLrecord *zftl, uint32_t to, uint32_t len, u_char *buf);
+int zftl_read(struct ZFTLrecord *zftl, uint32_t from, uint32_t len, u_char *buffer);
+
+#endif /* __MTD_NFTL_H__ */