Go to the documentation of this file.
15 #define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
21 #define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27 #define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
34 #define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
41 #define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46 #define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
50 #ifndef REG_RD_INT_VECT
51 #define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
56 #ifndef REG_WR_INT_VECT
57 #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
63 #define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68 #define reg_page_size 8192
72 #define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77 #define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
86 unsigned int col_width : 4;
87 unsigned int nr_banks : 1;
89 unsigned int nr_ref : 4;
90 unsigned int ref_interval : 11;
91 unsigned int odt_ctrl : 2;
92 unsigned int odt_mem : 1;
93 unsigned int imp_strength : 1;
94 unsigned int auto_imp_cal : 1;
95 unsigned int imp_cal_override : 1;
96 unsigned int dll_override : 1;
97 unsigned int dummy1 : 4;
99 #define REG_RD_ADDR_ddr2_rw_cfg 0
100 #define REG_WR_ADDR_ddr2_rw_cfg 0
105 unsigned int rcd : 3;
107 unsigned int ras : 4;
108 unsigned int rfc : 7;
110 unsigned int rtp : 2;
111 unsigned int rtw : 3;
112 unsigned int wtr : 2;
114 #define REG_RD_ADDR_ddr2_rw_timing 4
115 #define REG_WR_ADDR_ddr2_rw_timing 4
120 unsigned int additive : 3;
121 unsigned int dummy1 : 26;
123 #define REG_RD_ADDR_ddr2_rw_latency 8
124 #define REG_WR_ADDR_ddr2_rw_latency 8
129 unsigned int dummy1 : 31;
131 #define REG_RD_ADDR_ddr2_rw_phy_cfg 12
132 #define REG_WR_ADDR_ddr2_rw_phy_cfg 12
136 unsigned int rst : 1;
137 unsigned int cal_rst : 1;
138 unsigned int cal_start : 1;
139 unsigned int dummy1 : 29;
141 #define REG_RD_ADDR_ddr2_rw_phy_ctrl 16
142 #define REG_WR_ADDR_ddr2_rw_phy_ctrl 16
146 unsigned int mrs_data : 16;
148 unsigned int dummy1 : 8;
150 #define REG_RD_ADDR_ddr2_rw_ctrl 20
151 #define REG_WR_ADDR_ddr2_rw_ctrl 20
155 unsigned int self_ref : 2;
156 unsigned int phy_en : 1;
157 unsigned int dummy1 : 29;
159 #define REG_RD_ADDR_ddr2_rw_pwr_down 24
160 #define REG_WR_ADDR_ddr2_rw_pwr_down 24
164 unsigned int dll_lock : 1;
165 unsigned int dll_delay_code : 7;
166 unsigned int imp_cal_done : 1;
167 unsigned int imp_cal_fault : 1;
168 unsigned int cal_imp_pu : 4;
169 unsigned int cal_imp_pd : 4;
170 unsigned int dummy1 : 14;
172 #define REG_RD_ADDR_ddr2_r_stat 28
176 unsigned int imp_pu : 4;
177 unsigned int imp_pd : 4;
178 unsigned int dummy1 : 24;
180 #define REG_RD_ADDR_ddr2_rw_imp_ctrl 32
181 #define REG_WR_ADDR_ddr2_rw_imp_ctrl 32
183 #define STRIDE_ddr2_rw_dll_ctrl 4
187 unsigned int clk_delay : 7;
188 unsigned int dummy1 : 24;
190 #define REG_RD_ADDR_ddr2_rw_dll_ctrl 36
191 #define REG_WR_ADDR_ddr2_rw_dll_ctrl 36
193 #define STRIDE_ddr2_rw_dqs_dll_ctrl 4
196 unsigned int dqs90_delay : 7;
197 unsigned int dqs180_delay : 7;
198 unsigned int dqs270_delay : 7;
199 unsigned int dqs360_delay : 7;
200 unsigned int dummy1 : 4;
202 #define REG_RD_ADDR_ddr2_rw_dqs_dll_ctrl 52
203 #define REG_WR_ADDR_ddr2_rw_dqs_dll_ctrl 52