sdram_port.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-12-05 zylx The first version for STM32F4xx
  9. * 2019-4-25 misonyo port to IMXRT
  10. */
  11. #ifndef SDRAM_PORT_H__
  12. #define SDRAM_PORT_H__
  13. /* parameters for sdram peripheral */
  14. #define SDRAM_BANK_ADDR ((uint32_t)0x80000000U)
  15. /* region#0/1/2/3: kSEMC_SDRAM_CS0/1/2/3 */
  16. #define SDRAM_REGION kSEMC_SDRAM_CS0
  17. /* CS pin: kSEMC_MUXCSX0/1/2/3 */
  18. #define SDRAM_CS_PIN kSEMC_MUXCSX0
  19. /* size(kbyte):32MB = 32*1024*1KBytes */
  20. #define SDRAM_SIZE ((uint32_t)0x8000)
  21. /* data width: kSEMC_PortSize8Bit,kSEMC_PortSize16Bit */
  22. #define SDRAM_DATA_WIDTH kSEMC_PortSize16Bit
  23. /* column bit numbers: kSEMC_SdramColunm_9/10/11/12bit */
  24. #define SDRAM_COLUMN_BITS kSEMC_SdramColunm_9bit
  25. /* cas latency clock number: kSEMC_LatencyOne/Two/Three */
  26. #define SDRAM_CAS_LATENCY kSEMC_LatencyThree
  27. /* Timing configuration for W9825G6KH */
  28. /* TRP:precharge to active command time (ns) */
  29. #define SDRAM_TRP 18
  30. /* TRCD:active to read/write command delay time (ns) */
  31. #define SDRAM_TRCD 18
  32. /* The time between two refresh commands,Use the maximum of the (Trfc , Txsr).(ns) */
  33. #define SDRAM_REFRESH_RECOVERY 67
  34. /* TWR:write recovery time (ns). */
  35. #define SDRAM_TWR 12
  36. /* TRAS:active to precharge command time (ns). */
  37. #define SDRAM_TRAS 42
  38. /* TRC time (ns). */
  39. #define SDRAM_TRC 60
  40. /* active to active time (ns). */
  41. #define SDRAM_ACT2ACT 60
  42. /* refresh time (ns). 64ms */
  43. #define SDRAM_REFRESH_ROW 64 * 1000000 / 8192
  44. #endif /* SDRAM_PORT_H__ */