jetson-customize-usb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCustomize USB (per-port enable / disable / role)
定制USB(按端口启用/禁用/设置角色)
Purpose
用途
Enable, disable, or change the role of USB2 / USB3 SS ports on a
Jetson Thor (Tegra264) or Orin (Tegra234) custom carrier. Captures
per-port wiring (role, max speed, VBUS-EN / OC GPIOs, CC1/CC2 GPIOs
for Type-C, USB3 SS UPHY lane), resolves the SS to USB2 companion
graph from the in-tree DTB, then renders a self-contained kernel-DT
overlay that flips every port action in three places in lockstep
(lane status, port status, host xHCI + ).
physphy-namesUPHY lane allocation belongs to . No ODMDATA
edit. Output is one commit to the composite custom overlay in
the hardware repo.
jetson-customize-uphy.dtsbsp_sources/在Jetson Thor(Tegra264)或Orin(Tegra234)定制载板上启用、禁用或更改USB2/USB3 SS端口的角色。捕获按端口的布线信息(角色、最大速率、VBUS-EN/OC GPIO、Type-C的CC1/CC2 GPIO、USB3 SS UPHY lane),解析内核自带DTB中的SS与USB2配套链路图,然后生成一个独立的kernel-DT overlay,同步在三个位置切换每个端口的状态(lane状态、端口状态、主机xHCI的+)。
physphy-namesUPHY lane分配属于的功能范围。请勿编辑ODMDATA。输出内容会作为一次提交,添加到硬件仓库中的复合定制overlay 文件中。
jetson-customize-uphybsp_sources/.dtsPrerequisites
前提条件
- Active profile with +
reference_devkit:blocks.custom_carrier: - exists (
<source.root_path>/Linux_for_Tegra/.git)./jetson-init-source - has run — carrier flash-conf fork in the overlay tracker.
/jetson-derive-carrier - has run when any enabled USB3 SS port needs a non-stock UPHY lane allocation. Its JSON sidecar at
/jetson-customize-uphyis consulted for SS lane allocation.<workspace>/target-platform/<profile-stem>.jetson-customize-uphy.json - Source-of-truth docs: Adaptation Guide §"Port the Universal Serial Bus", Module Design Guide §USB, SoC TRM (xusb block).
- When is present, both
custom_carrier:ANDdocuments.custom_carrier_schematicare REQUIRED. Refuse the run if either is missing — per-port routing (VBUS-EN / OC / CC GPIOs, SS lane wiring, hub fan-out) on a custom carrier cannot be guessed. Reference-devkit-only profiles skip this check.documents.custom_carrier_pinmux_xls - ,
dtcon PATH.fdtoverlay
- 包含+
reference_devkit:块的活跃配置文件。custom_carrier: - 存在(
<source.root_path>/Linux_for_Tegra/.git)。/jetson-init-source - 已运行——载板闪存配置分支已在overlay跟踪器中。
/jetson-derive-carrier - 当任何启用的USB3 SS端口需要非默认UPHY lane分配时,需先运行。其位于
/jetson-customize-uphy的JSON辅助文件会被用于查询SS lane分配信息。<workspace>/target-platform/<profile-stem>.jetson-customize-uphy.json - 权威文档:适配指南 §“移植通用串行总线”、模块设计指南 §USB、SoC技术参考手册(xusb模块)。
- **当存在时,
custom_carrier:和documents.custom_carrier_schematic均为必填项。**如果其中任意一项缺失则拒绝运行——无法猜测定制载板上的按端口路由(VBUS-EN/OC/CC GPIO、SS lane布线、集线器扩展)信息。仅包含参考开发板的配置文件可跳过此检查。documents.custom_carrier_pinmux_xls - 系统PATH中包含、
dtc工具。fdtoverlay
Overview
概述
USB on Tegra spans three IP surfaces: the block (USB2
OTG + USB3 SS PHYs), the xHCI host controller, and an
optional device controller attached to the single
OTG-capable USB2 port ().
xusb_padctltegra-xusbtegra-xudcusb2-0A per-port flip MUST touch three kernel-DT places in lockstep.
Anything less crashes the host xHCI probe and leaves empty
on every port (collateral damage to stock-okay ports):
lsusb| # | Place | Path | What it controls |
|---|---|---|---|
| 1 | Lane (PHY provider) | | SS / OTG PHY hardware-binding. |
| 2 | Port (controller-binding) | | Per-port mode (host/device/otg), companion link, VBUS / OC / CC pin refs. |
| 3 | Host xHCI phys-list | | Array of phandles + names the xHCI driver iterates. A ref to a disabled PHY returns |
NVIDIA's stock-disabled in the Thor base DTB is the canonical
pattern — all three places flipped in lockstep.
usb3-3Two extra rules ride on top of the three-place pattern:
- Rule A — lane + port pairing. Lane (place 1) and matching port (place 2) MUST flip together.
- Rule B — companion cascade.
references a USB2 port phandle. Disabling that USB2 without cascading to its SS companion then
xusb_padctl/ports/usb3-N.nvidia,usb2-companion.tegra-xusb: failed to enable PHYs: -19
Agentic, not table-driven — every port, controller, lane,
companion link, phandle, and lookup is resolved at
runtime from docs + DTB + carrier pinmap + schematic.
__symbols__Tegra平台上的USB涉及三个IP层面:模块(USB2 OTG + USB3 SS PHY)、 xHCI主机控制器,以及可选的设备控制器(连接到唯一支持OTG的USB2端口)。
xusb_padctltegra-xusbtegra-xudcusb2-0**按端口切换必须同步修改内核DT的三个位置。**任何遗漏都会导致主机xHCI探测失败,且所有端口的命令返回空(对原本正常的端口造成连带损坏):
lsusb| # | 位置 | 路径 | 控制内容 |
|---|---|---|---|
| 1 | Lane(PHY提供者) | | SS/OTG PHY硬件绑定。设置 |
| 2 | Port(控制器绑定) | | 按端口模式(主机/设备/OTG)、配套链路、VBUS/OC/CC引脚引用。设置 |
| 3 | 主机xHCI物理列表 | | xHCI驱动遍历的句柄数组及名称。引用已禁用的PHY会返回 |
Thor基础DTB中NVIDIA默认禁用的是标准示例——三个位置已同步切换。
usb3-3在三位置模式之上还有两条额外规则:
- **规则A——lane与端口配对。**Lane(位置1)和对应的端口(位置2)必须同步切换状态。
- 规则B——配套级联。引用了一个USB2端口的句柄。如果禁用该USB2端口但未同步禁用其SS配套端口,会出现
xusb_padctl/ports/usb3-N.nvidia,usb2-companion错误。tegra-xusb: failed to enable PHYs: -19
采用智能驱动而非表格驱动——每个端口、控制器、lane、配套链路、phandle以及查找均在运行时通过文档、DTB、载板引脚图和原理图解析得出。
__symbols__When to invoke
调用时机
- The user says "enable USB", "disable USB hub", "configure USB3 SS", "set USB role", "wire VBUS-EN", "tegra-xusb / xudc / dr_mode", or asks to bring up / take down a USB controller on a custom carrier.
- A USB receptacle on the carrier doesn't enumerate after flash, OR
collateral USB damage (empty after a previous jetson-customize-usb attempt) needs to be fixed.
lsusb - re-allocated UPHY lanes affecting USB3 SS ports and per-port DT now needs to follow.
jetson-customize-uphy
- 当用户提出“启用USB”、“禁用USB集线器”、“配置USB3 SS”、“设置USB角色”、“连接VBUS-EN”、“tegra-xusb/xudc/dr_mode”,或要求在定制载板上启动/关闭USB控制器时。
- 载板上的USB接口在闪存后无法枚举,或需要修复之前尝试导致的USB连带损坏(
jetson-customize-usb返回空)时。lsusb - 重新分配了影响USB3 SS端口的UPHY lane,此时需要同步更新按端口的DT配置。
jetson-customize-uphy
Procedure (summary)
流程概述
The full step-by-step procedure lives in .
references/procedure.md- Step 1 — resolve active target + open source-of-truth docs.
- Step 2 — build the USB topology + companion graph from the in-tree DTB.
- Step 3 — for port(s) to enable / disable; surface companion cascade + on-carrier hub fan-out explicitly.
AskUserQuestion - Step 4 — per-port verify (module + carrier + UPHY lane) and
capture wiring (VBUS-EN / OC / CC GPIOs via ).
pin_verifier.py - Step 5 — render the kernel-DT overlay using the three-place
pattern, append fragments (,
usb:padctl, optionalusb:xhci) to the composite custom overlayusb:xudc, run.dts+ the three post-merge invariants, commit tofdtoverlay.bsp_sources/ - Step 6 — write run-state JSON sidecar (shape in
), emit headline, then drive the downstream next-step chain via sequential
references/run-state-sidecar.mdprompts perAskUserQuestionStep 6. Never substitute a printed "Next step: …" line for the prompts.references/procedure.md
See for the load-bearing failure modes.
references/gotchas.md完整的分步流程请查看。
references/procedure.md- 步骤1——解析活跃目标并打开权威文档。
- 步骤2——从内核自带DTB构建USB拓扑及配套链路图。
- 步骤3——调用询问要启用/禁用的端口;明确显示配套级联及载板上的集线器扩展信息。
AskUserQuestion - 步骤4——按端口验证(模块+载板+UPHY lane)并捕获布线信息(通过获取VBUS-EN/OC/CC GPIO)。
pin_verifier.py - 步骤5——使用三位置模式生成kernel-DT overlay,将片段(、
usb:padctl、可选的usb:xhci)追加到复合定制overlayusb:xudc文件中,运行.dts及三个合并后校验规则,提交到fdtoverlay。bsp_sources/ - 步骤6——写入运行状态JSON辅助文件(格式参考),输出标题,然后按照
references/run-state-sidecar.md步骤6中的顺序通过references/procedure.md提示驱动下游后续步骤。切勿用打印的“下一步:…”替代提示信息。AskUserQuestion
请查看了解关键故障模式。
references/gotchas.mdLimitations
限制条件
- Owns kernel-DT overlay only. ODMDATA does not expose a per-port
USB knob; do not edit it.
status - Does NOT allocate UPHY lanes — owns that. Refuse to commit an SS-enable until uphy run-state shows the lane allocated.
jetson-customize-uphy - Does NOT directly patch the pinmux DTSI — routes SFIO mismatches
to .
/jetson-customize-pinmux set-pin - Does NOT compile the or register
.dtbo—OVERLAY_DTB_FILE+=owns build + flash-conf registration./jetson-build-source - Tegra platform invariant: only is OTG-capable;
usb2-0attaches there only. All other USB2 ports and all USB3 SS ports are host-only.xudc
- 仅负责kernel-DT overlay。ODMDATA没有提供按端口设置USB的选项;请勿编辑它。
status - 不负责UPHY lane分配——该功能属于。在uphy运行状态显示lane已分配前,拒绝提交SS启用的修改。
jetson-customize-uphy - 不直接修补pinmux DTSI——将SFIO不匹配问题导向。
/jetson-customize-pinmux set-pin - 不编译或注册
.dtbo——该功能属于OVERLAY_DTB_FILE+=的构建及闪存配置注册环节。/jetson-build-source - Tegra平台固定规则:仅支持OTG;
usb2-0仅连接到该端口。所有其他USB2端口及USB3 SS端口仅支持主机模式。xudc
Troubleshooting
故障排查
- Empty on every port, USB-eth at 192.168.55.1 still up: host xHCI bailed; three-place lockstep was broken. Inspect merged DTB; verify post-merge invariants in
lsusbStep 5d.references/procedure.md - : companion cascade (Rule B) violated — a USB2 was disabled without its SS companion.
tegra-xusb: failed to enable PHYs: -19 - or
no port found: Rule A violated — lane status and port status are mismatched.Requested PHY is disabled - from
FDT_ERR_NOTFOUND: a fragment usedfdtoverlayfor a node whose label is not intarget = <&label>(typical for host xHCI /__symbols__). Switch totegra-xudc.target-path = "/bus@0/usb@<addr>" - dtc warning : benign; expected when using raw integer phandles in the host phys override.
phys_property: cell 0 is not a phandle reference - Port boots but VBUS never asserts: references a regulator parent node that does not exist. Ensure the fixed regulator node is present before referencing it.
vbus-supply - xHCI binds the wrong port at boot: host element order was not preserved. Only elide disabled entries; never reorder kept ones.
phys
- **所有端口的返回空,但USB以太网仍在192.168.55.1运行:**主机xHCI启动失败;三位置同步规则被破坏。检查合并后的DTB;验证
lsusb步骤5d中的合并后校验规则。references/procedure.md - **:**违反了配套级联规则(规则B)——禁用了USB2端口但未同步禁用其SS配套端口。
tegra-xusb: failed to enable PHYs: -19 - **或
no port found:**违反了lane与端口配对规则(规则A)——lane状态与端口状态不匹配。Requested PHY is disabled - **返回
fdtoverlay:**某个片段使用了FDT_ERR_NOTFOUND引用节点,但该节点的标签不在target = <&label>中(主机xHCI/__symbols__常见此问题)。切换为tegra-xudc。target-path = "/bus@0/usb@<addr>" - **dtc警告:**良性警告;在主机phys覆盖中使用原始整数句柄时会出现此情况。
phys_property: cell 0 is not a phandle reference - 端口启动但VBUS从未激活:引用了不存在的调节器父节点。确保在引用前已存在固定调节器节点。
vbus-supply - **xHCI在启动时绑定了错误的端口:**主机元素顺序未保留。仅删除已禁用的条目;切勿重新排序保留的条目。
phys
References
参考资料
- — full step-by-step procedure.
references/procedure.md - — load-bearing failure modes.
references/gotchas.md - — run-state JSON shape.
references/run-state-sidecar.md - — Tegra USB IP architecture notes (
references/usb-architecture.md,xusb_padctl,tegra-xusb).xudc - — USB DT binding cheatsheet (lane / port / phys-list shapes).
references/usb-dt-bindings.md - — shared HSIO pin verifier.
../../scripts/pin_verifier.py - —
../../references/platform_template.yamlblock consumed by Step 1.documents: - — overlay edit protocol.
../../context/bsp-customization-workflow.md - — composite overlay append protocol.
../../references/bsp-customization-kernel-dtb.md - — sibling skill that owns UPHY lane allocation.
../jetson-customize-uphy/SKILL.md - — sibling skill for VBUS-EN / OC / CC SFIO fixes.
../jetson-customize-pinmux/SKILL.md - — must run first.
../jetson-derive-carrier/SKILL.md - — produces the overlay tracker
../jetson-init-source/SKILL.md- repo.
bsp_sources
- ——完整分步流程。
references/procedure.md - ——关键故障模式。
references/gotchas.md - ——运行状态JSON格式。
references/run-state-sidecar.md - ——Tegra USB IP架构说明(
references/usb-architecture.md、xusb_padctl、tegra-xusb)。xudc - ——USB DT绑定速查表(lane/port/phys-list格式)。
references/usb-dt-bindings.md - ——共享HSIO引脚验证工具。
../../scripts/pin_verifier.py - ——步骤1使用的
../../references/platform_template.yaml块。documents: - ——overlay编辑协议。
../../context/bsp-customization-workflow.md - ——复合overlay追加协议。
../../references/bsp-customization-kernel-dtb.md - ——负责UPHY lane分配的关联技能文档。
../jetson-customize-uphy/SKILL.md - ——用于VBUS-EN/OC/CC SFIO修复的关联技能文档。
../jetson-customize-pinmux/SKILL.md - ——必须先运行此技能。
../jetson-derive-carrier/SKILL.md - ——生成overlay跟踪器及
../jetson-init-source/SKILL.md仓库。bsp_sources