blob: 4b78919a5baac2772f3d8b6e092295e60a685b1f [file] [log] [blame]
Simon Glass97589732020-05-10 11:40:02 -06001#include <init.h>
Hans de Goede7f15c692014-07-26 16:51:08 +02002#include <asm/arch/dram.h>
3
4static struct dram_para dram_para = {
Hans de Goede59d9fc72015-01-17 14:24:55 +01005 .clock = CONFIG_DRAM_CLK,
Giulio Benetti0fe7a5f2021-12-03 00:57:54 +01006 .type = DRAM_MEMORY_TYPE_DDR3,
Hans de Goede7f15c692014-07-26 16:51:08 +02007 .rank_num = 1,
Hans de Goede59d9fc72015-01-17 14:24:55 +01008 .density = 0,
9 .io_width = 0,
10 .bus_width = 0,
Hans de Goede59d9fc72015-01-17 14:24:55 +010011 .zq = CONFIG_DRAM_ZQ,
Hans de Goedeffdc05c2015-05-13 15:00:46 +020012 .odt_en = IS_ENABLED(CONFIG_DRAM_ODT_EN),
Hans de Goede59d9fc72015-01-17 14:24:55 +010013 .size = 0,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020014#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
15 .cas = 6,
Hans de Goede7f15c692014-07-26 16:51:08 +020016 .tpr0 = 0x30926692,
17 .tpr1 = 0x1090,
18 .tpr2 = 0x1a0c8,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020019 .emr2 = 0,
20#else
21# include "dram_timings_sun4i.h"
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020022 .active_windowing = 1,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020023#endif
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020024 .tpr3 = CONFIG_DRAM_TPR3,
Hans de Goede7f15c692014-07-26 16:51:08 +020025 .tpr4 = 0,
26 .tpr5 = 0,
Hans de Goede59d9fc72015-01-17 14:24:55 +010027 .emr1 = CONFIG_DRAM_EMR1,
Hans de Goede7f15c692014-07-26 16:51:08 +020028 .emr3 = 0,
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020029 .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
Hans de Goede7f15c692014-07-26 16:51:08 +020030};
31
32unsigned long sunxi_dram_init(void)
33{
34 return dramc_init(&dram_para);
35}