ddr2_timing.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * (c) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. *
  6. */
  7. #ifndef __MICROCHIP_DDR2_TIMING_H
  8. #define __MICROCHIP_DDR2_TIMING_H
  9. /* MPLL freq is 400MHz */
  10. #define T_CK 2500 /* 2500 psec */
  11. #define T_CK_CTRL (T_CK * 2)
  12. /* Burst length in cycles */
  13. #define BL 2
  14. /* default CAS latency for all speed grades */
  15. #define RL 5
  16. /* default write latency for all speed grades = CL-1 */
  17. #define WL 4
  18. /* From Micron MT47H64M16HR-3 data sheet */
  19. #define T_RFC_MIN 127500 /* psec */
  20. #define T_WR 15000 /* psec */
  21. #define T_RP 12500 /* psec */
  22. #define T_RCD 12500 /* psec */
  23. #define T_RRD 7500 /* psec */
  24. /* T_RRD_TCK is minimum of 2 clk periods, regardless of freq */
  25. #define T_RRD_TCK 2
  26. #define T_WTR 7500 /* psec */
  27. /* T_WTR_TCK is minimum of 2 clk periods, regardless of freq */
  28. #define T_WTR_TCK 2
  29. #define T_RTP 7500 /* psec */
  30. #define T_RTP_TCK (BL / 2)
  31. #define T_XP_TCK 2 /* clocks */
  32. #define T_CKE_TCK 3 /* clocks */
  33. #define T_XSNR (T_RFC_MIN + 10000) /* psec */
  34. #define T_DLLK 200 /* clocks */
  35. #define T_RAS_MIN 45000 /* psec */
  36. #define T_RC 57500 /* psec */
  37. #define T_FAW 35000 /* psec */
  38. #define T_MRD_TCK 2 /* clocks */
  39. #define T_RFI 7800000 /* psec */
  40. /* DDR Addressing */
  41. #define COL_BITS 10
  42. #define BA_BITS 3
  43. #define ROW_BITS 13
  44. #define CS_BITS 1
  45. /* DDR Addressing scheme: {CS, ROW, BA, COL} */
  46. #define COL_HI_RSHFT 0
  47. #define COL_HI_MASK 0
  48. #define COL_LO_MASK ((1 << COL_BITS) - 1)
  49. #define BA_RSHFT COL_BITS
  50. #define BA_MASK ((1 << BA_BITS) - 1)
  51. #define ROW_ADDR_RSHIFT (BA_RSHFT + BA_BITS)
  52. #define ROW_ADDR_MASK ((1 << ROW_BITS) - 1)
  53. #define CS_ADDR_RSHIFT 0
  54. #define CS_ADDR_MASK 0
  55. #endif /* __MICROCHIP_DDR2_TIMING_H */