dram_sun5i_auto.c 801 B

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