4/29/2020
Loongson 3A3000 / 3B3000 Processor User Manual
47
Page 58
Godson 3A3000 / 3B3000 Processor User Manual • Volume 1
54
(8) Sampling Lvl_resp_x (0x180, 0x188) register, if it is 0, the corresponding Dll_wrdqs_x [6: 0]
Increase 1 and repeat 5-7; if it is 1, it means that the Write Leveling operation has been successful;
(9) At this time, the value of Dll_wrdqs_x should be the correct setting value.
(10) At this point, the Write Leveling operation ends. If in this process, Lvl_resp_x is found at the first sampling
Is 1, the result is problematic, you should check whether other registers have wrong settings.
The memory may include Wrdqs_lt_half, Dqs_start_edge, Dqs_stop_edge, Dqs_oe_begin,
Dqs_oe_end.
(11) Then set Wrdqs_lt_half_x according to whether the value of Dll_wrdqs_x is less than 0x40;
(12) Set Dll_wrdata_x according to whether the value of Dll_wrdqs_x is less than 0x20. If Dll_wrdqs_x>
0x20, Dll_wrdata_x = Dll_wrdqs_x – 0x20, otherwise Dll_wrdata_x = Dll_wrdqs_x
+ 0x60;
(13) Set Wrdata_lt_half_x according to whether the value of Dll_wrdata_x is less than 0x40;
(14) Determine whether the following conditions exist: different Dll_wrdata_x values are near 0x40, and there are edges crossing 0x40
The situation appears (refer to some Dll_wrdata_x is slightly less than 0x40, and some Dll_wrdata_x is slightly greater than
0x40). If this happens, set the corresponding Wrdata_lt_half_x == 0 data set
Write_clk_delay_x is 1. Then reduce the values of tPHY_WRDATA and tRDDATA by 1;
(15) Set Lvl_mode (0x180) to 2'b00 to exit Write Leveling mode;
9.5.3.2 Gate Leveling
Gate Leveling is used to configure the timing of enabling the sampling and reading DQS window in the controller. Refer to the following steps for software programming.
(1)
Complete the controller initialization, see the previous section;
(2) Complete Write Leveling, see the previous section;
(3) Set Dll_gate_x (x = 0… 8) to 0;
(4) Set Lvl_mode (0x180) to 2'b10;
(5) Sampling the Lvl_ready (0x180) register, if it is 1, it means that the Gate Leveling request can be started;
(6) Set Lvl_req (0x180) to 1;
(7) Sampling the Lvl_done (0x180) register, if it is 1, it means that a Gate Leveling request is completed;
(8) Sampling Lvl_resp_x [0] (0x180, 0x188) register. If the first sample finds Lvl_resp_x [0]
Is 1, increase the corresponding Dll_gate_x [6: 0] by 1 and repeat 6-8 until the sampling result is 0
Otherwise, proceed to the next step;
(9) If the sampling result is 0, increase the corresponding Dll_gate_x [6: 0] by 1 and repeat 6-9; if it is
1, it means that the Gate Leveling operation has been successful;
Page 59
Godson 3A3000 / 3B3000 Processor User Manual • Volume 1
(10) At this point, the Gate Leveling operation ends, and the sum of Dll_gate_x [6: 0] and Dll_wrdata_x [6: 0]
In fact, it is to read the phase relationship of DQS relative to the PHY internal clock. The following is based on the results of Leveling
Adjust each parameter.
(11) If the sum of Dll_gate_x [6: 0] and Dll_wrdata_x [6: 0] is less than 0x20 or greater than 0x60, then
Dll_rddqs_lt_halt is set to 1. Because the phase relationship of rddqs is actually equal to the read DQS in the input
Delay by 1/4 on the basis.
(12) At this time, if the value of Dll_gate_x is greater than 0x40, the value of Dll_gate_x is subtracted from 0x40; otherwise,