DRM driver code analysis: spread frequency hopping

What is spread spectrum? Why can electromagnetic interference be solved?

At present, in the process of high-speed data transmission, the clock at the sending end uses a high-frequency fixed clock, which will cause the energy of the transmitted electrical signal to be excessively concentrated at a specific frequency point, resulting in serious EMI (electromagnetic interference) problems. Therefore, a clock spread spectrum circuit is required to expand the clock frequency to expand the transmitted electrical signal energy from a specific frequency point to a larger frequency range to avoid excessive concentration of energy.
Source: A clock spreading circuit and clock spreading method

MIPI interference can be divided into two types: MIPI clock signal or MIPI data signal multiplier interference.
Spreading Spectrum Clock (Spreading Spectrum Clock) refers to the modulation of a clock signal of a certain frequency, so that the area covered by each time-harmonic energy unit is expanded to a wider bandwidth.
Note: The text is not easy to understand, but the pictures in the original introduction to RF De-sense are easier to understand.

What does it mean to extend a clock signal?

Spread spectrum, generally understood, is to expand the narrowband spectrum into a broadband spectrum, so that the energy is not concentrated to a certain frequency point, and the energy is dispersed to multiple frequency points.
We know that the clock signal is usually a periodic signal, its spectrum is narrow-band, and the energy is concentrated. If you want to widen its frequency spectrum, you must modify the clock signal. How to modify it?
Each cycle of the original clock signal is the same, and the length of the cycle is also the same, which is Tclk. We can fine-tune it, such as first lengthening each clock cycle a little bit longer than the previous clock cycle, after accumulating n cycles, then shortening each clock cycle a little bit compared to the previous clock cycle, and then accumulating n Cycle, so cycle.
If the time is fixed, the number of total clock cycles is constant, but each cycle of the clock signal inside is different
————————————————
Copyright statement : This article is the original article of CSDN blogger "The Road to Hardware Engineers"
Original link: https://blog.csdn.net/weixin_42005993/article/details/113954587

What are the parameters of spread spectrum?

There are two parameters that can be set in the software, one is the expansion rate (Percentage), and the other is the modulation frequency (Modulation Frequency). The expansion rate is generally set at 0%-3%, and the modulation frequency is generally set at 0~40Khz.
The physical meaning of Percentage and Modulation Frequency of spread spectrum (SSC):
For example, the clock frequency of LVDS is 148Mhz, the Percentage of SSC is set to 2%, and the Modulation Frequency is set to 30Khz.
Percentage is 2%, then the frequency fluctuation range of LVDS is (148-1.48) Mhz to (148+1.48) Mhz, that is (146.52Mhz~149.48Mhz). A Modulation Frequency of 30Khz means that the clock frequency of LVDS changes from 146.52Mhz to 149.48Mhz and then changes to 146.52Mhz, which takes 1/30Khz time.
————————————————
Copyright statement: This article is the original article of CSDN blogger "Wen Zhongzhi"
Original link: https://blog.csdn.net/wenzongzhi/article/details/128701641

One is the modulation speed: it is the time to complete a cycle, which is 2n*Tclk, and the reciprocal of this time is the modulation frequency corresponding to the modulation speed.
One is the modulation depth: After modulation, there will be the longest clock cycle and the shortest clock cycle. There is a difference between them and the original cycle length. This difference is divided by the original clock cycle, which is the modulation depth, which is a percentage.
There is also a modulation method: what I said before is that the length of the clock cycle increases or decreases linearly. This method is called a linear modulation method
————————————————
Copyright statement: This article is a CSDN blog The original article of the main "The Road to Hardware Engineers"
Original link: https://blog.csdn.net/weixin_42005993/article/details/113954587

Summary: The clock signal frequency of mipi is fixed at high frequency, which will cause electromagnetic interference. Spread spectrum is to change the clock frequency to make it change within the preset range (how to change it? All linear?), so that the frequency is no longer fixed. Generally plus or minus 3%.
Is it okay to change the mipi clock signal?
Answer: If it is in cmd mode, the TE signal is the synchronization signal, and the mipi becomes faster and slower, which causes the idle time to increase and decrease after mipi sends a frame. If it is video mode, it should be fine if the frame rate is a few tenths or one tenth of a frame (fps*1.03).

What is frequency hopping? Why can electromagnetic interference be solved?

MIPI frequency hopping technology came into being. The principle is: select two sets of MIPI values ​​A and B. For example, MIPI A is the main MIPI, which is the frequency when the device is in standby or working normally. When the frequency is within the frequency range, the frequency hopping mechanism is triggered, and the MIPI frequency jumps to the MIPI B frequency (when the group B frequency is selected, its multiplier point avoids the multiplier interference point of the A group frequency) to avoid RF frequency interference .

How is the frequency selected?

Qualcomm ssc function related code

来源:OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8475

- qcom,dsi-pll-ssc-en: Boolean property to indicate that ssc is enabled.
- qcom,dsi-pll-ssc-mode: Spread-spectrum clocking. It can be either "down-spread" or "center-spread". Default is "down-spread" if it is not specified.
- qcom,ssc-frequency-hz: Integer property to specify the spread frequency
	to be programmed for the SSC.
- qcom,ssc-ppm: Integer property to specify the Parts per Million value of SSC.

static int dsi_pll_5nm_vco_set_rate(struct dsi_pll_resource *pll_res)
{
    
    
	struct dsi_pll_5nm *pll;
	pll = pll_res->priv;
...
	dsi_pll_calc_ssc(pll, pll_res);
...
	dsi_pll_ssc_commit(pll, pll_res);
	/* flush, ensure all register writes are done*/
	wmb();
	return 0;
}

static void dsi_pll_ssc_commit(struct dsi_pll_5nm *pll,
		struct dsi_pll_resource *rsc)
{
    
    
	void __iomem *pll_base = rsc->pll_base;
	struct dsi_pll_regs *regs = &pll->reg_setup;

	if (pll->pll_configuration.enable_ssc) {
    
    
		DSI_PLL_REG_W(pll_base, PLL_SSC_STEPSIZE_LOW_1,
				regs->ssc_stepsize_low);
		DSI_PLL_REG_W(pll_base, PLL_SSC_STEPSIZE_HIGH_1,
				regs->ssc_stepsize_high);
		DSI_PLL_REG_W(pll_base, PLL_SSC_DIV_PER_LOW_1,
				regs->ssc_div_per_low);
		DSI_PLL_REG_W(pll_base, PLL_SSC_DIV_PER_HIGH_1,
				regs->ssc_div_per_high);
		DSI_PLL_REG_W(pll_base, PLL_SSC_ADJPER_LOW_1,
				regs->ssc_adjper_low);
		DSI_PLL_REG_W(pll_base, PLL_SSC_ADJPER_HIGH_1,
				regs->ssc_adjper_high);
		DSI_PLL_REG_W(pll_base, PLL_SSC_CONTROL,
				SSC_EN | regs->ssc_control);
	}
}

References

[1] A clock spread spectrum circuit and clock spread spectrum method
[2] Introduction to RF De-sense
[3] Frame rate adjustment method and electronic equipment
[4] OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8475
[5] How does spread spectrum technology handle clock signals Radiation
[6] spread spectrum (SSC) related knowledge

expand:

The mipi driving capability of LCD is essentially the driving voltage, and it is generally not recommended to modify it. The default value of LP mipi is 1.2V and does not need to be changed. To try to solve problems such as interference by enhancing the driving ability of HS
Source: Spreadtrum mipi screen high-frequency interference wifi signal

Guess you like

Origin blog.csdn.net/yuuu_cheer/article/details/129248713