1
2
3
4
5
6#include <common.h>
7#include <init.h>
8#include <spl.h>
9#include <asm/arch/mx6-ddr.h>
10
11
12static struct mx6dq_iomux_ddr_regs ot1200_ddr_ioregs = {
13
14 .dram_sdclk_0 = 0x00000028,
15 .dram_sdclk_1 = 0x00000028,
16 .dram_cas = 0x00000028,
17 .dram_ras = 0x00000028,
18 .dram_reset = 0x00000028,
19
20 .dram_sdcke0 = 0x00003000,
21 .dram_sdcke1 = 0x00003000,
22
23 .dram_sdba2 = 0x00000000,
24
25 .dram_sdodt0 = 0x00000028,
26 .dram_sdodt1 = 0x00000028,
27
28 .dram_sdqs0 = 0x00000028,
29 .dram_sdqs1 = 0x00000028,
30 .dram_sdqs2 = 0x00000028,
31 .dram_sdqs3 = 0x00000028,
32 .dram_sdqs4 = 0x00000028,
33 .dram_sdqs5 = 0x00000028,
34 .dram_sdqs6 = 0x00000028,
35 .dram_sdqs7 = 0x00000028,
36
37 .dram_dqm0 = 0x00000028,
38 .dram_dqm1 = 0x00000028,
39 .dram_dqm2 = 0x00000028,
40 .dram_dqm3 = 0x00000028,
41 .dram_dqm4 = 0x00000028,
42 .dram_dqm5 = 0x00000028,
43 .dram_dqm6 = 0x00000028,
44 .dram_dqm7 = 0x00000028,
45};
46
47
48static struct mx6dq_iomux_grp_regs ot1200_grp_ioregs = {
49
50 .grp_ddr_type = 0x000c0000,
51 .grp_ddrmode_ctl = 0x00020000,
52
53 .grp_ddrpke = 0x00000000,
54
55 .grp_addds = 0x00000028,
56
57 .grp_ctlds = 0x00000028,
58
59 .grp_ddrmode = 0x00020000,
60 .grp_b0ds = 0x00000028,
61 .grp_b1ds = 0x00000028,
62 .grp_b2ds = 0x00000028,
63 .grp_b3ds = 0x00000028,
64 .grp_b4ds = 0x00000028,
65 .grp_b5ds = 0x00000028,
66 .grp_b6ds = 0x00000028,
67 .grp_b7ds = 0x00000028,
68};
69
70static struct mx6_ddr_sysinfo ot1200_ddr_sysinfo = {
71
72 .dsize = 2,
73
74 .cs_density = 32,
75
76 .ncs = 1,
77 .cs1_mirror = 0,
78 .rtt_wr = 1,
79 .rtt_nom = 1,
80 .walat = 1,
81 .ralat = 5,
82 .mif3_mode = 3,
83 .bi_on = 1,
84 .sde_to_rst = 0x10,
85 .rst_to_cke = 0x23,
86 .refsel = 1,
87 .refr = 7,
88};
89
90
91static struct mx6_ddr3_cfg micron_2gib_1600 = {
92 .mem_speed = 1600,
93 .density = 2,
94 .width = 16,
95 .banks = 8,
96 .rowaddr = 14,
97 .coladdr = 10,
98 .pagesz = 2,
99 .trcd = 1375,
100 .trcmin = 4875,
101 .trasmin = 3500,
102 .SRT = 1,
103};
104
105static struct mx6_mmdc_calibration micron_2gib_1600_mmdc_calib = {
106
107 .p0_mpwldectrl0 = 0x00260025,
108 .p0_mpwldectrl1 = 0x00270021,
109 .p1_mpwldectrl0 = 0x00180034,
110 .p1_mpwldectrl1 = 0x00180024,
111
112 .p0_mpdgctrl0 = 0x04380344,
113 .p0_mpdgctrl1 = 0x0330032C,
114 .p1_mpdgctrl0 = 0x0338033C,
115 .p1_mpdgctrl1 = 0x032C0300,
116
117 .p0_mprddlctl = 0x3C2E3238,
118 .p1_mprddlctl = 0x3A2E303C,
119
120 .p0_mpwrdlctl = 0x36384036,
121 .p1_mpwrdlctl = 0x442E4438,
122};
123
124static void ot1200_spl_dram_init(void)
125{
126 mx6dq_dram_iocfg(64, &ot1200_ddr_ioregs, &ot1200_grp_ioregs);
127 mx6_dram_cfg(&ot1200_ddr_sysinfo, µn_2gib_1600_mmdc_calib,
128 µn_2gib_1600);
129}
130
131
132
133
134
135
136void board_init_f(ulong dummy)
137{
138
139 arch_cpu_init();
140
141
142 board_early_init_f();
143
144
145 timer_init();
146
147
148 preloader_console_init();
149
150
151 ot1200_spl_dram_init();
152}
153