2 * Header file for OneNAND support for U-Boot
4 * Adaptation from kernel to U-Boot
6 * Copyright (C) 2005-2007 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com>
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.
14 #ifndef __UBOOT_ONENAND_H
15 #define __UBOOT_ONENAND_H
17 #include <linux/types.h>
19 /* Forward declarations */
25 extern struct mtd_info onenand_mtd;
26 extern struct onenand_chip onenand_chip;
29 extern void onenand_board_init(struct mtd_info *);
32 extern void onenand_init(void);
33 extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
34 size_t * retlen, u_char * buf);
35 extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
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);
40 extern char *onenand_print_device_info(int device, int version);
42 extern unsigned onenand_block(struct onenand_chip *this, loff_t addr);
44 extern loff_t onenand_addr(struct onenand_chip *this, int block);
46 extern int flexonenand_region(struct mtd_info *mtd, loff_t addr);
48 extern int flexonenand_set_boundary(struct mtd_info *mtd, int die,
49 int boundary, int lock);
52 void onenand_spl_load_image(uint32_t offs, uint32_t size, void *dst);
54 #endif /* __UBOOT_ONENAND_H */