1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __UBOOT_ONENAND_H
15#define __UBOOT_ONENAND_H
16
17#include <linux/types.h>
18
19
20struct mtd_info;
21struct mtd_oob_ops;
22struct erase_info;
23struct onenand_chip;
24
25extern struct mtd_info onenand_mtd;
26extern struct onenand_chip onenand_chip;
27
28
29extern int onenand_board_init(struct mtd_info *);
30
31
32extern void onenand_init(void);
33extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
34 size_t * retlen, u_char * buf);
35extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
36extern int onenand_write(struct mtd_info *mtd, loff_t from, size_t len,
37 size_t * retlen, const u_char * buf);
38extern int onenand_erase(struct mtd_info *mtd, struct erase_info *instr);
39
40extern char *onenand_print_device_info(int device, int version);
41
42extern unsigned onenand_block(struct onenand_chip *this, loff_t addr);
43
44extern loff_t onenand_addr(struct onenand_chip *this, int block);
45
46extern int flexonenand_region(struct mtd_info *mtd, loff_t addr);
47
48extern int flexonenand_set_boundary(struct mtd_info *mtd, int die,
49 int boundary, int lock);
50
51
52int onenand_spl_read_block(int block, int offset, int len, void *dst);
53void onenand_spl_load_image(uint32_t offs, uint32_t size, void *dst);
54
55#endif
56