Skip to content
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

Refactor patches for NanoPC T6 & LTS #7980

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

SuperKali
Copy link
Member

Description

Regarding PR #7969, I have reworked all the patches for the NanoPC T6 because many things have changed in the mainline. As a result, USB 3.0 on the NanoPC T6 was failing to show up. However, there is an issue in the mainline where USB 3.0 does not work out of the box on the NanoPC T6 non-LTS version. To fix this, I added the correct VBUS supply to the appropriate PHY node and the necessary extcon to connect the host0 node to the correct PHY. With these changes, USB 3.0 now works correctly on the NanoPC T6 non-LTS.

Summary:

  • Removed the old patch that added USB 3.0 and fan support. Replaced it with a new patch for fan support only.
  • Updated the HDMI and audio patch for DTS compatibility. HDMI0 now supports both video and audio, while HDMI1 supports both audio and video.
  • Rewrote the USB 3.0 fix patch: added extcon = "u2phy0" to usb_host0_xhci and updated vbus-supply for u2phy0_otg to vcc5v0_usb.

How Has This Been Tested?

  • Tested on NanoPC T6

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

@rpardini
Copy link
Member

I will pick and test on LTS, ASAP.

@rpardini
Copy link
Member

This is mostly touching @ColorfulRhino's patch for fan and a regulator. Inputs?

@SuperKali
Copy link
Member Author

This is mostly touching @ColorfulRhino's patch for fan and a regulator. Inputs?

Absolutely not, the fan-related patch I had written here #7393

@rpardini
Copy link
Member

fan-related patch I had written here

My bad, you're Co-Author on ColorfulRhino's commit, git fooled me.

Copy link
Contributor

coderabbitai bot commented Mar 25, 2025

Walkthrough

The changes update the Rockchip RK3588 NanoPC T6 device tree to align the hardware configuration with new functionalities. The updates include adding nodes for USB3.0 power supply, PWM-controlled fan support, and thermal management. Specific modifications introduce a PWM fan node with associated cooling levels, trip points, and cooling maps, as well as a fixed regulator node with GPIO control for enabling power supplies. Adjustments to USB-A functionality add a phy-supply property and an extcon property, alongside renaming USB PHY nodes and modifying host controller assignments. Additionally, support for HDMI1 and audio has been incorporated by adding new nodes and endpoints for HDMI input and sound output. These modifications ensure that power, thermal, USB, and multimedia configurations are correctly declared in the board’s device tree.

Suggested labels

Ready to merge, 05

Suggested reviewers

  • ColorfulRhino
  • rpardini
  • JohnTheCoolingFan
  • EvilOlaf
  • clee
  • joekhoobyar
  • brentr
  • lanefu
  • ahoneybun
  • Tonymac32
  • TheSnowfield
  • TRSx80
  • Manouchehri
  • igorpecovnik
  • catalinii
  • paolosabatino
  • schwar3kat
  • ColorfulRhino

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (1)

19-25: PWM fan node looks good, but fix indentation

The PWM fan implementation correctly defines the necessary properties including compatibility, cooling levels, and PWM parameters. The cooling levels progression (100, 160, 190, 200, 215, 235, 255) provides a good range of fan speeds.

There's an indentation inconsistency in the fan-supply line that should be fixed:

-        	fan-supply = <&vcc5v0_sys>;
+		fan-supply = <&vcc5v0_sys>;
patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-hdmi1-and-audio-support.patch (1)

3-4: Future date in commit metadata.

The commit date is set to March 20, 2025, which is in the future. This might be a typo or a system clock issue.

-Date: Thu, 20 Mar 2025 19:51:46 +0000
+Date: Thu, 20 Mar 2024 19:51:46 +0000
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dea159a and 4849a0c.

📒 Files selected for processing (5)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-Add-USB3-psu-and-fan-support.patch (0 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (1 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1052-board-nanopc-t6-fix-usb3-a.patch (1 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-fix-usb3-a.patch (0 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-hdmi1-and-audio-support.patch (4 hunks)
💤 Files with no reviewable changes (2)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-fix-usb3-a.patch
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-Add-USB3-psu-and-fan-support.patch
🔇 Additional comments (11)
patch/kernel/archive/rockchip64-6.14/rk3588-1052-board-nanopc-t6-fix-usb3-a.patch (3)

18-19: Power supply configuration added for USB 2.0 PHY OTG port

This change correctly adds the phy-supply property to the u2phy0_otg node, connecting it to the vbus5v0_usb power supply. This is essential for proper USB OTG functionality as it ensures the PHY has the correct 5V power reference.


25-27: USB role management improvement with extcon property

Adding the extcon property to link the USB host controller (usb_host0_xhci) with the USB PHY (u2phy0) is an appropriate fix. This configuration enables proper external connector state management and helps with USB role switching, which is necessary for the controller that already has usb-role-switch and dr_mode = "host" properties.


1-10: Well-structured patch with clear purpose

This patch follows proper Git formatting with a descriptive subject line, sign-off, and clear indication of the changes being made. The commit message clearly states the purpose of fixing USB-A 3.0 functionality on the NanoPC T6.

patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (2)

34-60: Well-structured thermal configuration

The thermal management configuration is properly implemented with appropriate temperature thresholds and hysteresis values. The polling delay of 1000ms is reasonable for thermal monitoring.

The thermal trip points at 55°C and 65°C with the corresponding cooling maps create a two-stage fan control that should provide effective cooling while minimizing noise:

  • At 55°C, the fan starts at a low speed (cooling level 1)
  • At 65°C, the fan increases to at least cooling level 2 and can scale up as needed

1-6: Update subject and sign-off information

The patch subject line and sign-off information look good, providing clear information about the purpose of the patch.

patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-hdmi1-and-audio-support.patch (6)

19-28: HDMI1 connector configuration looks good.

The HDMI Type-A connector is properly defined with the correct endpoint connection to the HDMI1 output.


38-40: HDMI0 audio support enabled correctly.

Enabling the hdmi0_sound node by setting status to "okay" properly activates audio support for HDMI0.


49-67: HDMI1 configuration is complete and correct.

The configuration properly:

  1. Enables the HDMI1 controller
  2. Sets up input from the video processor (VP1)
  3. Configures output to the physical connector
  4. Enables audio support for HDMI1

The connections between endpoints are correctly established.


73-75: HDMI1 physical layer enabled correctly.

Enabling hdptxphy1 is necessary for HDMI1 to function, as it handles the electrical signaling.


84-90: Audio interfaces enabled correctly.

Enabling the I2S5 and I2S6 8-channel interfaces is necessary for proper audio support through HDMI.


101-106: Video processor configuration for HDMI1 looks good.

The VP1 endpoint is correctly configured to output to HDMI1, completing the video pipeline from processor to display.

@JohnTheCoolingFan
Copy link
Contributor

Correct on the inconsistent indentation, wrong on the commit date (today is march 25th 2025).

@rpardini
Copy link
Member

That rabbit is a tiny bit drunk, but otherwise he helps more than hinders.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (4)

24-24: Fix indentation inconsistency.

Line 24 uses spaces for indentation while the rest of the file uses tabs, which is inconsistent with the Linux kernel coding style.

-        fan-supply = <&vcc5v0_sys>;
+	fan-supply = <&vcc5v0_sys>;

53-54: Consider finer-grained fan speed control for the first thermal trip point.

The current implementation jumps directly to cooling level 1 (160) when temperature reaches 55°C. You might want to consider a more gradual ramp-up for quieter operation under moderate load.

-			cooling-device = <&fan0 THERMAL_NO_LIMIT 1>;
+			cooling-device = <&fan0 0 1>;

1-7: Fix the commit date in the patch header.

The commit date (March 20, 2025) is inconsistent with the current date indicated in the PR comments (March 25, 2025).


22-22: Consider documenting cooling level values for better maintainability.

Adding a comment explaining the relationship between cooling levels and fan speed percentages would improve code maintainability for future developers.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4849a0c and 113365e.

📒 Files selected for processing (5)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-Add-USB3-psu-and-fan-support.patch (0 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (1 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1052-board-nanopc-t6-fix-usb3-a.patch (1 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-fix-usb3-a.patch (0 hunks)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-hdmi1-and-audio-support.patch (4 hunks)
💤 Files with no reviewable changes (2)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-Add-USB3-psu-and-fan-support.patch
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-fix-usb3-a.patch
🚧 Files skipped from review as they are similar to previous changes (2)
  • patch/kernel/archive/rockchip64-6.14/rk3588-1052-board-nanopc-t6-fix-usb3-a.patch
  • patch/kernel/archive/rockchip64-6.14/rk3588-1053-board-nanopc-t6-hdmi1-and-audio-support.patch
🔇 Additional comments (2)
patch/kernel/archive/rockchip64-6.14/rk3588-1051-board-nanopc-t6-fan-support.patch (2)

19-25: Effective fan node configuration with proper compatibility and parameters.

The PWM fan implementation looks good, with appropriate cooling levels and PWM configuration. The fan is properly connected to PWM1 and powered by the system 5V supply.


34-60: Well-structured thermal configuration with appropriate trip points.

The thermal management implementation is good, with sensible temperature thresholds (55°C and 65°C) and hysteresis values. The cooling maps properly connect the temperature trip points to the fan cooling levels.

@igorpecovnik
Copy link
Member

That rabbit is a tiny bit drunk

Efficiency 🤣

image

@SuperKali SuperKali added Ready to merge Reviewed, tested and ready for merge 05 Milestone: Second quarter release and removed Needs review Seeking for review labels Mar 27, 2025
@SuperKali SuperKali merged commit b9d3931 into armbian:main Mar 27, 2025
13 checks passed
@rpardini
Copy link
Member

Tested (clearly a bit late for @igorpecovnik 's merge surge 😜 ) on T6-LTS.

It didn't break anything for me, all USB ports still work.
There is though

# cat /sys/kernel/debug/devices_deferred
6-0022	typec_fusb302: cannot register tcpm port

but I think that was already there before this.

Also typec_fusb302 6-0022: No cable types defined, using default cables spams dmesg, also already there before.

@igorpecovnik
Copy link
Member

igorpecovnik commented Mar 28, 2025

merge surge

I waited longer then usual :)

leggewie pushed a commit to leggewie/armbian-build that referenced this pull request Mar 29, 2025
@SuperKali SuperKali deleted the nanopct6-refactor branch March 29, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

4 participants