mtd-nand-s3c2410.h 2.1 KB

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