xref: /rk3399_rockchip-uboot/include/nand.h (revision 932394ac43e2e778e664eeb6e456fecd0fae6e59)
1*932394acSWolfgang Denk /*
2*932394acSWolfgang Denk  * (C) Copyright 2005
3*932394acSWolfgang Denk  * 2N Telekomunikace, a.s. <www.2n.cz>
4*932394acSWolfgang Denk  * Ladislav Michl <michl@2n.cz>
5*932394acSWolfgang Denk  *
6*932394acSWolfgang Denk  * See file CREDITS for list of people who contributed to this
7*932394acSWolfgang Denk  * project.
8*932394acSWolfgang Denk  *
9*932394acSWolfgang Denk  * This program is free software; you can redistribute it and/or
10*932394acSWolfgang Denk  * modify it under the terms of the GNU General Public License
11*932394acSWolfgang Denk  * version 2 as published by the Free Software Foundation.
12*932394acSWolfgang Denk  *
13*932394acSWolfgang Denk  * This program is distributed in the hope that it will be useful,
14*932394acSWolfgang Denk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*932394acSWolfgang Denk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
16*932394acSWolfgang Denk  * GNU General Public License for more details.
17*932394acSWolfgang Denk  *
18*932394acSWolfgang Denk  * You should have received a copy of the GNU General Public License
19*932394acSWolfgang Denk  * along with this program; if not, write to the Free Software
20*932394acSWolfgang Denk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21*932394acSWolfgang Denk  * MA 02111-1307 USA
22*932394acSWolfgang Denk  */
23*932394acSWolfgang Denk 
24*932394acSWolfgang Denk #ifndef _NAND_H_
25*932394acSWolfgang Denk #define _NAND_H_
26*932394acSWolfgang Denk 
27*932394acSWolfgang Denk #include <linux_compat.h>
28*932394acSWolfgang Denk #include <linux/mtd/mtd.h>
29*932394acSWolfgang Denk #include <linux/mtd/nand.h>
30*932394acSWolfgang Denk 
31*932394acSWolfgang Denk typedef struct mtd_info nand_info_t;
32*932394acSWolfgang Denk 
33*932394acSWolfgang Denk extern int nand_curr_device;
34*932394acSWolfgang Denk extern nand_info_t nand_info[];
35*932394acSWolfgang Denk 
36*932394acSWolfgang Denk static inline int nand_read(nand_info_t *info, ulong ofs, ulong *len, u_char *buf)
37*932394acSWolfgang Denk {
38*932394acSWolfgang Denk 	return info->read(info, ofs, *len, len, buf);
39*932394acSWolfgang Denk }
40*932394acSWolfgang Denk 
41*932394acSWolfgang Denk static inline int nand_write(nand_info_t *info, ulong ofs, ulong *len, u_char *buf)
42*932394acSWolfgang Denk {
43*932394acSWolfgang Denk 	return info->write(info, ofs, *len, len, buf);
44*932394acSWolfgang Denk }
45*932394acSWolfgang Denk 
46*932394acSWolfgang Denk static inline int nand_block_isbad(nand_info_t *info, ulong ofs)
47*932394acSWolfgang Denk {
48*932394acSWolfgang Denk 	return info->block_isbad(info, ofs);
49*932394acSWolfgang Denk }
50*932394acSWolfgang Denk 
51*932394acSWolfgang Denk static inline int nand_erase(nand_info_t *info, ulong off, ulong size)
52*932394acSWolfgang Denk {
53*932394acSWolfgang Denk 	return 0; /* FIXME */
54*932394acSWolfgang Denk }
55*932394acSWolfgang Denk 
56*932394acSWolfgang Denk #endif
57