1 /*
2  * NAND Flash Controller Device Driver
3  * Copyright (c) 2009, Intel Corporation and its suppliers.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  */
19 
20 #ifndef _LLD_MTD_
21 #define _LLD_MTD_
22 
23 #include "ffsport.h"
24 #include "ffsdefs.h"
25 
26 /* prototypes: MTD API functions */
27 extern u16 mtd_Flash_Reset(void);
28 extern u16 mtd_Flash_Init(void);
29 extern int mtd_Flash_Release(void);
30 extern u16 mtd_Read_Device_ID(void);
31 extern u16 mtd_Erase_Block(u32 block_addr);
32 extern u16 mtd_Write_Page_Main(u8 *write_data, u32 Block,
33 				u16 Page, u16 PageCount);
34 extern u16 mtd_Read_Page_Main(u8 *read_data, u32 Block, u16 Page,
35 				 u16 PageCount);
36 extern u16 mtd_Event_Status(void);
37 extern void mtd_Enable_Disable_Interrupts(u16 INT_ENABLE);
38 extern u16 mtd_Write_Page_Main_Spare(u8 *write_data, u32 Block,
39 					u16 Page, u16 PageCount);
40 extern u16 mtd_Write_Page_Spare(u8 *write_data, u32 Block,
41 					u16 Page, u16 PageCount);
42 extern u16 mtd_Read_Page_Main_Spare(u8 *read_data, u32 Block,
43 				       u16 Page, u16 PageCount);
44 extern u16 mtd_Read_Page_Spare(u8 *read_data, u32 Block, u16 Page,
45 				  u16 PageCount);
46 extern u16 mtd_Get_Bad_Block(u32 block);
47 
48 u16 mtd_CDMA_Flash_Init(void);
49 u16 mtd_CDMA_Execute_CMDs(u16 tag_count);
50 u16 mtd_CDMA_Event_Status(void);
51 #endif /*_LLD_MTD_*/
52