include: replace linux/module.h with "struct module" wherever possible
[linux-2.6/next.git] / drivers / staging / spectra / lld.h
blobd3738e0e1fea515bf49954287d55e6e1b3216cc0
1 /*
2 * NAND Flash Controller Device Driver
3 * Copyright (c) 2009, Intel Corporation and its suppliers.
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.
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.
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.
22 #ifndef _LLD_
23 #define _LLD_
25 #include "ffsport.h"
26 #include "spectraswconfig.h"
27 #include "flash.h"
29 #define GOOD_BLOCK 0
30 #define DEFECTIVE_BLOCK 1
31 #define READ_ERROR 2
33 #define CLK_X 5
34 #define CLK_MULTI 4
36 /* Typedefs */
38 /* prototypes: API for LLD */
39 /* Currently, Write_Page_Main
40 * MemCopy
41 * Read_Page_Main_Spare
42 * do not have flag because they were not implemented prior to this
43 * They are not being added to keep changes to a minimum for now.
44 * Currently, they are not required (only reqd for Wr_P_M_S.)
45 * Later on, these NEED to be changed.
48 extern void GLOB_LLD_ECC_Control(int enable);
50 extern u16 GLOB_LLD_Flash_Reset(void);
52 extern u16 GLOB_LLD_Read_Device_ID(void);
54 extern u16 GLOB_LLD_UnlockArrayAll(void);
56 extern u16 GLOB_LLD_Flash_Init(void);
58 extern int GLOB_LLD_Flash_Release(void);
60 extern u16 GLOB_LLD_Erase_Block(u32 block_add);
62 extern u16 GLOB_LLD_Write_Page_Main(u8 *write_data,
63 u32 block, u16 Page, u16 PageCount);
65 extern u16 GLOB_LLD_Read_Page_Main(u8 *read_data,
66 u32 block, u16 page, u16 page_count);
68 extern u16 GLOB_LLD_Read_Page_Main_Polling(u8 *read_data,
69 u32 block, u16 page, u16 page_count);
71 extern u16 GLOB_LLD_Write_Page_Main_Spare(u8 *write_data,
72 u32 block, u16 Page, u16 PageCount);
74 extern u16 GLOB_LLD_Write_Page_Spare(u8 *write_data,
75 u32 block, u16 Page, u16 PageCount);
77 extern u16 GLOB_LLD_Read_Page_Main_Spare(u8 *read_data,
78 u32 block, u16 page, u16 page_count);
80 extern u16 GLOB_LLD_Read_Page_Spare(u8 *read_data,
81 u32 block, u16 Page, u16 PageCount);
83 extern u16 GLOB_LLD_Get_Bad_Block(u32 block);
85 extern u16 GLOB_LLD_Event_Status(void);
87 extern u16 GLOB_LLD_MemCopy_CMD(u8 *dest, u8 *src, u32 ByteCount, u16 flag);
89 extern u16 glob_lld_execute_cmds(void);
91 extern u16 GLOB_LLD_Erase_Block_cdma(u32 block, u16 flags);
93 extern u16 GLOB_LLD_Write_Page_Main_cdma(u8 *data,
94 u32 block, u16 page, u16 count);
96 extern u16 GLOB_LLD_Read_Page_Main_cdma(u8 *data,
97 u32 block, u16 page, u16 count, u16 flags);
99 extern u16 GLOB_LLD_Write_Page_Main_Spare_cdma(u8 *data,
100 u32 block, u16 page, u16 count, u16 flags);
102 extern u16 GLOB_LLD_Read_Page_Main_Spare_cdma(u8 *data,
103 u32 block, u16 page, u16 count);
105 #define LLD_CMD_FLAG_ORDER_BEFORE_REST (0x1)
106 #define LLD_CMD_FLAG_MODE_CDMA (0x8)
109 #endif /*_LLD_ */