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 | |
Remy Bohmer | bd99ec1 | 2009-02-01 12:27:53 +0100 | [diff] [blame] | 19 | /* Forward declarations */ |
Scott Wood | 229c56f | 2008-05-22 10:49:00 -0500 | [diff] [blame] | 20 | struct mtd_info; |
Remy Bohmer | bd99ec1 | 2009-02-01 12:27:53 +0100 | [diff] [blame] | 21 | struct mtd_oob_ops; |
Scott Wood | 229c56f | 2008-05-22 10:49:00 -0500 | [diff] [blame] | 22 | struct erase_info; |
Kyungmin Park | ef0921d | 2008-11-04 09:24:07 +0900 | [diff] [blame] | 23 | struct onenand_chip; |
Scott Wood | 229c56f | 2008-05-22 10:49:00 -0500 | [diff] [blame] | 24 | |
Kyungmin Park | bfd7f38 | 2008-08-19 08:42:53 +0900 | [diff] [blame] | 25 | extern struct mtd_info onenand_mtd; |
| 26 | |
Kyungmin Park | ef0921d | 2008-11-04 09:24:07 +0900 | [diff] [blame] | 27 | /* board */ |
| 28 | extern void onenand_board_init(struct mtd_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); |
Kyungmin Park | ef0921d | 2008-11-04 09:24:07 +0900 | [diff] [blame] | 34 | extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops); |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 35 | extern int onenand_write(struct mtd_info *mtd, loff_t from, size_t len, |
| 36 | size_t * retlen, const u_char * buf); |
| 37 | extern int onenand_erase(struct mtd_info *mtd, struct erase_info *instr); |
| 38 | |
Kyungmin Park | ef0921d | 2008-11-04 09:24:07 +0900 | [diff] [blame] | 39 | extern char *onenand_print_device_info(int device, int version); |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 40 | |
Kyungmin Park | ef0921d | 2008-11-04 09:24:07 +0900 | [diff] [blame] | 41 | /* S3C64xx */ |
| 42 | extern void s3c64xx_onenand_init(struct mtd_info *); |
| 43 | extern void s3c64xx_set_width_regs(struct onenand_chip *); |
Kyungmin Park | d7e8ce1 | 2007-09-10 17:15:14 +0900 | [diff] [blame] | 44 | |
| 45 | #endif /* __UBOOT_ONENAND_H */ |