mtd-nand-pxa3xx.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __ASM_ARCH_PXA3XX_NAND_H
  2. #define __ASM_ARCH_PXA3XX_NAND_H
  3. #include <linux/mtd/mtd.h>
  4. #include <linux/mtd/partitions.h>
  5. struct pxa3xx_nand_timing {
  6. unsigned int tCH; /* Enable signal hold time */
  7. unsigned int tCS; /* Enable signal setup time */
  8. unsigned int tWH; /* ND_nWE high duration */
  9. unsigned int tWP; /* ND_nWE pulse time */
  10. unsigned int tRH; /* ND_nRE high duration */
  11. unsigned int tRP; /* ND_nRE pulse width */
  12. unsigned int tR; /* ND_nWE high to ND_nRE low for read */
  13. unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */
  14. unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
  15. };
  16. struct pxa3xx_nand_flash {
  17. char *name;
  18. uint32_t chip_id;
  19. unsigned int page_per_block; /* Pages per block (PG_PER_BLK) */
  20. unsigned int page_size; /* Page size in bytes (PAGE_SZ) */
  21. unsigned int flash_width; /* Width of Flash memory (DWIDTH_M) */
  22. unsigned int dfc_width; /* Width of flash controller(DWIDTH_C) */
  23. unsigned int num_blocks; /* Number of physical blocks in Flash */
  24. struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
  25. };
  26. /*
  27. * Current pxa3xx_nand controller has two chip select which
  28. * both be workable.
  29. *
  30. * Notice should be taken that:
  31. * When you want to use this feature, you should not enable the
  32. * keep configuration feature, for two chip select could be
  33. * attached with different nand chip. The different page size
  34. * and timing requirement make the keep configuration impossible.
  35. */
  36. /* The max num of chip select current support */
  37. #define NUM_CHIP_SELECT (2)
  38. struct pxa3xx_nand_platform_data {
  39. /* the data flash bus is shared between the Static Memory
  40. * Controller and the Data Flash Controller, the arbiter
  41. * controls the ownership of the bus
  42. */
  43. int enable_arbiter;
  44. /* allow platform code to keep OBM/bootloader defined NFC config */
  45. int keep_config;
  46. /* indicate how many chip selects will be used */
  47. int num_cs;
  48. /* use an flash-based bad block table */
  49. bool flash_bbt;
  50. /* requested ECC strength and ECC step size */
  51. int ecc_strength, ecc_step_size;
  52. const struct mtd_partition *parts[NUM_CHIP_SELECT];
  53. unsigned int nr_parts[NUM_CHIP_SELECT];
  54. const struct pxa3xx_nand_flash * flash;
  55. size_t num_flash;
  56. };
  57. extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
  58. #endif /* __ASM_ARCH_PXA3XX_NAND_H */