blob: 995f0aa6fecb4e6d696f13a4e2c3855f1966e3af [file] [log] [blame]
Kyungmin Parkd7e8ce12007-09-10 17:15:14 +09001/*
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 Wood229c56f2008-05-22 10:49:00 -050017#include <linux/types.h>
18
Remy Bohmerbd99ec12009-02-01 12:27:53 +010019/* Forward declarations */
Scott Wood229c56f2008-05-22 10:49:00 -050020struct mtd_info;
Remy Bohmerbd99ec12009-02-01 12:27:53 +010021struct mtd_oob_ops;
Scott Wood229c56f2008-05-22 10:49:00 -050022struct erase_info;
Kyungmin Parkef0921d2008-11-04 09:24:07 +090023struct onenand_chip;
Scott Wood229c56f2008-05-22 10:49:00 -050024
Kyungmin Parkbfd7f382008-08-19 08:42:53 +090025extern struct mtd_info onenand_mtd;
Amul Kumar Sahacacbe912009-11-06 17:15:31 +053026extern struct onenand_chip onenand_chip;
Kyungmin Parkbfd7f382008-08-19 08:42:53 +090027
Kyungmin Parkef0921d2008-11-04 09:24:07 +090028/* board */
Ladislav Michl77b93e52016-07-12 20:28:20 +020029extern int onenand_board_init(struct mtd_info *);
Kyungmin Parkef0921d2008-11-04 09:24:07 +090030
Kyungmin Parkd7e8ce12007-09-10 17:15:14 +090031/* 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);
Kyungmin Parkef0921d2008-11-04 09:24:07 +090035extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
Kyungmin Parkd7e8ce12007-09-10 17:15:14 +090036extern 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
Kyungmin Parkef0921d2008-11-04 09:24:07 +090040extern char *onenand_print_device_info(int device, int version);
Kyungmin Parkd7e8ce12007-09-10 17:15:14 +090041
Amul Kumar Sahacacbe912009-11-06 17:15:31 +053042extern 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
Marek Vasut54cd51b2011-10-31 14:14:15 +010051/* SPL */
Ladislav Michl735717d2016-07-12 20:28:11 +020052int onenand_spl_read_block(int block, int offset, int len, void *dst);
Marek Vasut54cd51b2011-10-31 14:14:15 +010053void onenand_spl_load_image(uint32_t offs, uint32_t size, void *dst);
54
Kyungmin Parkd7e8ce12007-09-10 17:15:14 +090055#endif /* __UBOOT_ONENAND_H */