1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/include/nandflash.h Fri May 22 18:37:44 2015 +0200
1.3 @@ -0,0 +1,56 @@
1.4 +/*
1.5 + * Copyright (C) 2009 Qi Hardware Inc.,
1.6 + * Author: Xiangfu Liu <xiangfu@sharism.cc>
1.7 + *
1.8 + * This program is free software; you can redistribute it and/or
1.9 + * modify it under the terms of the GNU General Public License
1.10 + * version 3 as published by the Free Software Foundation.
1.11 + *
1.12 + * This program is distributed in the hope that it will be useful,
1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.15 + * GNU General Public License for more details.
1.16 + *
1.17 + * You should have received a copy of the GNU General Public License
1.18 + * along with this program; if not, write to the Free Software
1.19 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.20 + * Boston, MA 02110-1301, USA
1.21 + */
1.22 +#ifndef __NANDLIB_H__
1.23 +#define __NANDLIB_H__
1.24 +
1.25 +#include "xburst_types.h"
1.26 +
1.27 +#ifndef NULL
1.28 +#define NULL 0
1.29 +#endif
1.30 +
1.31 +/* Jz4740 nandflash interface */
1.32 +unsigned int nand_query_4740(u8 *);
1.33 +int nand_init_4740(int bus_width, int row_cycle, int page_size, int page_per_block,
1.34 + int,int,int,int);
1.35 +int nand_fini_4740(void);
1.36 +u32 nand_program_4740(void *context, int spage, int pages, int option);
1.37 +u32 nand_erase_4740(int blk_num, int sblk, int force);
1.38 +u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option);
1.39 +u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum);
1.40 +u32 nand_read_raw_4740(void *buf, u32 startpage, u32 pagenum,int);
1.41 +u32 nand_mark_bad_4740(int bad);
1.42 +void nand_enable_4740(u32 csn);
1.43 +void nand_disable_4740(u32 csn);
1.44 +
1.45 +/* Jz4760 nandflash interface */
1.46 +unsigned int nand_query_4760(u8 *);
1.47 +int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
1.48 + int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force);
1.49 +int nand_fini_4760(void);
1.50 +u32 nand_program_4760(void *context, int spage, int pages, int option);
1.51 +u32 nand_erase_4760(int blk_num, int sblk, int force);
1.52 +u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option);
1.53 +u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum);
1.54 +u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int);
1.55 +u32 nand_mark_bad_4760(int bad);
1.56 +void nand_enable_4760(u32 csn);
1.57 +void nand_disable_4760(u32 csn);
1.58 +
1.59 +#endif