xref: /linux/include/linux/platform_data/mtd-nand-s3c2410.h (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
291e16503SSachin Kamat /*
3436d42c6SArnd Bergmann  * Copyright (c) 2004 Simtec Electronics
4436d42c6SArnd Bergmann  *	Ben Dooks <ben@simtec.co.uk>
5436d42c6SArnd Bergmann  *
6436d42c6SArnd Bergmann  * S3C2410 - NAND device controller platform_device info
7436d42c6SArnd Bergmann */
8436d42c6SArnd Bergmann 
991e16503SSachin Kamat #ifndef __MTD_NAND_S3C2410_H
1091e16503SSachin Kamat #define __MTD_NAND_S3C2410_H
1191e16503SSachin Kamat 
12d4092d76SBoris Brezillon #include <linux/mtd/rawnand.h>
13e9f66ae2SSergio Prado 
14436d42c6SArnd Bergmann /**
15436d42c6SArnd Bergmann  * struct s3c2410_nand_set - define a set of one or more nand chips
16436d42c6SArnd Bergmann  * @flash_bbt: 		Openmoko u-boot can create a Bad Block Table
17436d42c6SArnd Bergmann  *			Setting this flag will allow the kernel to
18436d42c6SArnd Bergmann  *			look for it at boot time and also skip the NAND
19436d42c6SArnd Bergmann  *			scan.
20436d42c6SArnd Bergmann  * @options:		Default value to set into 'struct nand_chip' options.
21436d42c6SArnd Bergmann  * @nr_chips:		Number of chips in this set
22436d42c6SArnd Bergmann  * @nr_partitions:	Number of partitions pointed to by @partitions
23436d42c6SArnd Bergmann  * @name:		Name of set (optional)
24436d42c6SArnd Bergmann  * @nr_map:		Map for low-layer logical to physical chip numbers (option)
25436d42c6SArnd Bergmann  * @partitions:		The mtd partition list
26436d42c6SArnd Bergmann  *
27436d42c6SArnd Bergmann  * define a set of one or more nand chips registered with an unique mtd. Also
28436d42c6SArnd Bergmann  * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger
29436d42c6SArnd Bergmann  * a warning at boot time.
30436d42c6SArnd Bergmann  */
31436d42c6SArnd Bergmann struct s3c2410_nand_set {
32436d42c6SArnd Bergmann 	unsigned int		flash_bbt:1;
33436d42c6SArnd Bergmann 
34436d42c6SArnd Bergmann 	unsigned int		options;
35436d42c6SArnd Bergmann 	int			nr_chips;
36436d42c6SArnd Bergmann 	int			nr_partitions;
37436d42c6SArnd Bergmann 	char			*name;
38436d42c6SArnd Bergmann 	int			*nr_map;
39436d42c6SArnd Bergmann 	struct mtd_partition	*partitions;
401c825ad1SSergio Prado 	struct device_node	*of_node;
41436d42c6SArnd Bergmann };
42436d42c6SArnd Bergmann 
43436d42c6SArnd Bergmann struct s3c2410_platform_nand {
44436d42c6SArnd Bergmann 	/* timing information for controller, all times in nanoseconds */
45436d42c6SArnd Bergmann 
46436d42c6SArnd Bergmann 	int	tacls;	/* time for active CLE/ALE to nWE/nOE */
47436d42c6SArnd Bergmann 	int	twrph0;	/* active time for nWE/nOE */
48436d42c6SArnd Bergmann 	int	twrph1;	/* time for release CLE/ALE from nWE/nOE inactive */
49436d42c6SArnd Bergmann 
50436d42c6SArnd Bergmann 	unsigned int	ignore_unset_ecc:1;
51436d42c6SArnd Bergmann 
52*bace41f8SMiquel Raynal 	enum nand_ecc_engine_type engine_type;
53e9f66ae2SSergio Prado 
54436d42c6SArnd Bergmann 	int			nr_sets;
55436d42c6SArnd Bergmann 	struct s3c2410_nand_set *sets;
56436d42c6SArnd Bergmann 
57436d42c6SArnd Bergmann 	void			(*select_chip)(struct s3c2410_nand_set *,
58436d42c6SArnd Bergmann 					       int chip);
59436d42c6SArnd Bergmann };
60436d42c6SArnd Bergmann 
61436d42c6SArnd Bergmann /**
62436d42c6SArnd Bergmann  * s3c_nand_set_platdata() - register NAND platform data.
63436d42c6SArnd Bergmann  * @nand: The NAND platform data to register with s3c_device_nand.
64436d42c6SArnd Bergmann  *
65436d42c6SArnd Bergmann  * This function copies the given NAND platform data, @nand and registers
66436d42c6SArnd Bergmann  * it with the s3c_device_nand. This allows @nand to be __initdata.
67436d42c6SArnd Bergmann */
68436d42c6SArnd Bergmann extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
6991e16503SSachin Kamat 
7091e16503SSachin Kamat #endif /*__MTD_NAND_S3C2410_H */
71