fsl_ddr_dimm_params.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2008 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * Version 2 as published by the Free Software Foundation.
  7. */
  8. #ifndef DDR2_DIMM_PARAMS_H
  9. #define DDR2_DIMM_PARAMS_H
  10. /* Parameters for a DDR2 dimm computed from the SPD */
  11. typedef struct dimm_params_s {
  12. /* DIMM organization parameters */
  13. char mpart[19]; /* guaranteed null terminated */
  14. unsigned int n_ranks;
  15. unsigned long long rank_density;
  16. unsigned long long capacity;
  17. unsigned int data_width;
  18. unsigned int primary_sdram_width;
  19. unsigned int ec_sdram_width;
  20. unsigned int registered_dimm;
  21. /* SDRAM device parameters */
  22. unsigned int n_row_addr;
  23. unsigned int n_col_addr;
  24. unsigned int edc_config; /* 0 = none, 1 = parity, 2 = ECC */
  25. unsigned int n_banks_per_sdram_device;
  26. unsigned int burst_lengths_bitmask; /* BL=4 bit 2, BL=8 = bit 3 */
  27. unsigned int row_density;
  28. /* used in computing base address of DIMMs */
  29. unsigned long long base_address;
  30. /* mirrored DIMMs */
  31. unsigned int mirrored_dimm; /* only for ddr3 */
  32. /* DIMM timing parameters */
  33. unsigned int mtb_ps; /* medium timebase ps, only for ddr3 */
  34. unsigned int tAA_ps; /* minimum CAS latency time, only for ddr3 */
  35. unsigned int tFAW_ps; /* four active window delay, only for ddr3 */
  36. /*
  37. * SDRAM clock periods
  38. * The range for these are 1000-10000 so a short should be sufficient
  39. */
  40. unsigned int tCKmin_X_ps;
  41. unsigned int tCKmin_X_minus_1_ps;
  42. unsigned int tCKmin_X_minus_2_ps;
  43. unsigned int tCKmax_ps;
  44. /* SPD-defined CAS latencies */
  45. unsigned int caslat_X;
  46. unsigned int caslat_X_minus_1;
  47. unsigned int caslat_X_minus_2;
  48. unsigned int caslat_lowest_derated; /* Derated CAS latency */
  49. /* basic timing parameters */
  50. unsigned int tRCD_ps;
  51. unsigned int tRP_ps;
  52. unsigned int tRAS_ps;
  53. unsigned int tWR_ps; /* maximum = 63750 ps */
  54. unsigned int tWTR_ps; /* maximum = 63750 ps */
  55. unsigned int tRFC_ps; /* max = 255 ns + 256 ns + .75 ns
  56. = 511750 ps */
  57. unsigned int tRRD_ps; /* maximum = 63750 ps */
  58. unsigned int tRC_ps; /* maximum = 254 ns + .75 ns = 254750 ps */
  59. unsigned int refresh_rate_ps;
  60. /* DDR3 doesn't need these as below */
  61. unsigned int tIS_ps; /* byte 32, spd->ca_setup */
  62. unsigned int tIH_ps; /* byte 33, spd->ca_hold */
  63. unsigned int tDS_ps; /* byte 34, spd->data_setup */
  64. unsigned int tDH_ps; /* byte 35, spd->data_hold */
  65. unsigned int tRTP_ps; /* byte 38, spd->trtp */
  66. unsigned int tDQSQ_max_ps; /* byte 44, spd->tdqsq */
  67. unsigned int tQHS_ps; /* byte 45, spd->tqhs */
  68. } dimm_params_t;
  69. extern unsigned int ddr_compute_dimm_parameters(
  70. const generic_spd_eeprom_t *spd,
  71. dimm_params_t *pdimm,
  72. unsigned int dimm_number);
  73. #endif