blob: 92279d56ec6b1851377a88428c371646b33583e3 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
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
17#include <linux/types.h>
18
19/* Forward declarations */
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/* board */
29extern void onenand_board_init(struct mtd_info *);
30
31/* Functions */
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/* S3C64xx */
52extern void s3c64xx_onenand_init(struct mtd_info *);
53extern void s3c64xx_set_width_regs(struct onenand_chip *);
54
55#endif /* __UBOOT_ONENAND_H */