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