mtd-nand-s3c2410.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2004 Simtec Electronics
  3. * Ben Dooks <ben@simtec.co.uk>
  4. *
  5. * S3C2410 - NAND device controller platform_device info
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __MTD_NAND_S3C2410_H
  12. #define __MTD_NAND_S3C2410_H
  13. #include <linux/mtd/nand.h>
  14. /**
  15. * struct s3c2410_nand_set - define a set of one or more nand chips
  16. * @flash_bbt: Openmoko u-boot can create a Bad Block Table
  17. * Setting this flag will allow the kernel to
  18. * look for it at boot time and also skip the NAND
  19. * scan.
  20. * @options: Default value to set into 'struct nand_chip' options.
  21. * @nr_chips: Number of chips in this set
  22. * @nr_partitions: Number of partitions pointed to by @partitions
  23. * @name: Name of set (optional)
  24. * @nr_map: Map for low-layer logical to physical chip numbers (option)
  25. * @partitions: The mtd partition list
  26. *
  27. * define a set of one or more nand chips registered with an unique mtd. Also
  28. * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger
  29. * a warning at boot time.
  30. */
  31. struct s3c2410_nand_set {
  32. unsigned int flash_bbt:1;
  33. unsigned int options;
  34. int nr_chips;
  35. int nr_partitions;
  36. char *name;
  37. int *nr_map;
  38. struct mtd_partition *partitions;
  39. };
  40. struct s3c2410_platform_nand {
  41. /* timing information for controller, all times in nanoseconds */
  42. int tacls; /* time for active CLE/ALE to nWE/nOE */
  43. int twrph0; /* active time for nWE/nOE */
  44. int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
  45. unsigned int ignore_unset_ecc:1;
  46. nand_ecc_modes_t ecc_mode;
  47. int nr_sets;
  48. struct s3c2410_nand_set *sets;
  49. void (*select_chip)(struct s3c2410_nand_set *,
  50. int chip);
  51. };
  52. /**
  53. * s3c_nand_set_platdata() - register NAND platform data.
  54. * @nand: The NAND platform data to register with s3c_device_nand.
  55. *
  56. * This function copies the given NAND platform data, @nand and registers
  57. * it with the s3c_device_nand. This allows @nand to be __initdata.
  58. */
  59. extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
  60. #endif /*__MTD_NAND_S3C2410_H */