SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
The following is all the registers that need to be set before using the video in SDI or DPI interface operation.
This section addresses the dependencies between all video registers, and details how the TVG and VCA registers must be set per VSG registers.
vid_main_ctl
When sync_pulse_active is set to one, the HSYNC pulses are emulated only during the active part of the frame. When both sync_pulse_horizontal and sync_pulse_active are set, the HSYNC pulses are present on all lines of the frame.
vid_vsize - the variables are expressed in line numbers in this register.
vid_hsize1 - the numbers are expressed in number of bytes (the fields are specifying the payload of the corresponding packet).
vid_hsize2 - again the fields are specifying the payload of the corresponding packet (in byte).
vid_blksize1 - still specifying size of the payload in byte.
-- 32767 = 0x7FFF = max value on 15 bits and -100 to take
margin blkeol_pck < 32767 - hfp_length - hbp_length - hsa_length - rgb_size - 100;
The blkeol_pck (and blkeol_duration) must be adapted to the reg_wakeup_time in case VCA is authorized to go back in LP.
vid_blksize2 - still specifying size of the payload in byte.
vid_pck_time - specifies duration in clock cycles.
Note 1: The function div_round_up is a function that performs a division then round the result to the first entire number superior or equal to the division result.
vid_dphy_time: specifies duration in clock cycles. These are values that have external dependencies and thus need to be calculated first (and rest of VSG programming is calculated from these values).
reg_line_duration: depends on display type and size and of its programming (in some display, the blanking sizes can be adapted to provide a given number of frame per second with one of the D-PHY possible clock frequency (as PLL can only generate a given number of discrete frequencies).
if (pulse mode) {
line_length = (blkline_pulse_pck + 6);
}
else (event mode) {
line_length = (blkline_event_pck + 6);
if (burst_mode and burst_lp and lane_nb == 2 and
hsa_length[0:0] == 1 and hfp_length[0:0] == 1)
line_length = line_length - 1;
}
result = div_round_up(line_length, lane_nb);
Note 1: The function div_round_up is a function that performs a division then round the result to the first entire number superior or equal to the division result.
Additional Notes about the line duration:
For LP enabled operation, the controller cannot allow underflow of the line and frame timing. With the previous example, the LP line length in clock cycles will be 246 since we cannot start the HS transmission in the middle of a clock cycle. And there is no mechanism to have one line in 245 and the next one in 246 cycles. For LP see section 0.
reg_wakeup_time must be shorter than line duration and depends on the D-PHY cell plus some pipelines delays inserted by the DSI link. This value strongly depends on the DPHY PLL programming and configuration, and is a mix of both internal and external analog and digital timing factors, therefore it is very difficult to provide an exact formula. The recommended approach to selecting a suitable value for this parameter is to characterize behaviour in at the system level environment using simulation, emulation (e.g. Palladium) or validation (e.g. FPGA).
The DPHY needs 100 ns + time for THXS-EXIT to go to Low Power mode.
The timing for the clock lane TXRequestHS going active to the TXReadyHS will be determined by the DPHY DDR bit rate clock frequency. The timing will be the total number of DDR bit clk cycles for the TXRequestHS to be detected and the clock lane to transition to High Speed, so TLPX + TCLK-PREPARE + TCLK_ZERO. Additional time is required between the clock lane driving HS clocks and the Data Lanes being activate, TCLK-PRE. All of these parameters can be calculated from the DPHY datasheet.
Figure 12-400 shows timing diagram for clock lane activation/deactivation.
The data lane request follows a similar timing sequence from the TX_Request_HS to TX_Ready_HS, TLPX + THS-PREPARE + THS_ZERO. The data lane requests will be activated once the clock lane is ready, i.e TX_Ready_HSCLK is high.
Figure 12-401 shows timing diagram for data lane activation/deactivation.
Parameter | Description | Min | Max | Example 650 Mbps (UI = 1.538 ns) |
---|---|---|---|---|
TLPX | Transmitted length of any Low- Power state period. | 50 ns | 50 ns | |
TCLK-PREPARE | Time that the transmitter drives the Clock Lane LP-00 Line state immediately before the HS-0 Line state starting the HS transmission. | 38 ns | 95 ns | 38-95 ns |
TCLK-PREPARE + TCLK-ZERO | TCLK-PREPARE + time that the transmitter drives the HS-0 state prior to starting the Clock. | 300 ns | 300 ns | |
Wakeup Time CL | 388-445 ns | |||
TCLK-PRE | Time that the HS clock shall be driven by the transmitter prior to any associated Data Lane beginning the transition from LP to HS mode. | 8 UI | 12.3 ns | |
THS-PREPARE | Time that the transmitter drives the Data Lane LP-00 Line state immediately before the HS-0 Line state starting the HS transmission. | 40 ns + 4 × UI | 85 ns + 6 × UI | ~ 46-95 ns |
THS-PREPARE + THS-ZERO | THS-PREPARE + time that the transmitter drives the HS-0 state prior to transmitting the Sync sequence. | 145 ns + 10 × UI | 160 ns | |
Wakeup Time DL | ~ 270 ns |
So the wakeup time values expressed as tx_byte_clk (12.3ns) cycles, CL = 36 and CLKPRE + DL = 22.
Figure 12-402 shows wakeup time timing diagram.
Here is the example of the calculation done for the system running at 650 MHz.
if (clk_continuous == TRUE) {
wakeup_time_cl = 0x1;
} else {
wakeup_time_cl = 0x24;
};
wakeup_time_dsi = 0xA; -- from request on VSG to request HS on DL1 (+ 1 for VSG internal cycle)
wakeup_time_dl = 0x14; -- from stop state falling edge to tx_ready rising edge
reg_wakeup_time = wakeup_time_dsi + wakeup_time_cl + wakeup_time_dl + (hs_host_eot × 4 / lane_nb)
Note: It is not necessary to program all the register values every time because some of them are used only in some modes. For instance, blkline_event_pck and blkline_pulse_pck are used depending on the way SYNC is generated, and then in pulse mode, there is no need to program blkline_event_pck and vice-versa.