2015-01-21 15:14:00 +00:00
|
|
|
/* DRAM parameters for auto dram configuration on sun5i and sun7i */
|
2015-01-17 21:31:30 +00:00
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2015-01-17 21:31:30 +00:00
|
|
|
#include <asm/arch/dram.h>
|
|
|
|
|
|
|
|
static struct dram_para dram_para = {
|
|
|
|
.clock = CONFIG_DRAM_CLK,
|
2015-01-31 22:27:06 +00:00
|
|
|
.mbus_clock = CONFIG_DRAM_MBUS_CLK,
|
2015-01-17 21:31:30 +00:00
|
|
|
.type = 3,
|
|
|
|
.rank_num = 1,
|
|
|
|
.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 21:31:30 +00:00
|
|
|
.size = 0,
|
2015-01-31 22:27:05 +00:00
|
|
|
#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
|
|
|
|
.cas = 9,
|
2015-01-17 21:31:30 +00:00
|
|
|
.tpr0 = 0x42d899b7,
|
|
|
|
.tpr1 = 0xa090,
|
|
|
|
.tpr2 = 0x22a00,
|
2015-01-31 22:27:05 +00:00
|
|
|
.emr2 = 0x10,
|
|
|
|
#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-02-23 20:44:10 +00:00
|
|
|
.tpr3 = CONFIG_DRAM_TPR3,
|
2015-01-17 21:31:30 +00:00
|
|
|
.tpr4 = 0,
|
|
|
|
.tpr5 = 0,
|
|
|
|
.emr1 = CONFIG_DRAM_EMR1,
|
|
|
|
.emr3 = 0,
|
2015-01-31 22:27:06 +00:00
|
|
|
.dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
|
2015-01-17 21:31:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unsigned long sunxi_dram_init(void)
|
|
|
|
{
|
|
|
|
return dramc_init(&dram_para);
|
|
|
|
}
|