blob: e9602574b780b49c0a4d02bbc55405330a74a33e [file] [log] [blame]
Kyungmin Parkaf3d11c2007-09-10 17:15:14 +09001/*
2 * Header file for OneNAND support for U-Boot
3 *
4 * Adaptation from kernel to U-Boot
5 *
6 * Copyright (C) 2005-2007 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __UBOOT_ONENAND_H
15#define __UBOOT_ONENAND_H
16
Scott Wood8b759262008-05-22 10:49:00 -050017#include <linux/types.h>
Jean-Christophe PLAGNIOL-VILLARD7f68a312008-09-09 00:59:40 +020018#include <linux/mtd/mtd.h>
Scott Wood8b759262008-05-22 10:49:00 -050019
Scott Wood8b759262008-05-22 10:49:00 -050020struct mtd_info;
21struct erase_info;
22
Kyungmin Park5d7a01c2008-08-19 08:42:53 +090023extern struct mtd_info onenand_mtd;
24
Kyungmin Parkaf3d11c2007-09-10 17:15:14 +090025/* Functions */
26extern void onenand_init(void);
27extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
28 size_t * retlen, u_char * buf);
Kyungmin Park5d7a01c2008-08-19 08:42:53 +090029extern int onenand_read_oob(struct mtd_info *mtd, loff_t from,
30 struct mtd_oob_ops *ops);
Kyungmin Parkaf3d11c2007-09-10 17:15:14 +090031extern int onenand_write(struct mtd_info *mtd, loff_t from, size_t len,
32 size_t * retlen, const u_char * buf);
33extern int onenand_erase(struct mtd_info *mtd, struct erase_info *instr);
34
35extern int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len);
36
Fathi BOUDRA95feb702008-08-06 10:06:20 +020037extern char *onenand_print_device_info(int device);
Kyungmin Parkaf3d11c2007-09-10 17:15:14 +090038
39#endif /* __UBOOT_ONENAND_H */