|
| 1 | +.. _how-to-enable-ssc-for-dss: |
| 2 | + |
| 3 | +############################################################ |
| 4 | +How to enable spread spectrum clocking for display subsystem |
| 5 | +############################################################ |
| 6 | + |
| 7 | +************ |
| 8 | +Introduction |
| 9 | +************ |
| 10 | + |
| 11 | +Spread Spectrum Clocking (SSC) is an electromagnetic interference (EMI) reduction technique that: |
| 12 | + |
| 13 | +- Modulates the clock frequency rather than keeping it constant |
| 14 | +- Varies the frequency over time in a controlled way |
| 15 | +- Spreads energy across many frequencies instead of focusing it at one frequency |
| 16 | +- Reduces peak emissions by spreading the electromagnetic energy |
| 17 | + |
| 18 | +This technique is common in electronic systems, especially in high-speed digital circuits. It helps meet EMI compliance without needing extra shielding or filters. |
| 19 | + |
| 20 | +Digital clock signals have a square wave shape. Most energy focuses at the center frequency and odd harmonics. In the frequency domain, SSC reduces the peak amplitude of the digital clock signal by spreading the energy across a wider frequency range. In the time domain, SSC adds jitter to the clock signal, but the voltage amplitude remains unchanged. |
| 21 | + |
| 22 | +The Display Subsystem (DSS) supports Spread Spectrum Clocking (SSC) for its pixel clock sources. These pixel clocks feed the DSS video ports. |
| 23 | + |
| 24 | +This guide shows how to configure SSC for DSS pixel clocks on supported TI SoCs. |
| 25 | + |
| 26 | +.. important:: |
| 27 | + |
| 28 | + When you enable SSC, the instantaneous peak pixel clock frequency can exceed the nominal frequency. Ensure this peak does not exceed the maximum frequency supported by your display components. This includes external encoders and panels. When using center spread mode, calculate the highest peak frequency: |
| 29 | + |
| 30 | + - For center spread: Highest frequency = Nominal frequency × (1 + (Modulation depth × 1.2) / 100) |
| 31 | + - For down spread: Highest frequency = Nominal frequency (no overshoot) |
| 32 | + |
| 33 | + Example: With 100 MHz nominal frequency and 0.5% modulation depth in center spread mode: |
| 34 | + |
| 35 | + - Highest frequency = 100 MHz × (1 + (0.5 × 1.2) / 100) = 100.6 MHz |
| 36 | + |
| 37 | + The 1.2 factor accounts for the 20% overshoot on the modulation depth in center spread mode. |
| 38 | + |
| 39 | +************************************************* |
| 40 | +Spread spectrum clocking configuration parameters |
| 41 | +************************************************* |
| 42 | + |
| 43 | +The ``assigned-clock-sscs`` device tree property configures SSC and takes three parameters: |
| 44 | + |
| 45 | +.. list-table:: |
| 46 | + :header-rows: 1 |
| 47 | + :widths: 30 70 |
| 48 | + |
| 49 | + * - Parameter |
| 50 | + - Description |
| 51 | + * - Modulation Frequency (Hz) |
| 52 | + - The frequency at which the spread spectrum modulation occurs: |
| 53 | + |
| 54 | + - Minimum: 32,000 Hz (32 kHz) |
| 55 | + - Maximum: Reference clock frequency / 200 |
| 56 | + - Typical values: 32 kHz to 120 kHz |
| 57 | + * - Modulation Depth |
| 58 | + - The amount of frequency spread as a percentage: |
| 59 | + |
| 60 | + - Minimum: 10 (0.1%) |
| 61 | + - Maximum: 310 (3.1%) |
| 62 | + - Adjustable in increments of 10 (0.1%) |
| 63 | + - Example: 50 = 0.5% spread |
| 64 | + - Units: 1/10,000 (for example, 50 represents 0.5%) |
| 65 | + * - Spread Type |
| 66 | + - Spread mode options: |
| 67 | + |
| 68 | + - 1: Center spread (frequency varies on both higher and lower frequencies than nominal) |
| 69 | + - 3: Down spread (frequency varies only lower than nominal) |
| 70 | + |
| 71 | +The modulation uses a triangular waveform. The Device Manager automatically configures the hardware based on the parameters specified in the device tree. |
| 72 | + |
| 73 | +******** |
| 74 | +Examples |
| 75 | +******** |
| 76 | + |
| 77 | +Example 1: Basic SSC configuration (center spread) |
| 78 | +================================================== |
| 79 | + |
| 80 | +This example shows how to enable SSC for the DSS VP2 clock with the following parameters: |
| 81 | + |
| 82 | +- Modulation frequency: 100 kHz |
| 83 | +- Modulation depth: 10 (0.1%) |
| 84 | +- Spread type: Center spread (1) |
| 85 | + |
| 86 | +Add the following properties to the DSS node in your device tree file (for example, :file:`k3-am62p-j722s-common-main.dtsi`): |
| 87 | + |
| 88 | +.. code-block:: dts |
| 89 | +
|
| 90 | + &dss0 { |
| 91 | + assigned-clocks = <&k3_clks 186 2>; |
| 92 | + assigned-clock-sscs = <100000 10 1>; |
| 93 | + }; |
| 94 | +
|
| 95 | +.. warning:: |
| 96 | + |
| 97 | + This example uses center spread mode (1). Remember to apply the 1.2 factor for the 20% overshoot when calculating peak frequency. Use down spread mode (Example 2) if you need to avoid exceeding the nominal frequency. |
| 98 | + |
| 99 | +Example 2: SSC with down spread mode |
| 100 | +==================================== |
| 101 | + |
| 102 | +This example demonstrates down spread mode, which we recommend for display interfaces: |
| 103 | + |
| 104 | +- Modulation frequency: 33 kHz |
| 105 | +- Modulation depth: 50 (0.5%) |
| 106 | +- Spread type: Down spread (3) |
| 107 | + |
| 108 | +.. code-block:: dts |
| 109 | +
|
| 110 | + &dss0 { |
| 111 | + assigned-clocks = <&k3_clks 186 2>; |
| 112 | + assigned-clock-sscs = <33000 50 3>; |
| 113 | + }; |
| 114 | +
|
| 115 | +Example 3: Greater modulation depth |
| 116 | +=================================== |
| 117 | + |
| 118 | +Here is a configuration with greater modulation depth for better EMI reduction: |
| 119 | + |
| 120 | +- Modulation frequency: 50 kHz |
| 121 | +- Modulation depth: 250 (2.5%) |
| 122 | +- Spread type: Down spread (3) |
| 123 | + |
| 124 | +.. code-block:: dts |
| 125 | +
|
| 126 | + &dss0 { |
| 127 | + assigned-clocks = <&k3_clks 186 2>; |
| 128 | + assigned-clock-sscs = <50000 250 3>; |
| 129 | + }; |
| 130 | +
|
| 131 | +Example 4: Many pixel clocks |
| 132 | +============================ |
| 133 | + |
| 134 | +Some SoCs, such as AM62Px, have many DSS instances. This example shows how to configure SSC for many pixel clocks together. |
| 135 | + |
| 136 | +For DSS0: |
| 137 | + |
| 138 | +- Modulation frequency: 50 kHz |
| 139 | +- Modulation depth: 50 (0.5%) |
| 140 | +- Spread type: Down spread (3) |
| 141 | + |
| 142 | +For DSS1: |
| 143 | + |
| 144 | +- Modulation frequency: 33 kHz |
| 145 | +- Modulation depth: 50 (0.5%) |
| 146 | +- Spread type: Down spread (3) |
| 147 | + |
| 148 | +.. code-block:: dts |
| 149 | +
|
| 150 | + &dss0 { |
| 151 | + assigned-clocks = <&k3_clks 186 2>; |
| 152 | + assigned-clock-sscs = <50000 50 3>; |
| 153 | + }; |
| 154 | +
|
| 155 | + &dss1 { |
| 156 | + assigned-clocks = <&k3_clks 232 4>; |
| 157 | + assigned-clock-sscs = <33000 50 3>; |
| 158 | + }; |
| 159 | +
|
| 160 | +*************** |
| 161 | +Troubleshooting |
| 162 | +*************** |
| 163 | + |
| 164 | +Display artifacts |
| 165 | +================= |
| 166 | + |
| 167 | +If you observe display artifacts, flickering, or other visual anomalies after enabling SSC: |
| 168 | + |
| 169 | +1. Reduce the modulation depth to a smaller value (for example, try 0.1% or 10 in device tree) |
| 170 | +2. Try a different modulation frequency (typical range: 32-100 kHz) |
| 171 | +3. Switch from center spread to down spread mode if not already using it |
| 172 | +4. Consult your display panel data sheet for spread spectrum tolerance specifications |
| 173 | + |
| 174 | +Clock not found error |
| 175 | +===================== |
| 176 | + |
| 177 | +If you experience errors during boot about clock assignment: |
| 178 | + |
| 179 | +1. Verify the clock ID is correct for your SoC (check the technical reference manual) |
| 180 | +2. Ensure the Device Manager supports SSC for the specified clock |
| 181 | +3. Check that the kernel version includes SSC support for the clock subsystem |
| 182 | + |
| 183 | +**************************** |
| 184 | +Requirements and limitations |
| 185 | +**************************** |
| 186 | + |
| 187 | +Hardware support |
| 188 | +================ |
| 189 | + |
| 190 | +- SSC is currently supported for display pixel clocks on these SoCs: AM62x, AM62Ax, AM62Dx, AM62Px |
| 191 | + |
| 192 | +Configuration |
| 193 | +============= |
| 194 | + |
| 195 | +- Use ``assigned-clocks`` and ``assigned-clock-sscs`` together to specify which clock receives the SSC settings |
| 196 | +- SSC causes the instantaneous clock frequency to deviate from the nominal rate |
| 197 | +- Some panels have strict jitter requirements |
| 198 | + |
| 199 | +Firmware capability |
| 200 | +=================== |
| 201 | + |
| 202 | +Check if your firmware supports SSC by using the capability flag: |
| 203 | + |
| 204 | +.. code-block:: console |
| 205 | +
|
| 206 | + # Check firmware capabilities (requires ti-sci driver) |
| 207 | + cat /sys/kernel/debug/ti-sci/fw_caps |
| 208 | +
|
| 209 | +Look for ``TISCI_MSG_FLAG_FW_CAP_CLOCK_SSC`` in the capabilities list. |
| 210 | + |
| 211 | +********************************** |
| 212 | +Best practices and recommendations |
| 213 | +********************************** |
| 214 | + |
| 215 | +- Start with low modulation depth (0.1% to 0.5%) and increase only if needed |
| 216 | +- Use down spread mode (3) for display interfaces. This ensures the clock never exceeds the maximum frequency |
| 217 | +- Apply the 1.2 factor when using center spread mode |
| 218 | +- Validate configuration with your display panel. Ensure timing margins meet requirements |
| 219 | + |
| 220 | +************************* |
| 221 | +Customer responsibilities |
| 222 | +************************* |
| 223 | + |
| 224 | +.. warning:: |
| 225 | + |
| 226 | + **You assume all responsibility for the configuration and usage of spread spectrum clocking.** You must: |
| 227 | + |
| 228 | + 1. Research the clock limitations associated with your selected display panel |
| 229 | + 2. Configure SSC to be compatible with that specific display panel |
| 230 | + 3. Verify that the SSC configuration does not cause any system-related issues for any operating condition |
| 231 | + 4. Work with the display panel vendor to resolve any issues caused by enabling SSC |
| 232 | + 5. Validate displays to have enough functional margin with the jitter introduced by spread spectrum modulation |
| 233 | + |
| 234 | + Some display panels have clocking limitations not mentioned in their data sheets. Work directly with the display panel manufacturer to resolve any issues from SSC. |
| 235 | + |
| 236 | +********** |
| 237 | +References |
| 238 | +********** |
| 239 | + |
| 240 | +- :ref:`dss7` |
| 241 | +- `Application Note: AM62x, AM62Ax, AM62Px, AM62Lx Spread-Spectrum Clocking <https://www.ti.com/lit/pdf/spradk1>`__ |
| 242 | +- SoC Technical Reference Manual (TRM) |
| 243 | +- System Firmware Documentation - PM Clock API |
| 244 | +- Linux kernel device tree bindings: ``Documentation/devicetree/bindings/display/ti/`` |
| 245 | +- Linux kernel clock framework documentation: ``Documentation/driver-api/clk.rst`` |
0 commit comments