gpmc-omap.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OMAP GPMC Platform data
  4. *
  5. * Copyright (C) 2014 Texas Instruments, Inc. - https://www.ti.com
  6. * Roger Quadros <[email protected]>
  7. */
  8. #ifndef _GPMC_OMAP_H_
  9. #define _GPMC_OMAP_H_
  10. /* Maximum Number of Chip Selects */
  11. #define GPMC_CS_NUM 8
  12. /* bool type time settings */
  13. struct gpmc_bool_timings {
  14. bool cycle2cyclediffcsen;
  15. bool cycle2cyclesamecsen;
  16. bool we_extra_delay;
  17. bool oe_extra_delay;
  18. bool adv_extra_delay;
  19. bool cs_extra_delay;
  20. bool time_para_granularity;
  21. };
  22. /*
  23. * Note that all values in this struct are in nanoseconds except sync_clk
  24. * (which is in picoseconds), while the register values are in gpmc_fck cycles.
  25. */
  26. struct gpmc_timings {
  27. /* Minimum clock period for synchronous mode (in picoseconds) */
  28. u32 sync_clk;
  29. /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
  30. u32 cs_on; /* Assertion time */
  31. u32 cs_rd_off; /* Read deassertion time */
  32. u32 cs_wr_off; /* Write deassertion time */
  33. /* ADV signal timings corresponding to GPMC_CONFIG3 */
  34. u32 adv_on; /* Assertion time */
  35. u32 adv_rd_off; /* Read deassertion time */
  36. u32 adv_wr_off; /* Write deassertion time */
  37. u32 adv_aad_mux_on; /* ADV assertion time for AAD */
  38. u32 adv_aad_mux_rd_off; /* ADV read deassertion time for AAD */
  39. u32 adv_aad_mux_wr_off; /* ADV write deassertion time for AAD */
  40. /* WE signals timings corresponding to GPMC_CONFIG4 */
  41. u32 we_on; /* WE assertion time */
  42. u32 we_off; /* WE deassertion time */
  43. /* OE signals timings corresponding to GPMC_CONFIG4 */
  44. u32 oe_on; /* OE assertion time */
  45. u32 oe_off; /* OE deassertion time */
  46. u32 oe_aad_mux_on; /* OE assertion time for AAD */
  47. u32 oe_aad_mux_off; /* OE deassertion time for AAD */
  48. /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
  49. u32 page_burst_access; /* Multiple access word delay */
  50. u32 access; /* Start-cycle to first data valid delay */
  51. u32 rd_cycle; /* Total read cycle time */
  52. u32 wr_cycle; /* Total write cycle time */
  53. u32 bus_turnaround;
  54. u32 cycle2cycle_delay;
  55. u32 wait_monitoring;
  56. u32 clk_activation;
  57. /* The following are only on OMAP3430 */
  58. u32 wr_access; /* WRACCESSTIME */
  59. u32 wr_data_mux_bus; /* WRDATAONADMUXBUS */
  60. struct gpmc_bool_timings bool_timings;
  61. };
  62. /* Device timings in picoseconds */
  63. struct gpmc_device_timings {
  64. u32 t_ceasu; /* address setup to CS valid */
  65. u32 t_avdasu; /* address setup to ADV valid */
  66. /* XXX: try to combine t_avdp_r & t_avdp_w. Issue is
  67. * of tusb using these timings even for sync whilst
  68. * ideally for adv_rd/(wr)_off it should have considered
  69. * t_avdh instead. This indirectly necessitates r/w
  70. * variations of t_avdp as it is possible to have one
  71. * sync & other async
  72. */
  73. u32 t_avdp_r; /* ADV low time (what about t_cer ?) */
  74. u32 t_avdp_w;
  75. u32 t_aavdh; /* address hold time */
  76. u32 t_oeasu; /* address setup to OE valid */
  77. u32 t_aa; /* access time from ADV assertion */
  78. u32 t_iaa; /* initial access time */
  79. u32 t_oe; /* access time from OE assertion */
  80. u32 t_ce; /* access time from CS asertion */
  81. u32 t_rd_cycle; /* read cycle time */
  82. u32 t_cez_r; /* read CS deassertion to high Z */
  83. u32 t_cez_w; /* write CS deassertion to high Z */
  84. u32 t_oez; /* OE deassertion to high Z */
  85. u32 t_weasu; /* address setup to WE valid */
  86. u32 t_wpl; /* write assertion time */
  87. u32 t_wph; /* write deassertion time */
  88. u32 t_wr_cycle; /* write cycle time */
  89. u32 clk;
  90. u32 t_bacc; /* burst access valid clock to output delay */
  91. u32 t_ces; /* CS setup time to clk */
  92. u32 t_avds; /* ADV setup time to clk */
  93. u32 t_avdh; /* ADV hold time from clk */
  94. u32 t_ach; /* address hold time from clk */
  95. u32 t_rdyo; /* clk to ready valid */
  96. u32 t_ce_rdyz; /* XXX: description ?, or use t_cez instead */
  97. u32 t_ce_avd; /* CS on to ADV on delay */
  98. /* XXX: check the possibility of combining
  99. * cyc_aavhd_oe & cyc_aavdh_we
  100. */
  101. u8 cyc_aavdh_oe;/* read address hold time in cycles */
  102. u8 cyc_aavdh_we;/* write address hold time in cycles */
  103. u8 cyc_oe; /* access time from OE assertion in cycles */
  104. u8 cyc_wpl; /* write deassertion time in cycles */
  105. u32 cyc_iaa; /* initial access time in cycles */
  106. /* extra delays */
  107. bool ce_xdelay;
  108. bool avd_xdelay;
  109. bool oe_xdelay;
  110. bool we_xdelay;
  111. };
  112. #define GPMC_BURST_4 4 /* 4 word burst */
  113. #define GPMC_BURST_8 8 /* 8 word burst */
  114. #define GPMC_BURST_16 16 /* 16 word burst */
  115. #define GPMC_DEVWIDTH_8BIT 1 /* 8-bit device width */
  116. #define GPMC_DEVWIDTH_16BIT 2 /* 16-bit device width */
  117. #define GPMC_MUX_AAD 1 /* Addr-Addr-Data multiplex */
  118. #define GPMC_MUX_AD 2 /* Addr-Data multiplex */
  119. struct gpmc_settings {
  120. bool burst_wrap; /* enables wrap bursting */
  121. bool burst_read; /* enables read page/burst mode */
  122. bool burst_write; /* enables write page/burst mode */
  123. bool device_nand; /* device is NAND */
  124. bool sync_read; /* enables synchronous reads */
  125. bool sync_write; /* enables synchronous writes */
  126. bool wait_on_read; /* monitor wait on reads */
  127. bool wait_on_write; /* monitor wait on writes */
  128. u32 burst_len; /* page/burst length */
  129. u32 device_width; /* device bus width (8 or 16 bit) */
  130. u32 mux_add_data; /* multiplex address & data */
  131. u32 wait_pin; /* wait-pin to be used */
  132. };
  133. /* Data for each chip select */
  134. struct gpmc_omap_cs_data {
  135. bool valid; /* data is valid */
  136. bool is_nand; /* device within this CS is NAND */
  137. struct gpmc_settings *settings;
  138. struct gpmc_device_timings *device_timings;
  139. struct gpmc_timings *gpmc_timings;
  140. struct platform_device *pdev; /* device within this CS region */
  141. unsigned int pdata_size;
  142. };
  143. struct gpmc_omap_platform_data {
  144. struct gpmc_omap_cs_data cs[GPMC_CS_NUM];
  145. };
  146. #endif /* _GPMC_OMAP_H */