mtd-nand-s3c2410.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /**
  14. * struct s3c2410_nand_set - define a set of one or more nand chips
  15. * @disable_ecc: Entirely disable ECC - Dangerous
  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 disable_ecc:1;
  33. unsigned int flash_bbt:1;
  34. unsigned int options;
  35. int nr_chips;
  36. int nr_partitions;
  37. char *name;
  38. int *nr_map;
  39. struct mtd_partition *partitions;
  40. struct nand_ecclayout *ecc_layout;
  41. };
  42. struct s3c2410_platform_nand {
  43. /* timing information for controller, all times in nanoseconds */
  44. int tacls; /* time for active CLE/ALE to nWE/nOE */
  45. int twrph0; /* active time for nWE/nOE */
  46. int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
  47. unsigned int ignore_unset_ecc:1;
  48. int nr_sets;
  49. struct s3c2410_nand_set *sets;
  50. void (*select_chip)(struct s3c2410_nand_set *,
  51. int chip);
  52. };
  53. /**
  54. * s3c_nand_set_platdata() - register NAND platform data.
  55. * @nand: The NAND platform data to register with s3c_device_nand.
  56. *
  57. * This function copies the given NAND platform data, @nand and registers
  58. * it with the s3c_device_nand. This allows @nand to be __initdata.
  59. */
  60. extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
  61. #endif /*__MTD_NAND_S3C2410_H */