nand.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* arch/arm/mach-s3c2410/include/mach/nand.h
  2. *
  3. * Copyright (c) 2004 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * S3C2410 - NAND device controller platform_device info
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. /**
  13. * struct s3c2410_nand_set - define a set of one or more nand chips
  14. * @disable_ecc: Entirely disable ECC - Dangerous
  15. * @flash_bbt: Openmoko u-boot can create a Bad Block Table
  16. * Setting this flag will allow the kernel to
  17. * look for it at boot time and also skip the NAND
  18. * scan.
  19. * @options: Default value to set into 'struct nand_chip' options.
  20. * @nr_chips: Number of chips in this set
  21. * @nr_partitions: Number of partitions pointed to by @partitions
  22. * @name: Name of set (optional)
  23. * @nr_map: Map for low-layer logical to physical chip numbers (option)
  24. * @partitions: The mtd partition list
  25. *
  26. * define a set of one or more nand chips registered with an unique mtd. Also
  27. * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger
  28. * a warning at boot time.
  29. */
  30. struct s3c2410_nand_set {
  31. unsigned int disable_ecc:1;
  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. struct nand_ecclayout *ecc_layout;
  40. };
  41. struct s3c2410_platform_nand {
  42. /* timing information for controller, all times in nanoseconds */
  43. int tacls; /* time for active CLE/ALE to nWE/nOE */
  44. int twrph0; /* active time for nWE/nOE */
  45. int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
  46. unsigned int ignore_unset_ecc:1;
  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);