dfs.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef DFS_H
  7. #define DFS_H
  8. #include <stdint.h>
  9. struct rk3399_sdram_default_config {
  10. unsigned char bl;
  11. /* 1:auto precharge, 0:never auto precharge */
  12. unsigned char ap;
  13. /* dram driver strength */
  14. unsigned char dramds;
  15. /* dram ODT, if odt=0, this parameter invalid */
  16. unsigned char dramodt;
  17. /* ca ODT, if odt=0, this parameter invalid
  18. * only used by LPDDR4
  19. */
  20. unsigned char caodt;
  21. unsigned char burst_ref_cnt;
  22. /* zqcs period, unit(s) */
  23. unsigned char zqcsi;
  24. };
  25. struct drv_odt_lp_config {
  26. uint32_t pd_idle;
  27. uint32_t sr_idle;
  28. uint32_t sr_mc_gate_idle;
  29. uint32_t srpd_lite_idle;
  30. uint32_t standby_idle;
  31. uint32_t odt_en;
  32. uint32_t dram_side_drv;
  33. uint32_t dram_side_dq_odt;
  34. uint32_t dram_side_ca_odt;
  35. };
  36. uint32_t ddr_set_rate(uint32_t hz);
  37. uint32_t ddr_round_rate(uint32_t hz);
  38. uint32_t ddr_get_rate(void);
  39. uint32_t dram_set_odt_pd(uint32_t arg0, uint32_t arg1, uint32_t arg2);
  40. void dram_dfs_init(void);
  41. void ddr_prepare_for_sys_suspend(void);
  42. void ddr_prepare_for_sys_resume(void);
  43. #endif /* DFS_H */