blob: e8bbee4ee5e010f7b79ccc597bed224e79b441cf [file] [log] [blame]
Hans de Goede7f15c692014-07-26 16:51:08 +02001#include <common.h>
Simon Glass97589732020-05-10 11:40:02 -06002#include <init.h>
Hans de Goede7f15c692014-07-26 16:51:08 +02003#include <asm/arch/dram.h>
4
5static struct dram_para dram_para = {
Hans de Goede59d9fc72015-01-17 14:24:55 +01006 .clock = CONFIG_DRAM_CLK,
Hans de Goede7f15c692014-07-26 16:51:08 +02007 .type = 3,
8 .rank_num = 1,
Hans de Goede59d9fc72015-01-17 14:24:55 +01009 .density = 0,
10 .io_width = 0,
11 .bus_width = 0,
Hans de Goede59d9fc72015-01-17 14:24:55 +010012 .zq = CONFIG_DRAM_ZQ,
Hans de Goedeffdc05c2015-05-13 15:00:46 +020013 .odt_en = IS_ENABLED(CONFIG_DRAM_ODT_EN),
Hans de Goede59d9fc72015-01-17 14:24:55 +010014 .size = 0,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020015#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
16 .cas = 6,
Hans de Goede7f15c692014-07-26 16:51:08 +020017 .tpr0 = 0x30926692,
18 .tpr1 = 0x1090,
19 .tpr2 = 0x1a0c8,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020020 .emr2 = 0,
21#else
22# include "dram_timings_sun4i.h"
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020023 .active_windowing = 1,
Siarhei Siamashka9900db12015-02-01 00:27:05 +020024#endif
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020025 .tpr3 = CONFIG_DRAM_TPR3,
Hans de Goede7f15c692014-07-26 16:51:08 +020026 .tpr4 = 0,
27 .tpr5 = 0,
Hans de Goede59d9fc72015-01-17 14:24:55 +010028 .emr1 = CONFIG_DRAM_EMR1,
Hans de Goede7f15c692014-07-26 16:51:08 +020029 .emr3 = 0,
Siarhei Siamashka47359bb2015-02-01 00:27:06 +020030 .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
Hans de Goede7f15c692014-07-26 16:51:08 +020031};
32
33unsigned long sunxi_dram_init(void)
34{
35 return dramc_init(&dram_para);
36}