dram_sun4i_auto.c 673 B

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