hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
rkbin/tools/ddrbin_tool_user_guide.txt
old mode 100644new mode 100755
....@@ -9,41 +9,63 @@
99 ./ddrbin_tool -g gen_param.txt px30_ddr_333MHz_v1.15.bin
1010 The config will show in gen_param.txt.
1111
12
-Note: The function 1 and function 2 are two separate functions
13
- The gen_param.txt file which is generated by function 2 no need use in function 1.
14
-
1512 The detail information as following:
1613
1714 * support ddrbin version
18
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
19
- | platform | uart info | ddr freq | ssmod | DDR 2T | sr pd | drv, odt, Vref etc| dis training info | eye sacn | res space remap|
20
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
21
- | PX30/RK3326 | V1.11 | X | X | V1.12 | V1.15 | X | X | X | X |
22
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
23
- | RK1808 | V1.03 | V1.03 | X | V1.03 | V1.04 | X | X | X | X |
24
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
25
- | RK322x | V1.08 | V1.08 | X | V1.09 | X | X | X | X | X |
26
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
27
- | RK322xh | V1.14 | X | X | V1.16 | V1.17 | X | X | X | X |
28
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
29
- | RK3288 | V1.07 | X | X | V1.08 | X | X | X | X | X |
30
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
31
- | RK3308 | V1.28 | V1.28 | X | V1.29 | V1.30 | X | X | X | X |
32
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
33
- | RK3368 | V2.04 | V2.04 | X | V2.05 | X | X | X | X | X |
34
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
35
- | RK3328 | V1.14 | X | X | V1.16 | V1.17 | X | X | X | X |
36
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
37
- | RK3399 | V1.25 | X | V1.25 | X | X | X | X | X | X |
38
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
39
- | RK3399PRO NPU | V1.03 | V1.03 | X | V1.03 | X | X | X | X | X |
40
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
41
- | RV1126/RV1109 | V1.00 | V1.00 | V1.05 | V1.00 | V1.05 | V1.05 | X | X | X |
42
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
43
- | RK3566/RK3568 | V1.00 | V1.00 | V1.06 | V1.00 | V1.00 | V1.06 | V1.07 | X | X |
44
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
45
- | RK3588 | V1.00 | V1.00 | X | V1.00 | V1.00 | V1.00 | V1.03 | V1.06 | V1.06 |
46
- +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------+----------+----------------+
15
+ The 'X' means not support change those parameters by tool.
16
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
17
+ | platform | uart info | ddr freq | ssmod | DDR 2T | sr pd | drv, odt, Vref etc| dis print training info | dis CBT |
18
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
19
+ | RV1108 | V1.08 | V1.08 | V1.10 | V1.08 | V1.08 | X | X | X |
20
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
21
+ | PX30/RK3326 | V1.11 | X | V1.16 | V1.12 | V1.15 | X | X | X |
22
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
23
+ | RK1808 | V1.03 | V1.03 | V1.05 | V1.03 | V1.04 | X | X | X |
24
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
25
+ | RK322x | V1.08 | V1.08 | X | V1.09 | X | X | X | X |
26
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
27
+ | RK322xh | V1.14 | X | V1.17 | V1.16 | V1.17 | X | X | X |
28
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
29
+ | RK3288 | V1.11 | X | X | V1.11 | X | X | X | X |
30
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
31
+ | RK3308 | V1.28 | V1.28 | V1.31 | V1.29 | V1.30 | X | X | X |
32
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
33
+ | RK3308S | V2.05 | V2.05 | V2.05 | V2.05 | V2.05 | X | X | X |
34
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
35
+ | RK3368 | V2.04 | V2.04 | X | V2.05 | X | X | X | X |
36
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
37
+ | RK3328 | V1.14 | X | V1.17 | V1.16 | V1.17 | X | X | X |
38
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
39
+ | RK3399 | V1.25 | X | V1.25 | X | X | X | X | X |
40
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
41
+ | RK3399PRO NPU | V1.03 | V1.03 | X | V1.03 | X | X | X | X |
42
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
43
+ | RV1126/RV1109 | V1.00 | V1.00 | V1.05 | V1.00 | V1.05 | V1.05 | X | X |
44
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
45
+ | RK3566/RK3568 | V1.00 | V1.00 | V1.06 | V1.00 | V1.00 | V1.06 | V1.07 | X |
46
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
47
+ | RK3588 | V1.00 | V1.00 | X | V1.00 | V1.00 | V1.00 | X | X |
48
+ +---------------+-----------+----------+-------+--------+-------+-------------------+-------------------------+---------+
49
+
50
+| function | platform and ddrbin version |
51
+| ------------------------------- | -------------------------------------- |
52
+| first scan channel/channel mask | RK3588 V1.00/RK3399 V1.25/RK3288 V1.11 |
53
+| stride type | RK3588 V1.00/RK3399 V1.25/RK3288 V1.11 |
54
+| ext_temp_ref | Null |
55
+| link_ecc_en | Null |
56
+| per_bank_ref_en | RK3588 V1.09 |
57
+| derate_en | RK3588 V1.09 |
58
+| auto_precharge_en | Null |
59
+| res_space_remap_portion | RK3588 V1.09 |
60
+| res_space_remap_all | RK3588 V1.09 |
61
+| rd_vref_scan_en | RK3588 V1.08 |
62
+| wr_vref_scan_en | RK3588 V1.08 |
63
+| eye_2d_scan_en | RK3588 V1.08 |
64
+| ch/bank/rank_mask | RK3588 V1.00 |
65
+| pstore base_addr/buf_size | RK3588 V1.09 |
66
+| uboot/atf/optee/spl/tpl log en | RK3588 V1.09 |
67
+| boot_fsp | RK3588 V1.09 |
68
+| pageclose | RK3588 V1.10 |
4769
4870 * UART info
4971
....@@ -54,18 +76,85 @@
5476
5577 * disable print training information
5678
57
-dis_printf_training: 1: will disabled print training information; 0: will enable print training information.
79
+dis_train_print: 1: will disabled print training information; 0: will enable print training information.
5880
59
-* remap pcie 100M reg to DDR
81
+* recycle registers space(remap register space to DDR)
6082
61
-res_space_remap: 1: will remap pcie 100M reg to DDR memory space.
83
+res_space_remap_portion
84
+1: will remap the part of registers to DDR memory space(will not larger than 4GB).
85
+It is PCIE and some reserved space in RK3588, and the PCIE can not be used when set to 1.
86
+
87
+res_space_remap_all
88
+1: will wrap all registers space(include res_space_remap_portion enable space) to DDR memory space. This space would be place in larger than 4GB.
89
+The PCIE can be used when set to 1 in RK3588.
6290
6391 * DDR eye scanning
6492 1) eye_2d_scan_en: 1: will enable 2D eye scanning for debug purpose, vref and skew eye scanning.
6593 2) wr_vref_scan_en: 1: enable vref scan and use scanning result for write.
6694 3) rd_vref_scan_en: 1: enable vref scan and use scanning result for read.
6795
68
-* DDR (final) freq(ddrx_f0_freq_mhz)
96
+* DDR auto precharge
97
+
98
+auto_precharge_en: 1: will enable the DDR auto precharge.
99
+
100
+* DDR refresh derate
101
+
102
+derate_en: 1: will enable derate function of the LP2/LP3/LP4/LP4X/LP5.
103
+The high temperature will issue more refresh command and the low temperature will less.
104
+
105
+* DDR per bank refresh
106
+
107
+per_bank_ref_en: 1: will enable per bank refresh
108
+
109
+* link ECC enable
110
+
111
+link_ecc_en: 1: read/write link ecc enable.
112
+
113
+* Extended temperature refresh
114
+
115
+ext_temp_ref:
116
+ 0: ref1x for normal chip, 2x for 3568M/3568J
117
+ 1: fix 2x ref for all chip
118
+ 2: fix 4x ref for all chip
119
+ 3: fix 1x ref for all chip
120
+Note: If derate-enabled DDR are configured with derate_en=1, the ext_temp_ref configuration does not take effect.
121
+
122
+* pstore_base_addr pstore_buf_size
123
+The pstore buffer base address: pstore_base_addr << 16, 64kB align.
124
+The pstore buffer size: pstore_buf_size * 4KB.
125
+It is define the addr and size to save ddrbin log for last log.
126
+
127
+* uboot_log_en
128
+1: enable uboot log.
129
+0: disable uboot log.
130
+
131
+* atf_log_en
132
+1: enable atf log.
133
+0: disable atf log.
134
+
135
+* optee_log_en
136
+1: enable optee log.
137
+0: disable optee log.
138
+
139
+* spl_log_en
140
+1: enable spl log.
141
+0: disable spl log.
142
+
143
+* tpl_log_en
144
+1: enable tpl log.
145
+0: disable tpl log.
146
+
147
+* pageclose
148
+1: enable pageclose.
149
+0: disable pageclose.
150
+
151
+* boot_fsp
152
+To choose the which DDR freq to boot system. 0 means fsp0_freq, 1 means fsp1_freq, 2 means fsp2_freq, 3 means fsp3_freq, the default is 0.
153
+
154
+* DDR (final) freq(also called ddrx_f0_freq_mhz/fsp0_freq)
155
+
156
+For RK3588, the boot_fsp used to choose which ddrx_fx_freq_mhz/fspx_freq to boot system, default is ddrx_f0_freq_mhz/fsp0_freq.
157
+For the others platform, it is the final freq to boot system.
69158
70159 ddr2_freq(ddr2_f0_freq_mhz): ddr2 frequency, unit:MHz.
71160 lp2_freq (lp2_f0_freq_mhz): lpddr2 frequency, unit:MHz.
....@@ -76,47 +165,55 @@
76165 lp4x_freq(lp4x_f0_freq_mhz): lpddr4x frequency, unit:MHz.
77166 lp5_freq (lp5_f0_freq_mhz): lpddr5 frequency, unit:MHz.
78167
79
-For RV1126/RV1109, RK3566/RK3568, RK3588 those frequencies are the final freq in loader.
80
-
81
-+---------------+--------------------------------------------------------+
82
-| platform | support frequencies |
83
-+---------------+--------------------------------------------------------+
84
-| PX30/RK3326 | X |
85
-+---------------+--------------------------------------------------------+
86
-| RK1808 | 333,400,533,666,786,933 |
87
-+---------------+--------------------------------------------------------+
88
-| RK322x | not larger than 800 |
89
-+---------------+--------------------------------------------------------+
90
-| RK322xh | X |
91
-+---------------+--------------------------------------------------------+
92
-| RK3288 | X |
93
-+---------------+--------------------------------------------------------+
94
-| RK3308 | 393,451,589 |
95
-+---------------+--------------------------------------------------------+
96
-| RK3368 | DDR3 not larger than 800, LP3 not larger than 666 |
97
-+---------------+--------------------------------------------------------+
98
-| RK3328 | X |
99
-+---------------+--------------------------------------------------------+
100
-| RK3399 | X |
101
-+---------------+--------------------------------------------------------+
102
-| RK3399PRO NPU | 333,400,533,666,786,933 |
103
-+---------------+--------------------------------------------------------+
104
-| RV1126/RV1109 | 328,396,528,664,784,924,1056 |
105
-+---------------+--------------------------------------------------------+
106
-| RK3566/RK3568 | 324,396,528,630,780,920,1056,1184,1332,1560 |
107
-+---------------+--------------------------------------------------------+
108
-| RK3588 | LP4/LP4x [306.5MHz - 2133MHz]; LP5: [400MHz - 2750MHz] |
109
-+---------------+--------------------------------------------------------+
168
+* support ddr frequency:
169
+The 'X' as follows means not support change frequencies by tool.
170
++---------------+-----------------------------------------------------------------+
171
+| platform | support frequencies(MHZ) |
172
++---------------+-----------------------------------------------------------------+
173
+| RK1108 | DDR2: 400; LP2: <= 533; DDR3: <= 800 |
174
++---------------+-----------------------------------------------------------------+
175
+| PX30/RK3326 | X |
176
++---------------+-----------------------------------------------------------------+
177
+| RK1808 | 333,400,533,666,786,933 |
178
++---------------+-----------------------------------------------------------------+
179
+| RK322x | DDR2/LP2: <= 533; others: <= 800 |
180
++---------------+-----------------------------------------------------------------+
181
+| RK322xh | X |
182
++---------------+-----------------------------------------------------------------+
183
+| RK3288 | X |
184
++---------------+-----------------------------------------------------------------+
185
+| RK3308/RK3308S| DDR2/LP2: 393,451; DDR3: 393,451,589 |
186
++---------------+-----------------------------------------------------------------+
187
+| RK3368 | DDR3: <= 800; LP3: <= 666 |
188
++---------------+-----------------------------------------------------------------+
189
+| RK3328 | X |
190
++---------------+-----------------------------------------------------------------+
191
+| RK3399 | X |
192
++---------------+-----------------------------------------------------------------+
193
+| RK3399PRO NPU | 333,400,533,666,786,933 |
194
++---------------+-----------------------------------------------------------------+
195
+| RV1126/RV1109 | 328,396,528,664,784,924,1056 |
196
++---------------+-----------------------------------------------------------------+
197
+| RK3566 | 324,396,528,630,780,920,1056 |
198
++---------------+-----------------------------------------------------------------+
199
+| RK3568 | DDR3/LP3: 324,396,528,630,780,920,1056 |
200
+| | DDR4/LP4/LP4X: 324,396,528,630,780,920,1056,1184,1332,1560 |
201
++---------------+-----------------------------------------------------------------+
202
+| RK3588 | LP4/LP4x [306.5MHz - 2133MHz]; LP5: [400MHz - 2750MHz] |
203
++---------------+-----------------------------------------------------------------+
204
+| RK3528 | DDR3/LP3: 324,396,528,630,780,920,1056 |
205
+| | DDR4/LP4/LP4X: 324,396,528,630,780,920,1056,1184 |
206
++---------------+-----------------------------------------------------------------+
110207
111208 * DDR frequencies(add more)
112209
113
-ddr2_f1_freq_mhz: ddr2 frequency number 1, unit:MHz.
114
-ddr2_f2_freq_mhz: ddr2 frequency number 2, unit:MHz.
115
-ddr2_f3_freq_mhz: ddr2 frequency number 3, unit:MHz.
116
-ddr2_f4_freq_mhz: ddr2 frequency number 4, unit:MHz.
117
-ddr2_f5_freq_mhz: ddr2 frequency number 5, unit:MHz.
210
+ddr2_f1_freq_mhz: ddr2 frequency fsp 1, unit:MHz.
211
+ddr2_f2_freq_mhz: ddr2 frequency fsp 2, unit:MHz.
212
+ddr2_f3_freq_mhz: ddr2 frequency fsp 3, unit:MHz.
213
+ddr2_f4_freq_mhz: ddr2 frequency fsp 4, unit:MHz.
214
+ddr2_f5_freq_mhz: ddr2 frequency fsp 5, unit:MHz.
118215 ...
119
-The ddrx_f0_freq_mhz is named ddrx_freq.
216
+The ddrx_f0_freq_mhz(the fsp0 frequency) is named ddrx_freq.
120217
121218 ddr*_f*_freq_mhz/lp*_f*_freq_mhz: Only RV1126/RV1109, RK3566/RK3568, RK3588 used.
122219 The program will initialize dram by following order.
....@@ -134,6 +231,8 @@
134231 ddr4_f3_freq_mhz=780
135232 ...
136233
234
+Note: The ddr frequency table in kernel dts/dtsi file need correspond to these frequencies.
235
+
137236 * SR PD idle
138237
139238 sr_idle: auto self-refresh mode delay time.
....@@ -146,7 +245,7 @@
146245 * PLL ssmod
147246
148247 These parameters are about Spread Spectrum Modulator(ssmod) for PLL.
149
-ssmod_downspread: ssmod work mode. 0: down spread, 1: center spread.
248
+ssmod_downspread: ssmod work mode. 1: down spread, 0: center spread.
150249 ssmod_div: Divider required to set the modulation frequency. RK3308 suggests to ssmod_div=2, others platforms suggest to ssmod_div=5.
151250 ssmod_spread: spread amplitude % = 0.1 * ssmod_spread; 0: disable ssmod, others will enable ssmod, max to 0x1f.
152251
....@@ -180,6 +279,13 @@
180279 +---------------+-------------------+-------------------+--------------+-----------------+----------------+----------------+-------------+
181280 | RK3588 | X | X | X | 240,120,80,60, | follow LP4 | follow LP4 | follow LP4 |
182281 | | | | | 48,40,34,30 | | | |
282
++---------------+-------------------+-------------------+--------------+-----------------+----------------+----------------+-------------+
283
+| | 572,289,195,145, | 595,300,202,151, | | 654,328,221,165,| 585,297,202, | 585,297,202, | |
284
+| | 117,99,85,73,66, | 122,102,89,76,68, | |133,112,97,83,74,| 150,122,103,90,| 150,122,103,90,| |
285
+| RK3528 | 60,55,50,47,44,41,| 62,57,52,49,45,43,| follow DDR4 | 67,62,57,53,49, | 77,69,63,58,53,| 77,69,63,58,53,| X |
286
+| | 38,36,34,33,31,30,| 39,37,35,34,32,31,| | 46,43,40,38,37, | 50,47,44,40,38,| 50,47,44,40,38,| |
287
+| | 29,28 | 30,29 | | 35,33,32,31 | 37,35,33,32,31,| 37,35,33,32,31,| |
288
+| | | | | | 30 | 30 | |
183289 +---------------+-------------------+-------------------+--------------+-----------------+----------------+----------------+-------------+
184290
185291 The DRAM side driver strength support value as follows:
....@@ -218,7 +324,13 @@
218324 | RK3588 | X | X | X | 0,240,120,80, | follow LP4 | follow LP4 | follow LP4 |
219325 | | | | | 60,48,40,34,30 | | | |
220326 +---------------+-------------------+--------------------+--------------+-------------------+----------------+----------------+-------------+
221
-
327
+| | 572,289,195,145, | 595,300,202,151, | | 654,328,221,165, | 585,297,202, | 585,297,202, | |
328
+| | 117,99,85,73,66, | 122,102,89,76,68, | |133,112,97,83,74, | 150,122,103,90,| 150,122,103,90,| |
329
+| RK3528 | 60,55,50,47,44,41,| 62,57,52,49,45,43, | follow DDR4 | 67,62,57,53,49, | 77,69,63,58,53,| 77,69,63,58,53,| X |
330
+| | 38,36,34,33,31,30,| 39,37,35,34,32,31, | | 46,43,40,38,37, | 50,47,44,40,38,| 50,47,44,40,38,| |
331
+| | 29,28 | 30,29 | | 35,33,32,31 | 37,35,33,32,31,| 37,35,33,32,31,| |
332
+| | | | | | 30 | 30 | |
333
++---------------+-------------------+--------------------+--------------+-------------------+----------------+----------------+-------------+
222334 The DRAM side ODT support value as follows:
223335 +---------------+-------------------+-------------------+--------------+-----------------------+----------------+---------------+
224336 | platform | DDR3 | DDR4 | LP3 | LP4(include DQ and CA)| LP4X | LP5 |