dram_sun5i_auto.c 783 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* DRAM parameters for auto dram configuration on sun5i and sun7i */
  2. #include <common.h>
  3. #include <asm/arch/dram.h>
  4. static struct dram_para dram_para = {
  5. .clock = CONFIG_DRAM_CLK,
  6. .mbus_clock = CONFIG_DRAM_MBUS_CLK,
  7. .type = 3,
  8. .rank_num = 1,
  9. .density = 0,
  10. .io_width = 0,
  11. .bus_width = 0,
  12. .zq = CONFIG_DRAM_ZQ,
  13. .odt_en = IS_ENABLED(CONFIG_DRAM_ODT_EN),
  14. .size = 0,
  15. #ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
  16. .cas = 9,
  17. .tpr0 = 0x42d899b7,
  18. .tpr1 = 0xa090,
  19. .tpr2 = 0x22a00,
  20. .emr2 = 0x10,
  21. #else
  22. # include "dram_timings_sun4i.h"
  23. .active_windowing = 1,
  24. #endif
  25. .tpr3 = CONFIG_DRAM_TPR3,
  26. .tpr4 = 0,
  27. .tpr5 = 0,
  28. .emr1 = CONFIG_DRAM_EMR1,
  29. .emr3 = 0,
  30. .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
  31. };
  32. unsigned long sunxi_dram_init(void)
  33. {
  34. return dramc_init(&dram_para);
  35. }