191e16503SSachin Kamat /* 2436d42c6SArnd Bergmann * Copyright (c) 2004 Simtec Electronics 3436d42c6SArnd Bergmann * Ben Dooks <ben@simtec.co.uk> 4436d42c6SArnd Bergmann * 5436d42c6SArnd Bergmann * S3C2410 - NAND device controller platform_device info 6436d42c6SArnd Bergmann * 7436d42c6SArnd Bergmann * This program is free software; you can redistribute it and/or modify 8436d42c6SArnd Bergmann * it under the terms of the GNU General Public License version 2 as 9436d42c6SArnd Bergmann * published by the Free Software Foundation. 10436d42c6SArnd Bergmann */ 11436d42c6SArnd Bergmann 1291e16503SSachin Kamat #ifndef __MTD_NAND_S3C2410_H 1391e16503SSachin Kamat #define __MTD_NAND_S3C2410_H 1491e16503SSachin Kamat 15*e9f66ae2SSergio Prado #include <linux/mtd/nand.h> 16*e9f66ae2SSergio Prado 17436d42c6SArnd Bergmann /** 18436d42c6SArnd Bergmann * struct s3c2410_nand_set - define a set of one or more nand chips 19436d42c6SArnd Bergmann * @flash_bbt: Openmoko u-boot can create a Bad Block Table 20436d42c6SArnd Bergmann * Setting this flag will allow the kernel to 21436d42c6SArnd Bergmann * look for it at boot time and also skip the NAND 22436d42c6SArnd Bergmann * scan. 23436d42c6SArnd Bergmann * @options: Default value to set into 'struct nand_chip' options. 24436d42c6SArnd Bergmann * @nr_chips: Number of chips in this set 25436d42c6SArnd Bergmann * @nr_partitions: Number of partitions pointed to by @partitions 26436d42c6SArnd Bergmann * @name: Name of set (optional) 27436d42c6SArnd Bergmann * @nr_map: Map for low-layer logical to physical chip numbers (option) 28436d42c6SArnd Bergmann * @partitions: The mtd partition list 29436d42c6SArnd Bergmann * 30436d42c6SArnd Bergmann * define a set of one or more nand chips registered with an unique mtd. Also 31436d42c6SArnd Bergmann * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger 32436d42c6SArnd Bergmann * a warning at boot time. 33436d42c6SArnd Bergmann */ 34436d42c6SArnd Bergmann struct s3c2410_nand_set { 35436d42c6SArnd Bergmann unsigned int flash_bbt:1; 36436d42c6SArnd Bergmann 37436d42c6SArnd Bergmann unsigned int options; 38436d42c6SArnd Bergmann int nr_chips; 39436d42c6SArnd Bergmann int nr_partitions; 40436d42c6SArnd Bergmann char *name; 41436d42c6SArnd Bergmann int *nr_map; 42436d42c6SArnd Bergmann struct mtd_partition *partitions; 43436d42c6SArnd Bergmann }; 44436d42c6SArnd Bergmann 45436d42c6SArnd Bergmann struct s3c2410_platform_nand { 46436d42c6SArnd Bergmann /* timing information for controller, all times in nanoseconds */ 47436d42c6SArnd Bergmann 48436d42c6SArnd Bergmann int tacls; /* time for active CLE/ALE to nWE/nOE */ 49436d42c6SArnd Bergmann int twrph0; /* active time for nWE/nOE */ 50436d42c6SArnd Bergmann int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */ 51436d42c6SArnd Bergmann 52436d42c6SArnd Bergmann unsigned int ignore_unset_ecc:1; 53436d42c6SArnd Bergmann 54*e9f66ae2SSergio Prado nand_ecc_modes_t ecc_mode; 55*e9f66ae2SSergio Prado 56436d42c6SArnd Bergmann int nr_sets; 57436d42c6SArnd Bergmann struct s3c2410_nand_set *sets; 58436d42c6SArnd Bergmann 59436d42c6SArnd Bergmann void (*select_chip)(struct s3c2410_nand_set *, 60436d42c6SArnd Bergmann int chip); 61436d42c6SArnd Bergmann }; 62436d42c6SArnd Bergmann 63436d42c6SArnd Bergmann /** 64436d42c6SArnd Bergmann * s3c_nand_set_platdata() - register NAND platform data. 65436d42c6SArnd Bergmann * @nand: The NAND platform data to register with s3c_device_nand. 66436d42c6SArnd Bergmann * 67436d42c6SArnd Bergmann * This function copies the given NAND platform data, @nand and registers 68436d42c6SArnd Bergmann * it with the s3c_device_nand. This allows @nand to be __initdata. 69436d42c6SArnd Bergmann */ 70436d42c6SArnd Bergmann extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand); 7191e16503SSachin Kamat 7291e16503SSachin Kamat #endif /*__MTD_NAND_S3C2410_H */ 73