2014-07-26 14:51:08 +00:00
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2014-07-26 14:51:08 +00:00
|
|
|
#include <asm/arch/dram.h>
|
|
|
|
|
|
|
|
static struct dram_para dram_para = {
|
2015-01-17 13:24:55 +00:00
|
|
|
.clock = CONFIG_DRAM_CLK,
|
2014-07-26 14:51:08 +00:00
|
|
|
.type = 3,
|
|
|
|
.rank_num = 1,
|
2015-01-17 13:24:55 +00:00
|
|
|
.density = 0,
|
|
|
|
.io_width = 0,
|
|
|
|
.bus_width = 0,
|
|
|
|
.zq = CONFIG_DRAM_ZQ,
|
2015-05-13 13:00:46 +00:00
|
|
|
.odt_en = IS_ENABLED(CONFIG_DRAM_ODT_EN),
|
2015-01-17 13:24:55 +00:00
|
|
|
.size = 0,
|
2015-01-31 22:27:05 +00:00
|
|
|
#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
|
|
|
|
.cas = 6,
|
2014-07-26 14:51:08 +00:00
|
|
|
.tpr0 = 0x30926692,
|
|
|
|
.tpr1 = 0x1090,
|
|
|
|
.tpr2 = 0x1a0c8,
|
2015-01-31 22:27:05 +00:00
|
|
|
.emr2 = 0,
|
|
|
|
#else
|
|
|
|
# include "dram_timings_sun4i.h"
|
2015-01-31 22:27:06 +00:00
|
|
|
.active_windowing = 1,
|
2015-01-31 22:27:05 +00:00
|
|
|
#endif
|
2015-01-31 22:27:06 +00:00
|
|
|
.tpr3 = CONFIG_DRAM_TPR3,
|
2014-07-26 14:51:08 +00:00
|
|
|
.tpr4 = 0,
|
|
|
|
.tpr5 = 0,
|
2015-01-17 13:24:55 +00:00
|
|
|
.emr1 = CONFIG_DRAM_EMR1,
|
2014-07-26 14:51:08 +00:00
|
|
|
.emr3 = 0,
|
2015-01-31 22:27:06 +00:00
|
|
|
.dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
|
2014-07-26 14:51:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unsigned long sunxi_dram_init(void)
|
|
|
|
{
|
|
|
|
return dramc_init(&dram_para);
|
|
|
|
}
|