This commit is contained in:
david rice
2026-04-15 16:02:30 +01:00
parent fa96fef9ea
commit 534ae81aba
9 changed files with 1009 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MIPI Analysis — Captures 08010830</title>
<style>
body { font-family: Arial, sans-serif; max-width: 900px; margin: 40px auto; padding: 0 20px; color: #222; }
h1 { color: #1a3a5c; border-bottom: 2px solid #1a3a5c; padding-bottom: 8px; }
.meta { color: #555; font-size: 0.95em; margin-top: -8px; margin-bottom: 24px; }
p { line-height: 1.6; }
ol, ul { line-height: 1.8; padding-left: 24px; }
li { margin: 4px 0; }
.tokens { color: #888; font-size: 0.8em; margin-top: 32px; border-top: 1px solid #ddd; padding-top: 8px; }
.flicker-alert { background: #fff3cd; border: 2px solid #e65100; border-radius: 6px;
padding: 16px 20px; margin-bottom: 28px; }
.flicker-alert h2 { color: #e65100; margin-top: 0; }
.flicker-alert table { border-collapse: collapse; width: 100%; margin-top: 10px; }
.flicker-alert th { background: #e65100; color: white; padding: 6px 10px; text-align: left; }
.flicker-alert td { border: 1px solid #ccc; padding: 5px 10px; }
table { border-collapse: collapse; width: 100%; }
th { background: #1a3a5c; color: white; padding: 6px 10px; text-align: left; }
td { border: 1px solid #ddd; padding: 5px 10px; }
@media print { body { margin: 20px; } }
</style>
</head>
<body>
<h1>MIPI D-PHY Analysis Report</h1>
<div style="background:#fff3cd;border:2px solid #e65100;border-radius:6px;
padding:16px 20px;margin-bottom:28px;">
<h2 style="color:#e65100;margin-top:0">&#9888; FLICKER DETECTED &mdash; 3 of 30 display load sessions (10%) flickered</h2>
<p>Each flagged capture is a genuine flicker event (not an artifact) — the LP pass fires at
pipeline startup, so a missing or sub-50&nbsp;ns LP-low plateau means the SN65DSI83 bridge
missed the SoT sequence and dropped a frame.<br>
LP-low plateau &lt; 50&nbsp;ns means the LP-01/LP-00 SoT states are absent or too brief
for the SN65DSI83 bridge to detect start-of-transmission.</p>
<table>
<tr><th>Capture</th><th>Timestamp</th><th>Channel</th>
<th>LP-low plateau</th><th>LP exit&rarr;HS</th><th>LP-11 voltage</th></tr>
<tr><td>0819</td><td>20260415_120723</td><td>dat</td><td style='color:red'>0.2 ns</td><td>2.3 ns</td><td>1.014 V</td></tr><tr><td>0821</td><td>20260415_120807</td><td>dat</td><td style='color:red'>0.2 ns</td><td>2.8 ns</td><td>1.015 V</td></tr><tr><td>0830</td><td>20260415_121123</td><td>dat</td><td style='color:red'>0.3 ns</td><td>2.5 ns</td><td>1.015 V</td></tr>
</table>
</div>
<details style="margin-bottom:24px;">
<summary style="cursor:pointer;font-weight:bold;color:#1a3a5c;font-size:1.05em;">
DSI Register Snapshots (30 captures)
</summary>
<div style="overflow-x:auto;margin-top:8px;">
<table>
<tr><th>Capture</th><th>Timestamp</th><th>0x32e100b4<br><small>DSIM_PHYTIMING</small></th><th>0x32e100b8<br><small>DSIM_PHYTIMING1</small></th><th>0x32e100bc<br><small>DSIM_PHYTIMING2</small></th></tr>
<tr><td>0801</td><td>20260415_120051</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0802</td><td>20260415_120113</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0803</td><td>20260415_120134</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0804</td><td>20260415_120156</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0805</td><td>20260415_120217</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0806</td><td>20260415_120239</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0807</td><td>20260415_120301</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0808</td><td>20260415_120323</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0809</td><td>20260415_120345</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0810</td><td>20260415_120407</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0811</td><td>20260415_120428</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0812</td><td>20260415_120450</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0813</td><td>20260415_120512</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0814</td><td>20260415_120534</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0815</td><td>20260415_120556</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0816</td><td>20260415_120617</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0817</td><td>20260415_120640</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0818</td><td>20260415_120702</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0819</td><td>20260415_120723</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0820</td><td>20260415_120745</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0821</td><td>20260415_120807</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0822</td><td>20260415_120828</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0823</td><td>20260415_120850</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0824</td><td>20260415_120912</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0825</td><td>20260415_120934</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0826</td><td>20260415_120955</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0827</td><td>20260415_121017</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0828</td><td>20260415_121039</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0829</td><td>20260415_121101</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr><tr><td>0830</td><td>20260415_121123</td><td>0x00000305</td><td>0x020e0a03</td><td>0x00030605</td></tr>
</table>
</div>
</details>
<p class="meta">
<strong>Generated:</strong> 2026-04-15 12:16:31 &nbsp;|&nbsp;
<strong>Scope:</strong> Captures 08010830 &nbsp;|&nbsp;
<strong>Model:</strong> claude-opus-4-6
</p>
<p># MIPI D-PHY Signal Integrity Analysis — Captures 08010830</p>
<p>## 1. Executive Summary</p>
<p><strong>The system is running with non-compliant D-PHY timing registers (5 spec violations) that create a narrow but real window for SoT failure. The 3 confirmed flicker events (0819, 0821, 0830) all share a unique signature: LP-low plateau = 0 ns, meaning the LP-01/LP-00 SoT states were completely skipped. The root cause is the samsung-dsim driver&#x27;s &quot;Round Best&quot; timing calculation mode, which produces sub-spec THS_PREPARE+THS_ZERO and TCLK_PREPARE+TCLK_ZERO values. The SN65DSI83 bridge occasionally fails to detect the truncated SoT and never recovers within that session. Switching to &quot;Round Up&quot; register values eliminates all 5 violations and should eliminate flicker.</strong></p>
<ul><li></li></ul>
<p>## 2. Consistent Spec Concerns</p>
<p>### 2.1 Register Timing — 5 Persistent D-PHY v1.1 Violations (ALL 30 captures)</p>
<p>Every single capture shows identical register values — the PHY timing is static and non-compliant:</p>
<p>| Parameter | Programmed | Actual | Spec Min | Deficit | Severity |<br>|---|---|---|---|---|---|<br>| <strong>THS_EXIT</strong> | 5 bc | 92.6 ns | 100.0 ns | 7.4 ns | Medium — affects HS→LP→HS turnaround |<br>| <strong>TCLK_PREPARE</strong> | 2 bc | 37.0 ns | 38.0 ns | 1.0 ns | <strong>Critical</strong> — clock SoT setup |<br>| <strong>TCLK_TRAIL</strong> | 3 bc | 55.6 ns | 60.0 ns | 4.4 ns | Medium — clock lane EoT |<br>| <strong>TCLK_PREPARE+TCLK_ZERO</strong> | 16 bc | 296.3 ns | 300.0 ns | 3.7 ns | <strong>Critical</strong> — clock HS-init total |<br>| <strong>THS_PREPARE+THS_ZERO</strong> | 9 bc | 166.7 ns | 168.2 ns | 1.5 ns | <strong>Critical</strong> — data lane HS-init total |</p>
<p>The deficits are tiny (17 ns) but they are <strong>systematic and always present</strong>. They don&#x27;t cause failure alone — they reduce the SN65DSI83&#x27;s timing margin to near-zero, making the system vulnerable to any jitter or race condition at the SoT instant.</p>
<p>### 2.2 LP-Exit Duration — Universally Below Spec</p>
<p>| Metric | Good sessions | Flicker sessions |<br>|---|---|---|<br>| LP exit → HS | 14 ns (spec ≥ 50 ns) | 23 ns (spec ≥ 50 ns) |<br>| LP-low plateau | 108343 ns | <strong>0 ns</strong> |</p>
<p><strong>All 30 captures</strong> show LP-exit durations of 14 ns, far below the 50 ns D-PHY minimum. This is a measurement of the actual LP-01→LP-00 intermediate state duration on the wire. The PHY is transitioning through the SoT LP states so rapidly that the oscilloscope (at its capture resolution) cannot distinguish them — they appear as a near-instantaneous drop from LP-11 to HS common mode.</p>
<p>However, the critical differentiator is the <strong>LP-low plateau</strong>:<br>- <strong>Non-flicker captures</strong>: 108343 ns plateau (the LP-00 state is held long enough for the bridge)<br>- <strong>Flicker captures (0819, 0821, 0830)</strong>: <strong>0 ns</strong> plateau (LP-00 never appears on the wire)</p>
<p>### 2.3 HS Amplitude — Marginal but In-Spec</p>
<p>| Lane | Typical Vdiff | Spec Range | Concern |<br>|---|---|---|---|<br>| CLK | 164.2166.3 mV | 140270 mV | Consistently near low end; every capture has samples below 140 mV |<br>| DAT0 | 175.7223.4 mV | 140270 mV | Higher but variable; many sub-140 mV samples |</p>
<p>The CLK lane amplitude is <strong>systematically within 25 mV of the 140 mV floor</strong>. Combined with jitter (150183 ps p-p), individual transitions dip below threshold. This doesn&#x27;t cause flicker on its own but further degrades the bridge&#x27;s ability to lock onto a marginal SoT.</p>
<p>### 2.4 CLK Lane Common Mode Offset</p>
<p>CLK consistently shows +28 to +30 mV common-mode offset (positive). DAT0 shows 5 to 7 mV typically. This ~35 mV differential CM offset is within spec (±25 mV per line, ±50 mV lane-to-lane) but on the high side and could affect the SN65DSI83&#x27;s internal common-mode rejection during the critical SoT detection window.</p>
<p>### 2.5 LP-11 Voltage — Consistent but Low</p>
<p>All captures show LP-11 = 1.0141.016 V against a 1.8 V VDDIO. The spec requires LP-11 to be ≥ VIH(LP) ≈ 880 mV (0.55 × 1.6 V with 200 mV hysteresis), so 1.015 V is in-spec. However, this is 56% of VDDIO, which is below the typical 7080% expected. This suggests:<br>- Significant resistive drop in the LP driver path, or<br>- The LP-11 voltage is reduced by the 1.8 V supply being at 1.764 V (1.015/1.764 = 57.5%)</p>
<p>This is not a direct flicker cause but is worth noting as a contributing factor to the bridge&#x27;s reduced noise margin for LP state detection.</p>
<ul><li></li></ul>
<p>## 3. Trends Over Captures</p>
<p>### 3.1 No Amplitude or Jitter Drift<br>CLK Vdiff is remarkably stable: 164.2166.3 mV across all 30 captures (&lt; 2 mV variation). Jitter ranges 148183 ps p-p with no upward trend. <strong>There is no thermal drift or degradation over the 10-minute capture window.</strong></p>
<p>### 3.2 LP-Low Plateau Shows Three Distinct Populations</p>
<p>| Plateau Duration | Count | Flicker? |<br>|---|---|---|<br>| 342343 ns | 14 captures | No |<br>| 108 ns | 10 captures | No |<br>| <strong>0 ns</strong> | <strong>3 captures (0819, 0821, 0830)</strong> | <strong>YES</strong> |</p>
<p>The 343 ns and 108 ns populations both produce stable displays. The bimodal distribution (343 vs 108) suggests the PHY has two internal timing paths — possibly related to whether the HS clock PLL is already locked from a prior cycle or initializing fresh. The 0 ns population is the pathological case.</p>
<p>### 3.3 Supply Droop — Slight Correlation with Flicker</p>
<p>| Captures | Mean Droop | Mean Ripple RMS |<br>|---|---|---|<br>| Non-flicker (27) | 9.4 mV | 5.60 mV |<br>| Flicker (3: 0819,0821,0830) | 11.8 mV | 5.60 mV |</p>
<p>Capture 0821 (flicker) has the largest single droop in the batch: <strong>17.0 mV</strong> (V_min = 1.748 V). However, non-flicker capture 0822 has nearly identical droop (14.6 mV, V_min = 1.748 V). The correlation is <strong>weak</strong> — supply droop is not the primary cause, though the 0821 droop is the worst-case and may have contributed to that specific event.</p>
<p>### 3.4 HS Burst Duration — Consistent<br>All captures show a single HS burst of ~5,0205,077 ns. This is consistent with a single video line at the observed configuration. No anomalous burst counts or durations.</p>
<ul><li></li></ul>
<p>## 4. Anomaly Analysis</p>
<p>### 4.1 Flicker Events — Complete SoT Omission</p>
<p><strong>Captures 0819, 0821, 0830</strong> all show LP-low plateau = 0 ns. This means:<br>- The LP-11 → LP-01 → LP-00 → HS-0 sequence was <strong>not executed</strong> or was so fast it was indistinguishable from a direct LP-11 → HS transition<br>- The SN65DSI83 requires a minimum LP-00 hold time to recognize the SoT sequence (TI specifies compliance with D-PHY v1.1, implying ≥ THS_PREPARE min = 40ns + 4×UI ≈ 49 ns)<br>- With 0 ns LP-00, the bridge treats the first HS burst as noise and never achieves lane synchronization</p>
<p><strong>Root cause mechanism</strong>: The Samsung DSIM PHY has THS_PREPARE+THS_ZERO programmed 1.5 ns below spec minimum. On most initializations, the analog PHY adds enough internal delay to produce a detectable LP-00 plateau (108343 ns). On ~10% of initializations, PVT (process/voltage/temperature) variation within the PHY causes the LP-00 state machine to skip or truncate the LP-00 hold, producing the 0 ns plateau. This is classic metastability behavior in a timing-marginal digital state machine.</p>
<p>### 4.2 Missing or Partial DAT0 HS in sig Captures</p>
<p>Captures 0805, 0807 show `sig/dat Vdiff = 0.0 mV` (&quot;No HS signal detected&quot;). This is a <strong>scope triggering artifact</strong> — the sig capture window is very short (high-resolution mode) and occasionally misses the HS burst. These captures are NOT flicker events (both show 108343 ns LP-low plateaux and no confirmed flicker).</p>
<p>Similarly, many `sig/dat` captures show &quot;Only negative swings&quot; — this indicates the sig trigger caught a run of identical data bits (e.g., all-zero pixel data). This is expected and benign.</p>
<p>### 4.3 proto/dat Capture 0821 — No HS Signal</p>
<p>Capture 0821 (confirmed flicker) shows `proto/dat Vdiff = 0.0 mV`. This is <strong>consistent with the flicker mechanism</strong>: the bridge failed to lock, so the DSIM controller may have entered a degraded state where DAT0 was not transmitting valid HS data during the proto capture window. The CLK lane continued running (proto/clk is normal), confirming the clock lane is in continuous HS mode regardless of data lane SoT failure.</p>
<p>### 4.4 CLK Lane LP — Expected Behavior</p>
<p>All captures show &quot;CLK LP→HS sequence NOT DETECTED&quot; on the CLK lane. This is <strong>correct and expected</strong>: the DSIM controller runs the clock lane in continuous HS mode (no LP states on CLK after initial startup). The LP captures on CLK confirm the clock never leaves HS during normal operation.</p>
<ul><li></li></ul>
<p>## 5. Supply Correlation Analysis</p>
<p>### 5.1 1.8 V Supply — Within Spec but Sagged</p>
<p>| Metric | Range | Spec | Assessment |<br>|---|---|---|---|<br>| Mean voltage | 1.76251.7657 V | 1.711.89 V | ✓ but 2% below nominal |<br>| Min voltage | 1.74801.7560 V | ≥ 1.71 V | ✓ but only 3846 mV above spec floor |<br>| Droop depth | 7.317.0 mV | — | Max 17 mV at flicker event 0821 |<br>| Ripple RMS | 5.445.84 mV | — | Consistent, no trend |</p>
<p>The supply is healthy but running 36 mV below nominal (1.764 vs 1.800 V). This is within tolerance but means:<br>- LP driver output is reduced (explaining the 1.015 V LP-11 ≈ 57.5% of VDDIO)<br>- PHY internal logic has less VDD margin for state machine transitions</p>
<p>### 5.2 Supply vs. LP-Low Plateau Correlation</p>
<p>| LP-low plateau | V_min range | Droop range |<br>|---|---|---|<br>| 343 ns | 1.7521.756 V | 7.312.1 mV |<br>| 108 ns | 1.7481.756 V | 7.916.5 mV |<br>| 0 ns (flicker) | 1.7481.756 V | 8.817.0 mV |</p>
<p>There is a <strong>slight trend</strong> toward higher droop in the 0 ns / flicker group, but the overlap is too large to conclude causation. The supply is not the trigger — it is, at most, a contributing factor that reduces the noise margin of the already-marginal PHY timing.</p>
<ul><li></li></ul>
<p>## 6. Warning/Error Explanation</p>
<p>| Warning | Captures | Most Likely Cause | Action |<br>|---|---|---|---|<br>| &quot;LP exit duration X ns below spec min 50 ns&quot; | 25/30 | THS_PREPARE+THS_ZERO is 1.5 ns below spec; PHY state machine exits LP states too quickly | <strong>Fix register timing</strong> |<br>| &quot;settled samples below 140 mV&quot; (CLK) | 30/30 | CLK amplitude ~165 mV with ISI/jitter; transitions through 140 mV threshold | Increase PHY drive strength if adjustable; otherwise acceptable |<br>| &quot;settled samples below 140 mV&quot; (DAT) | 28/30 | Data-dependent ISI causes amplitude variation | Same as above |<br>| &quot;Only negative swings&quot; (sig/dat) | ~20/30 | Short capture window caught monotone data pattern | Benign — scope trigger artifact |<br>| &quot;No HS signal detected&quot; (sig/dat) | 2/30 | Scope trigger missed HS burst in narrow window | Benign — increase sig capture window |<br>| &quot;FLICKER SUSPECT: LP-low plateau absent&quot; | 3/30 | PHY skipped LP-00 hold state entirely | <strong>Root cause — fix timing registers</strong> |<br>| &quot;CLK lane in continuous HS mode&quot; | 30/30 | Expected: DSIM runs CLK in continuous HS | No action needed |<br>| &quot;No HS signal detected&quot; (proto/dat 0821) | 1/30 | Bridge failed to lock → DSIM data lane in degraded state | Consequence of flicker, not cause |</p>
<ul><li></li></ul>
<p>## 7. Actionable Recommendations</p>
<p>### 7.1 PRIMARY FIX — Switch to &quot;Round Up&quot; PHY Timing (Critical, Immediate)</p>
<p>Patch the samsung-dsim / sec-dsim driver to use ceiling-rounded timing values. Target register writes:</p>
<p>```<br>DSIM_PHYTIMING (0x32e100b4) = 0x00000306 (was 0x00000305)<br> TLPX=3 (55.6ns ✓), THS_EXIT=6 (111.1ns ✓)</p>
<p>DSIM_PHYTIMING1 (0x32e100b8) = 0x030f0a04 (was 0x020e0a03)<br> TCLK_PREPARE=3 (55.6ns ✓), TCLK_ZERO=15 (PREP+ZERO=333ns ✓),<br> TCLK_POST=10 (185ns ✓), TCLK_TRAIL=4 (74.1ns ✓)</p>
<p>DSIM_PHYTIMING2 (0x32e100bc) = 0x00030706 (was 0x00030605)<br> THS_PREPARE=3 (55.6ns ✓), THS_ZERO=7 (PREP+ZERO=185.2ns ✓),<br> THS_TRAIL=6 (111.1ns ✓)<br>```</p>
<p>This eliminates <strong>all 5 D-PHY violations</strong> with zero cost (adds 12 byte-clock cycles to SoT/EoT sequences, imperceptible to throughput at 432 Mbit/s).</p>
<p><strong>Implementation options (in order of preference):</strong></p>
<ol><li><strong>Kernel driver patch</strong>: Modify the `samsung_dsim_set_phy_timing()` function to use `DIV_ROUND_UP()` instead of integer division for all timing parameters</li></ol>
<p class="tokens">Tokens: 45807 in / 4096 out</p>
</body>
</html>