Root/usbboot/xburst_include/target/nandflash.h

1/*
2 * Copyright (C) 2009 Qi Hardware Inc.,
3 * Author: Xiangfu Liu <xiangfu@sharism.cc>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 3 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA
18 */
19#ifndef __NANDLIB_H__
20#define __NANDLIB_H__
21
22#include "xburst_types.h"
23
24#ifndef NULL
25#define NULL 0
26#endif
27
28/* Jz4740 nandflash interface */
29unsigned int nand_query_4740(u8 *);
30int nand_init_4740(int bus_width, int row_cycle, int page_size, int page_per_block,
31           int,int,int,int);
32int nand_fini_4740(void);
33u32 nand_program_4740(void *context, int spage, int pages, int option);
34//int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int));
35u32 nand_erase_4740(int blk_num, int sblk, int force);
36u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option);
37u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum);
38u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagenum,int);
39u32 nand_mark_bad_4740(int bad);
40void nand_enable_4740(u32 csn);
41void nand_disable_4740(u32 csn);
42
43/* Jz4760 nandflash interface */
44unsigned int nand_query_4760(u8 *);
45//int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
46// int,int,int,int);
47
48int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
49           int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force);
50
51int nand_fini_4760(void);
52u32 nand_program_4760(void *context, int spage, int pages, int option);
53//int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int));
54u32 nand_erase_4760(int blk_num, int sblk, int force);
55u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option);
56u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum);
57u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int);
58u32 nand_mark_bad_4760(int bad);
59
60void nand_enable_4760(u32 csn);
61void nand_disable_4760(u32 csn);
62
63#endif
64

Archive Download this file



interactive