[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/boot/common/src/loader/drivers/flash.h b/boot/common/src/loader/drivers/flash.h
new file mode 100755
index 0000000..2fe2ddb
--- /dev/null
+++ b/boot/common/src/loader/drivers/flash.h
@@ -0,0 +1,53 @@
+/*******************************************************************************

+ * Copyright (C) 2016, ZXIC Corporation.

+ *

+ * File Name:    

+ * File Mark:    

+ * Description:  

+ * Others:        

+ * Version:       v1.0

+ * Author:        zhouqi

+ * Date:          2013-8-21

+ * History 1:      

+ *     Date: 

+ *     Version:

+ *     Author: 

+ *     Modification:  

+ * History 2: 

+  ********************************************************************************/

+

+#ifndef _FLASH_H_

+#define _FLASH_H_

+

+#include <linux/types.h>

+

+#define 	NOR_BOOT		0x0

+#define 	NAND_BOOT		0x1

+#define 	SPI_NAND_BOOT	0x2

+#define 	OTHER_BOOT		0xff

+

+struct flash_type{

+	uint8_t flash_type;

+    uint8_t manuf_id;             

+    uint8_t device_id;            

+	uint16_t page_size;

+    uint16_t page_size_shift;      

+    uint16_t oob_size;                    

+    uint16_t block_size_shift;

+    uint16_t block_num;          

+	uint32_t block_size;

+	int32_t	(*read_page_raw)(uint32_t buf, uint32_t offset);

+	int32_t	(*read)(uint32_t from, uint32_t len, uint32_t to);

+	void (*read_oob)(uint8_t *buf, uint32_t offset, uint32_t len);

+};

+

+

+extern struct flash_type flash;

+

+char get_boot_mode(void);

+int board_flash_init(void);

+

+

+#endif/*_FLASH_H_*/

+

+