Customize PCIe (per-controller status / lanes / speed)
Overview
PCIe on Tegra264 (Thor, pcie@C0..C5) and Tegra234 (Orin,
pcie@C0..C10) is split across multiple controllers that share the
UPHY lane pool with USB3 / MGBE / UFS. Each controller's runtime
behavior is determined by two surfaces, both required:
| Surface |
Target |
Authoritative for |
ODMDATA pcie@N_status=… (+ pcie@N_max-link-speed, pcie@N_pcie-mode, pcie@N_clk-scheme, pcie-cN-endpoint-enable) |
/pcie/pcie@N in BPMP DTB |
UPHY lane power, refclk gating, controller-side power rails |
Kernel-DT overlay on &pcieN |
/bus@0/pcie@<addr> in kernel DTB |
Kernel probe, lane width, link speed, RC/EP mode |
Skipping the kernel overlay on a disable lets the kernel probe a
powered-down PHY (link timeouts in dmesg). Skipping the ODMDATA token
on a disable leaves BPMP holding the PHY hot.
Agentic, not table-driven — no controller table, no
questions.json. Every controller, lane width, schematic-routed
receptacle, and authoritative DT node address is discovered at runtime
from the docs + DTB + carrier pinmap.
The output is a kernel-DT overlay commit only. Per-controller
fragment@N blocks are appended to the composite custom overlay
.dts per
../../references/bsp-customization-kernel-dtb.md
and committed to the bsp_sources/ hardware repo.
/jetson-build-source compiles the composite to .dtbo and owns its
Makefile + flash-conf registration.
This skill MUST NOT edit ODMDATA="...". All ODMDATA tokens
(pcie@N_status=…, pcie@N_max-link-speed, pcie@N_pcie-mode,
pcie@N_clk-scheme, pcie-cN-endpoint-enable, plus the
uphyX-config-N surface tokens and UPHY_CONFIG="" clear) are
emitted by /jetson-customize-uphy in a single atomic commit on the
carrier flash-conf fork. The allocation table this skill consumes
from the UPHY sidecar already tells the operator which controllers
are okay / disabled / per-lane sized; this skill only translates
that table into kernel-DT overlay fragments and verifies that the
overlay agrees with the ODMDATA already committed by customize-uphy
(consistency check in Step 8 — disagreement is reported, not silently
fixed).
When to invoke
- The user says "configure PCIe", "enable PCIe controller", "set PCIe
num-lanes", "change PCIe link speed", or asks to flip a
pcie@N_status token.
- A specific PCIe slot or M.2 receptacle doesn't enumerate after
flash, OR the link trains at the wrong width / speed.
jetson-customize-uphy ran and re-allocated lanes across PCIe controllers
(e.g. switched from uphy0-config-7 to uphy0-config-6 enabling
PCIe C3); the per-controller side now needs to be brought up.
jetson-customize-mgbe reports the QSFP path is wired but the kernel
doesn't probe its PCIe-side companion (rare; XFI configurations).
Prerequisites:
- Active profile with
reference_devkit: + custom_carrier: blocks.
<source.root_path>/Linux_for_Tegra/.git exists
(/jetson-init-source).
/jetson-derive-carrier has run — carrier flash-conf fork is in
the overlay tracker.
/jetson-customize-uphy has run — its JSON sidecar at
<workspace>/target-platform/<profile-stem>.jetson-customize-uphy.json
drives the per-controller enable decision.
- Source-of-truth docs registered or supplied at prompt: Adaptation
Guide, Module Design Guide, SoC TRM.
- When
custom_carrier: is present, both
documents.custom_carrier_schematic AND
documents.custom_carrier_pinmux_xls are REQUIRED. Refuse the run
if either is missing — routing on a custom carrier cannot be guessed.
Reference-devkit-only profiles skip this check.
dtc on PATH.
Procedure (summary)
Full step-by-step walkthrough lives in
references/procedure.md. High-level flow:
- Resolve active target + open source-of-truth documents (incl.
<carrier-pinmap>, <ref-dtb>, <uphy-state>). Refuse if
<uphy-state> is missing.
- Diff PCIe topology — devkit vs custom carrier — by decompiling
<ref-dtb> and grepping the schematic for PEX<N>_* net labels.
AskUserQuestion (multiSelect) — which controllers to customize.
- Per-controller verification: pinmap + schematic +
pin_verifier.py
for PE<N>_CLKREQ_L, PE<N>_RST_L, optional PE<N>_WAKE_L.
- Auto-derive per-controller plan (
enable from <uphy-state>,
lanes / speed from Adaptation Guide, mode hard-pinned to
"rc") → mandatory confirm-or-customize gate.
- Append per-controller
fragment@N blocks (marker
/* custom-bsp: pcie:pcie@<addr> */) to the composite custom
overlay .dts in bsp_sources/. Pre-flight dtc + fdtoverlay.
Commit via the workflow's preview gate.
Do not edit ODMDATA — /jetson-customize-uphy already emitted
pcie@N_status=…, pcie@N_max-link-speed, pcie@N_pcie-mode,
pcie@N_clk-scheme, and pcie-cN-endpoint-enable in its single
atomic ODMDATA commit. This skill only translates the per-controller
plan into kernel-DT overlay fragments.
- (Step folded into Step 6 — overlay-only emission.)
- Cross-check ODMDATA vs overlay consistency. On a contradictory
row, stop and ask the user how to recover the two commits.
Never run
git reset --hard autonomously.
- Write run-state JSON sidecar at
<workspace>/target-platform/<profile-stem>.jetson-customize-pcie.json
- summary, then drive the downstream next-step chain via sequential
AskUserQuestion prompts per references/procedure.md Step 9.
Never substitute a printed "Next step: …" line for the prompts.
Limitations
- Mode hard-pinned to RC. Endpoint mode is only emitted when the
operator passes
mode_override="ep" in Step 5c.
enable is derived, not asked. UPHY-allocated controllers are
mandatorily okay; non-allocated are mandatorily disabled.
- No upstream BSP edits. Output lands in
Linux_for_Tegra/ +
bsp_sources/ only.
- Pre-flight overlay merge is a sanity check, not the production
build.
/jetson-build-source is authoritative.
- Flash-conf overlay registration is out of scope. Owned by
/jetson-build-source Step 5.0a.
Troubleshooting
<uphy-state> missing → run /jetson-customize-uphy first.
- Slot doesn't enumerate after flash → check
dmesg | grep pcie;
re-verify ODMDATA pcie@<N>_status=okay and the overlay fragment
agree (Step 8 table in
references/procedure.md).
- Link trains at wrong width → confirm UPHY config in
<uphy-state> allocates the expected lane count; the kernel
fragment's num-lanes must match.
compatible mismatch → fix the composite root, not the
fragment. UEFI plugin-manager silently skips on mismatch.
- Contradictory ODMDATA-vs-overlay row → ask the user; do not
auto-
git reset --hard. See gotchas.
- Common pitfalls — see
references/gotchas.md (RC pinning, node-
address sourcing, stock-disabled controllers, intra-file handoff
with jetson-customize-uphy).
References
1---2name: jetson-customize-pcie3description: >-4 Per-controller PCIe enable / disable / lanes / link-speed for a5 Jetson Thor or Orin custom carrier via ODMDATA + kernel-DT overlay.6 Do NOT use for UPHY lane allocation or endpoint-mode bring-up.7version: 0.0.18license: "Apache-2.0"9metadata:10 source: https://skillmd.com/skills/nvidia/jetson-customize-pcie11 data-classification: public12 author: "Jetson Team"13 tags:14 - bsp15 - phase-216 - io17 - pcie18 domain: meta19---2021# Customize PCIe (per-controller status / lanes / speed)2223## Overview2425PCIe on Tegra264 (Thor, `pcie@C0..C5`) and Tegra234 (Orin,26`pcie@C0..C10`) is split across multiple controllers that share the27UPHY lane pool with USB3 / MGBE / UFS. Each controller's runtime28behavior is determined by **two surfaces, both required**:2930| Surface | Target | Authoritative for |31|---|---|---|32| ODMDATA `pcie@N_status=…` (+ `pcie@N_max-link-speed`, `pcie@N_pcie-mode`, `pcie@N_clk-scheme`, `pcie-cN-endpoint-enable`) | `/pcie/pcie@N` in BPMP DTB | UPHY lane power, refclk gating, controller-side power rails |33| Kernel-DT overlay on `&pcieN` | `/bus@0/pcie@<addr>` in kernel DTB | Kernel probe, lane width, link speed, RC/EP mode |3435Skipping the kernel overlay on a disable lets the kernel probe a36powered-down PHY (link timeouts in dmesg). Skipping the ODMDATA token37on a disable leaves BPMP holding the PHY hot.3839**Agentic, not table-driven** — no controller table, no40`questions.json`. Every controller, lane width, schematic-routed41receptacle, and authoritative DT node address is discovered at runtime42from the docs + DTB + carrier pinmap.4344The output is a **kernel-DT overlay commit only**. Per-controller45`fragment@N` blocks are appended to the composite custom overlay46`.dts` per47[`../../references/bsp-customization-kernel-dtb.md`](../../references/bsp-customization-kernel-dtb.md)48and committed to the `bsp_sources/` hardware repo.49`/jetson-build-source` compiles the composite to `.dtbo` and owns its50Makefile + flash-conf registration.5152**This skill MUST NOT edit `ODMDATA="..."`.** All ODMDATA tokens53(`pcie@N_status=…`, `pcie@N_max-link-speed`, `pcie@N_pcie-mode`,54`pcie@N_clk-scheme`, `pcie-cN-endpoint-enable`, plus the55`uphyX-config-N` surface tokens and `UPHY_CONFIG=""` clear) are56emitted by `/jetson-customize-uphy` in a single atomic commit on the57carrier flash-conf fork. The allocation table this skill consumes58from the UPHY sidecar already tells the operator which controllers59are `okay` / `disabled` / per-lane sized; this skill only translates60that table into kernel-DT overlay fragments and verifies that the61overlay agrees with the ODMDATA already committed by `customize-uphy`62(consistency check in Step 8 — disagreement is reported, not silently63fixed).6465## When to invoke6667- The user says "configure PCIe", "enable PCIe controller", "set PCIe68 num-lanes", "change PCIe link speed", or asks to flip a69 `pcie@N_status` token.70- A specific PCIe slot or M.2 receptacle doesn't enumerate after71 flash, OR the link trains at the wrong width / speed.72- `jetson-customize-uphy` ran and re-allocated lanes across PCIe controllers73 (e.g. switched from `uphy0-config-7` to `uphy0-config-6` enabling74 PCIe C3); the per-controller side now needs to be brought up.75- `jetson-customize-mgbe` reports the QSFP path is wired but the kernel76 doesn't probe its PCIe-side companion (rare; XFI configurations).7778**Prerequisites:**7980- Active profile with `reference_devkit:` + `custom_carrier:` blocks.81- `<source.root_path>/Linux_for_Tegra/.git` exists82 (`/jetson-init-source`).83- `/jetson-derive-carrier` has run — carrier flash-conf fork is in84 the overlay tracker.85- `/jetson-customize-uphy` has run — its JSON sidecar at86 `<workspace>/target-platform/<profile-stem>.jetson-customize-uphy.json`87 drives the per-controller `enable` decision.88- Source-of-truth docs registered or supplied at prompt: Adaptation89 Guide, Module Design Guide, SoC TRM.90- **When `custom_carrier:` is present, both91 `documents.custom_carrier_schematic` AND92 `documents.custom_carrier_pinmux_xls` are REQUIRED.** Refuse the run93 if either is missing — routing on a custom carrier cannot be guessed.94 Reference-devkit-only profiles skip this check.95- `dtc` on PATH.9697## Procedure (summary)9899Full step-by-step walkthrough lives in100[`references/procedure.md`](references/procedure.md). High-level flow:1011021. Resolve active target + open source-of-truth documents (incl.103 `<carrier-pinmap>`, `<ref-dtb>`, `<uphy-state>`). Refuse if104 `<uphy-state>` is missing.1052. Diff PCIe topology — devkit vs custom carrier — by decompiling106 `<ref-dtb>` and grepping the schematic for `PEX<N>_*` net labels.1073. `AskUserQuestion` (multiSelect) — which controllers to customize.1084. Per-controller verification: pinmap + schematic + `pin_verifier.py`109 for `PE<N>_CLKREQ_L`, `PE<N>_RST_L`, optional `PE<N>_WAKE_L`.1105. Auto-derive per-controller plan (`enable` from `<uphy-state>`,111 `lanes` / `speed` from Adaptation Guide, `mode` hard-pinned to112 `"rc"`) → mandatory confirm-or-customize gate.1136. Append per-controller `fragment@N` blocks (marker114 `/* custom-bsp: pcie:pcie@<addr> */`) to the composite custom115 overlay `.dts` in `bsp_sources/`. Pre-flight `dtc` + `fdtoverlay`.116 Commit via the workflow's preview gate.117 **Do not edit `ODMDATA`** — `/jetson-customize-uphy` already emitted118 `pcie@N_status=…`, `pcie@N_max-link-speed`, `pcie@N_pcie-mode`,119 `pcie@N_clk-scheme`, and `pcie-cN-endpoint-enable` in its single120 atomic ODMDATA commit. This skill only translates the per-controller121 plan into kernel-DT overlay fragments.1227. (Step folded into Step 6 — overlay-only emission.)1238. Cross-check ODMDATA vs overlay consistency. On a contradictory124 row, **stop and ask the user how to recover the two commits.125 Never run `git reset --hard` autonomously.**1269. Write run-state JSON sidecar at127 `<workspace>/target-platform/<profile-stem>.jetson-customize-pcie.json`128 + summary, then drive the downstream next-step chain via sequential129 `AskUserQuestion` prompts per `references/procedure.md` Step 9.130 Never substitute a printed "Next step: …" line for the prompts.131132## Limitations133134- **Mode hard-pinned to RC.** Endpoint mode is only emitted when the135 operator passes `mode_override="ep"` in Step 5c.136- **`enable` is derived, not asked.** UPHY-allocated controllers are137 mandatorily `okay`; non-allocated are mandatorily `disabled`.138- **No upstream BSP edits.** Output lands in `Linux_for_Tegra/` +139 `bsp_sources/` only.140- **Pre-flight overlay merge is a sanity check**, not the production141 build. `/jetson-build-source` is authoritative.142- **Flash-conf overlay registration is out of scope.** Owned by143 `/jetson-build-source` Step 5.0a.144145## Troubleshooting146147- **`<uphy-state>` missing** → run `/jetson-customize-uphy` first.148- **Slot doesn't enumerate after flash** → check `dmesg | grep pcie`;149 re-verify ODMDATA `pcie@<N>_status=okay` and the overlay fragment150 agree (Step 8 table in151 [`references/procedure.md`](references/procedure.md)).152- **Link trains at wrong width** → confirm UPHY config in153 `<uphy-state>` allocates the expected lane count; the kernel154 fragment's `num-lanes` must match.155- **`compatible` mismatch** → fix the composite root, not the156 fragment. UEFI plugin-manager silently skips on mismatch.157- **Contradictory ODMDATA-vs-overlay row** → ask the user; do not158 auto-`git reset --hard`. See gotchas.159- **Common pitfalls** — see160 [`references/gotchas.md`](references/gotchas.md) (RC pinning, node-161 address sourcing, stock-disabled controllers, intra-file handoff162 with `jetson-customize-uphy`).163164## References165166- [`references/procedure.md`](references/procedure.md) — full nine-167 step procedure (topology diff, plan derivation, overlay append,168 ODMDATA cross-check, sidecar).169- [`references/gotchas.md`](references/gotchas.md) — failure modes170 + invariants (RC pinning, address sourcing, BPMP handoff).171- [`../../scripts/pin_verifier.py`](../../scripts/pin_verifier.py)172 — shared HSIO pin verifier (Step 4).173- [`../../references/platform_template.yaml`](../../references/platform_template.yaml)174 — `documents:` block consumed by Step 1.175- [`../../context/bsp-customization-workflow.md`](../../context/bsp-customization-workflow.md#workflow-invariants)176 — overlay edit protocol + commit message preview gate.177- [`../../references/bsp-customization-kernel-dtb.md`](../../references/bsp-customization-kernel-dtb.md)178 — composite overlay filename / skeleton / append protocol.179- [`../jetson-customize-uphy/SKILL.md`](../jetson-customize-uphy/SKILL.md)180 — sibling skill that owns UPHY lane allocation; its sidecar drives181 the per-controller `enable` decision.182- [`../jetson-customize-pinmux/SKILL.md`](../jetson-customize-pinmux/SKILL.md)183 — sibling skill invoked by Step 4 (with operator confirmation) to184 fix HSIO pin SFIO mismatches.185- [`../jetson-customize-mgbe/SKILL.md`](../jetson-customize-mgbe/SKILL.md)186 — sibling for MGBE controllers; shares the two-surface (ODMDATA187 + overlay) pattern.188- [`../jetson-derive-carrier/SKILL.md`](../jetson-derive-carrier/SKILL.md)189 — must run first; produces the carrier flash-conf fork edited in190 Step 6.191- [`../jetson-init-source/SKILL.md`](../jetson-init-source/SKILL.md)192 — produces the overlay tracker + bsp_sources repo this skill193 commits into.