Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 1 | /* |
| 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 Wood | 229c56f | 2008-05-22 10:49:00 -0500 | [diff] [blame] | 17 | #include <linux/types.h> |
| 18 | |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 19 | struct kvec { |
| 20 | void *iov_base; |
| 21 | size_t iov_len; |
| 22 | }; |
| 23 | |
| 24 | typedef int spinlock_t; |
| 25 | typedef int wait_queue_head_t; |
| 26 | |
Scott Wood | 229c56f | 2008-05-22 10:49:00 -0500 | [diff] [blame] | 27 | struct mtd_info; |
| 28 | struct erase_info; |
| 29 | |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 30 | /* Functions */ |
| 31 | extern void onenand_init(void); |
| 32 | extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len, |
| 33 | size_t * retlen, u_char * buf); |
| 34 | extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, size_t len, |
| 35 | size_t * retlen, u_char * buf); |
| 36 | extern int onenand_write(struct mtd_info *mtd, loff_t from, size_t len, |
| 37 | size_t * retlen, const u_char * buf); |
| 38 | extern int onenand_erase(struct mtd_info *mtd, struct erase_info *instr); |
| 39 | |
| 40 | extern int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len); |
| 41 | |
Fathi BOUDRA | 195ccfc | 2008-08-06 10:06:20 +0200 | [diff] [blame] | 42 | extern char *onenand_print_device_info(int device); |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 43 | |
| 44 | #endif /* __UBOOT_ONENAND_H */ |