-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
rockchip64: station-m3: Enable USB type-C port #9246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a complete USB Type-C port topology to the RK3588S ROC‑PC device tree: a FUSB302 TCPM node, Type‑C connector and ports, DP PHY with orientation/alt‑mode endpoints, GPIO interrupt and SBU routing, and xHCI role‑switch/OTG wiring. All changes are additive to the DTS. Changes
Sequence Diagram(s)sequenceDiagram
participant Cable as "USB-C Cable"
participant TCPM as "FUSB302 (usbc0)"
participant PHY as "usbdp_phy0 (DP PHY)"
participant XHCI as "usb_host0_xhci"
participant Reg as "vcc5v0_host_en (5V regulator)"
Cable->>TCPM: Plug-in / CC negotiation
TCPM->>PHY: orientation / SBU detect
TCPM->>XHCI: request role switch (usb-role-switch)
alt Host role granted
XHCI->>Reg: enable VBUS
Reg-->>XHCI: VBUS present
else Device role
XHCI-->>TCPM: enter device mode
end
TCPM->>PHY: signal DP alt‑mode mux
PHY->>XHCI: route SuperSpeed / DP lanes via endpoints
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@patch/kernel/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch`:
- Around line 83-96: The DT node &usb_host0_xhci contains a duplicated property
"status = \"okay\""; remove the redundant one so only a single status = "okay"
remains, ensuring dr_mode = "otg", usb-role-switch, and the
port/usb_host0_xhci_drd_sw endpoint (remote-endpoint = <&usbc0_hs>) stay intact;
apply the same fix to the corresponding 6.19 patch that shares this content.
In
`@patch/kernel/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch`:
- Around line 83-96: The &usb_host0_xhci node contains a duplicated status =
"okay"; property; remove the redundant one so the node only has a single status
property (keep the existing status line and delete the duplicate), ensuring
dr_mode = "otg", usb-role-switch, and the port/endpoint block
(usb_host0_xhci_drd_sw -> remote-endpoint = <&usbc0_hs>;) remain unchanged and
inside the &usb_host0_xhci node.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
patch/kernel/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patchpatch/kernel/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: iav
Repo: armbian/build PR: 9158
File: patch/kernel/archive/rockchip64-6.18/add-board-helios64.patch:598-600
Timestamp: 2026-01-03T07:27:45.955Z
Learning: In Rockchip vendor kernel branches (e.g., rockchip64-6.18), the FUSB302 device tree binding accepts usb-role-switch as a phandle reference to a USB role switch provider (e.g., typec_extcon_bridge), not just as a boolean flag as in mainline kernel bindings. The vendor implementation allows usb-role-switch = <&typec_extcon_bridge>; to work correctly.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:64-70
Timestamp: 2025-09-14T06:10:25.610Z
Learning: In the Armbian build system, rk32xx and rk33xx Rockchip SoCs no longer have BSP-based (vendor) kernel branches. The rk3506 is the first 32-bit Rockchip SoC to use the vendor branch in the current codebase.
Learnt from: igorpecovnik
Repo: armbian/build PR: 8789
File: config/kernel/linux-sunxi64-edge.config:839-839
Timestamp: 2025-10-22T07:51:53.015Z
Learning: In Armbian's wireless driver configuration, CONFIG_RK_WIFI_DEVICE_* options are Rockchip-specific device registration settings, while CONFIG_WLAN_UWE* are the actual cross-platform driver modules for UWE5622 wireless chips. The UWE5622 chip (manufactured by Unisoc/Spreadtrum) is used on multiple Allwinner boards including Orange Pi Zero 2/2W/3 and Orange Pi 3 LTS, so CONFIG_WLAN_UWE5621/5622 along with Unisoc infrastructure options (CONFIG_SPARD_WLAN_SUPPORT, CONFIG_SC23XX, CONFIG_UNISOC_WIFI_PS, CONFIG_WCN_BSP_DRIVER_BUILDIN) are correct in sunxi64 kernel configs.
Learnt from: HackingGate
Repo: armbian/build PR: 8665
File: config/boards/photonicat2.csc:4-4
Timestamp: 2025-10-26T10:41:35.118Z
Learning: In the Armbian build system, rk3576 boards consistently use BOARDFAMILY="rk35xx" for both vendor and edge kernel targets. The rk35xx family configuration sources rockchip64_common.inc, which provides edge and current kernel branch definitions, making these branches available even though they're not defined directly in rk35xx.conf.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8886
File: patch/kernel/rk35xx-vendor-6.1/dt/rk3528-nanopi-rev01.dts:9-9
Timestamp: 2025-11-08T06:39:24.527Z
Learning: In Armbian's Rockchip vendor kernel branches (rk35xx-vendor), device tree files may not require the same headers as mainline Linux. For example, input key definitions like KEY_BACK and KEY_VOLUMEUP may be handled differently in BSP kernels and don't necessarily need explicit includes like <dt-bindings/input/input.h> that would be required in mainline kernel device trees.
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:64-70
Timestamp: 2025-09-14T06:29:18.958Z
Learning: In the Armbian build system, vendor branch configurations in family files are designed to be shared across multiple SoCs within the same family that use the same vendor kernel tree. For example, rk35xx and rockchip-rk3588 families both use identical vendor branch settings (same KERNELSOURCE, KERNELBRANCH, and KERNELPATCHDIR), demonstrating that vendor branches are intentionally generic rather than SoC-specific.
📚 Learning: 2026-01-03T07:27:45.955Z
Learnt from: iav
Repo: armbian/build PR: 9158
File: patch/kernel/archive/rockchip64-6.18/add-board-helios64.patch:598-600
Timestamp: 2026-01-03T07:27:45.955Z
Learning: In Rockchip vendor kernel branches (e.g., rockchip64-6.18), the FUSB302 device tree binding accepts usb-role-switch as a phandle reference to a USB role switch provider (e.g., typec_extcon_bridge), not just as a boolean flag as in mainline kernel bindings. The vendor implementation allows usb-role-switch = <&typec_extcon_bridge>; to work correctly.
Applied to files:
patch/kernel/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
📚 Learning: 2026-01-10T04:28:58.758Z
Learnt from: kasimling
Repo: armbian/build PR: 9177
File: patch/kernel/archive/rockchip64-6.18/rk3588-1212-arm64-dts-Automatic-fan-speed-and-USB-3.0-Type-A-por.patch:37-41
Timestamp: 2026-01-10T04:28:58.758Z
Learning: When reviewing Linux kernel device-tree bindings involving thermal cooling devices, THERMAL_NO_LIMIT can be used for both min_state (lower) and max_state (upper). If used as lower/min_state, the framework converts it to 0; if used as upper/max_state, it converts to the cooling device's max_state. Verify patch entries like: cooling-device = <&fan THERMAL_NO_LIMIT 1> are valid and correctly reflect the intended bounds. Ensure consistent interpretation of NO_LIMIT in both min and max contexts and that the resulting values align with the device's actual limits.
Applied to files:
patch/kernel/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patchpatch/kernel/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
📚 Learning: 2026-01-03T07:27:40.951Z
Learnt from: iav
Repo: armbian/build PR: 9158
File: patch/kernel/archive/rockchip64-6.18/add-board-helios64.patch:598-600
Timestamp: 2026-01-03T07:27:40.951Z
Learning: In vendor Rockchip kernel patches (e.g., rockchip64-6.18), verify that the FUSB302 device tree binding uses a phandle reference for usb-role-switch (e.g., usb-role-switch = <&typec_extcon_bridge>;), not a bare boolean flag as in mainline. Ensure patches reflect the vendor implementation that supports phandles to a USB role switch provider, and adjust bindings accordingly to avoid regressions in USB role switching.
Applied to files:
patch/kernel/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
🔇 Additional comments (5)
patch/kernel/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch (3)
20-68: FUSB302 and USB-C connector configuration looks correct.The FUSB302 node is properly configured with:
- Correct compatible string
"fcs,fusb302"- Level-low interrupt with matching pull-up pinctrl
- USB-C connector with dual data/power roles
- Proper endpoint wiring to xhci DRD, PHY SS, and SBU ports
The PD configuration (sink 5V/1A, source 5V/3A) is reasonable for this board.
76-78: Pinctrl configuration is correct.The interrupt pin matches the FUSB302 interrupt definition (GPIO0 RK_PC4) with appropriate pull-up configuration for active-low signaling.
103-123: USBDP PHY configuration looks good.The PHY node properly enables orientation switching and configures SBU DC GPIOs. The endpoint connections correctly pair with the connector's SS and SBU ports, completing the bidirectional endpoint graph.
patch/kernel/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch (2)
20-68: FUSB302 and connector configuration is correct.Same as the 6.19 patch - properly configured FUSB302 with USB-C connector, PD settings, and endpoint wiring.
103-123: USBDP PHY configuration is correct.Endpoint graph properly connects the PHY to the USB-C connector for SuperSpeed and SBU lanes.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
...el/archive/rockchip64-6.18/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
Outdated
Show resolved
Hide resolved
...el/archive/rockchip64-6.19/rk3588-1213-arm64-dts-rk3588s-roc-pc-Enable-USB-type-C-port.patch
Outdated
Show resolved
Hide resolved
igorpecovnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address Rabbitt's suggestions.
Signed-off-by: Alex Ling <[email protected]>
e6e98f6 to
8f5655c
Compare
|
Resolved review comments and fixed USB 3.0 support |
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
Enable the USB Type-C port on station-m3
How Has This Been Tested?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.