blob: 7d4409b51e9882ca3707154f4c8f4939f43880af [file] [log] [blame]
Hans de Goede09f95102014-07-26 16:51:08 +02001#include <common.h>
2#include <asm/arch/dram.h>
3
4static struct dram_para dram_para = {
Hans de Goede8ffc4872015-01-17 14:24:55 +01005 .clock = CONFIG_DRAM_CLK,
Hans de Goede09f95102014-07-26 16:51:08 +02006 .type = 3,
7 .rank_num = 1,
Hans de Goede8ffc4872015-01-17 14:24:55 +01008 .density = 0,
9 .io_width = 0,
10 .bus_width = 0,
Hans de Goede8ffc4872015-01-17 14:24:55 +010011 .zq = CONFIG_DRAM_ZQ,
Hans de Goede8975cdf2015-05-13 15:00:46 +020012 .odt_en = IS_ENABLED(CONFIG_DRAM_ODT_EN),
Hans de Goede8ffc4872015-01-17 14:24:55 +010013 .size = 0,
Siarhei Siamashkad1336472015-02-01 00:27:05 +020014#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
15 .cas = 6,
Hans de Goede09f95102014-07-26 16:51:08 +020016 .tpr0 = 0x30926692,
17 .tpr1 = 0x1090,
18 .tpr2 = 0x1a0c8,
Siarhei Siamashkad1336472015-02-01 00:27:05 +020019 .emr2 = 0,
20#else
21# include "dram_timings_sun4i.h"
Siarhei Siamashka47e35012015-02-01 00:27:06 +020022 .active_windowing = 1,
Siarhei Siamashkad1336472015-02-01 00:27:05 +020023#endif
Siarhei Siamashka47e35012015-02-01 00:27:06 +020024 .tpr3 = CONFIG_DRAM_TPR3,
Hans de Goede09f95102014-07-26 16:51:08 +020025 .tpr4 = 0,
26 .tpr5 = 0,
Hans de Goede8ffc4872015-01-17 14:24:55 +010027 .emr1 = CONFIG_DRAM_EMR1,
Hans de Goede09f95102014-07-26 16:51:08 +020028 .emr3 = 0,
Siarhei Siamashka47e35012015-02-01 00:27:06 +020029 .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
Hans de Goede09f95102014-07-26 16:51:08 +020030};
31
32unsigned long sunxi_dram_init(void)
33{
34 return dramc_init(&dram_para);
35}