1932394acSWolfgang Denk /* 2932394acSWolfgang Denk * (C) Copyright 2005 3932394acSWolfgang Denk * 2N Telekomunikace, a.s. <www.2n.cz> 4932394acSWolfgang Denk * Ladislav Michl <michl@2n.cz> 5932394acSWolfgang Denk * 6932394acSWolfgang Denk * See file CREDITS for list of people who contributed to this 7932394acSWolfgang Denk * project. 8932394acSWolfgang Denk * 9932394acSWolfgang Denk * This program is free software; you can redistribute it and/or 10932394acSWolfgang Denk * modify it under the terms of the GNU General Public License 11932394acSWolfgang Denk * version 2 as published by the Free Software Foundation. 12932394acSWolfgang Denk * 13932394acSWolfgang Denk * This program is distributed in the hope that it will be useful, 14932394acSWolfgang Denk * but WITHOUT ANY WARRANTY; without even the implied warranty of 15932394acSWolfgang Denk * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16932394acSWolfgang Denk * GNU General Public License for more details. 17932394acSWolfgang Denk * 18932394acSWolfgang Denk * You should have received a copy of the GNU General Public License 19932394acSWolfgang Denk * along with this program; if not, write to the Free Software 20932394acSWolfgang Denk * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21932394acSWolfgang Denk * MA 02111-1307 USA 22932394acSWolfgang Denk */ 23932394acSWolfgang Denk 24932394acSWolfgang Denk #ifndef _NAND_H_ 25932394acSWolfgang Denk #define _NAND_H_ 26932394acSWolfgang Denk 27*ac7eb8a3SWolfgang Denk #include <linux/mtd/compat.h> 28932394acSWolfgang Denk #include <linux/mtd/mtd.h> 29932394acSWolfgang Denk #include <linux/mtd/nand.h> 30932394acSWolfgang Denk 31932394acSWolfgang Denk typedef struct mtd_info nand_info_t; 32932394acSWolfgang Denk 33932394acSWolfgang Denk extern int nand_curr_device; 34932394acSWolfgang Denk extern nand_info_t nand_info[]; 35932394acSWolfgang Denk 36932394acSWolfgang Denk static inline int nand_read(nand_info_t *info, ulong ofs, ulong *len, u_char *buf) 37932394acSWolfgang Denk { 38932394acSWolfgang Denk return info->read(info, ofs, *len, len, buf); 39932394acSWolfgang Denk } 40932394acSWolfgang Denk 41932394acSWolfgang Denk static inline int nand_write(nand_info_t *info, ulong ofs, ulong *len, u_char *buf) 42932394acSWolfgang Denk { 43932394acSWolfgang Denk return info->write(info, ofs, *len, len, buf); 44932394acSWolfgang Denk } 45932394acSWolfgang Denk 46932394acSWolfgang Denk static inline int nand_block_isbad(nand_info_t *info, ulong ofs) 47932394acSWolfgang Denk { 48932394acSWolfgang Denk return info->block_isbad(info, ofs); 49932394acSWolfgang Denk } 50932394acSWolfgang Denk 51932394acSWolfgang Denk static inline int nand_erase(nand_info_t *info, ulong off, ulong size) 52932394acSWolfgang Denk { 53932394acSWolfgang Denk return 0; /* FIXME */ 54932394acSWolfgang Denk } 55932394acSWolfgang Denk 56932394acSWolfgang Denk #endif 57