Skip to content

rk3568: add 51.2MHz PLL rate for HDMI#9477

Merged
igorpecovnik merged 3 commits into
armbian:mainfrom
skorobkov:btt-cb2-hdmi7
Mar 4, 2026
Merged

rk3568: add 51.2MHz PLL rate for HDMI#9477
igorpecovnik merged 3 commits into
armbian:mainfrom
skorobkov:btt-cb2-hdmi7

Conversation

@skorobkov
Copy link
Copy Markdown
Contributor

@skorobkov skorobkov commented Mar 3, 2026

Description

The RK3568/RK3566 mainline clock driver (drivers/clk/rockchip/clk-rk3568.c) uses a fixed PLL rate table for all PLLs including HPLL, which drives the HDMI reference clock. The table is missing a 51.2 MHz entry — the pixel clock required by 1024x600@60Hz displays such as the BigTreeTech HDMI7.

Without this rate, dw_hdmi_rockchip_mode_valid() rejects every mode because clk_round_rate() can only return frequencies from the table, and the nearest entries (74.25 MHz and 33.3 MHz) are 45% and 35% off — far outside the 0.1% tolerance. Result: black screen, [drm] Cannot find any crtc or sizes in dmesg.

Fix: add RK3036_PLL_RATE(51200000, 1, 64, 6, 5, 1, 0) to rk3568_pll_rates[].
PLL math: 24 MHz * 64 / (6 * 5) = 51.2 MHz exactly, VCO = 1536 MHz.

How Has This Been Tested?

  • Built kernel 6.19.x and 6.18.x with the patch using ./compile.sh kernel BOARD=bigtreetech-cb2 BRANCH=edge|current RELEASE=trixie
  • Installed on BigTreeTech CB2 (RK3566) on Manta M8P v2.0 motherboard + BTT-HDMI7 (1024x600) — display works at native resolution
  • Verified modes: cat /sys/class/drm/card0-HDMI-A-1/modes shows 1024x600
  • Previously confirmed the same display is black screen without the patch

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

Summary by CodeRabbit

  • New Features
    • Added support for 1024x600@60Hz HDMI resolution on Rockchip RK3568-based devices across kernel versions 6.18 and 6.19, expanding available display compatibility options.

@skorobkov skorobkov requested a review from igorpecovnik as a code owner March 3, 2026 22:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f6df736-c323-4bfe-87ad-ffbf4e44bc0d

📥 Commits

Reviewing files that changed from the base of the PR and between c27166e and 569282f.

📒 Files selected for processing (2)
  • patch/kernel/archive/rockchip64-6.18/rk356x-add-51.2MHz-PLL-rate-for-HDMI.patch
  • patch/kernel/archive/rockchip64-6.19/rk356x-add-51.2MHz-PLL-rate-for-HDMI.patch

📝 Walkthrough

Walkthrough

Two patches add a 51.2 MHz PLL rate entry to the Rockchip RK3568 clock driver's rate table across kernel versions 6.18 and 6.19. Each patch inserts an identical initializer (RK3036_PLL_RATE(51200000, 1, 64, 6, 5, 1, 0)) into the rk3568_pll_rates array to enable HDMI display support at 1024x600@60Hz resolution.

Changes

Cohort / File(s) Summary
PLL Rate Table Updates
patch/kernel/archive/rockchip64-6.18/rk356x-add-51.2MHz-PLL-rate-for-HDMI.patch, patch/kernel/archive/rockchip64-6.19/rk356x-add-51.2MHz-PLL-rate-for-HDMI.patch
Adds 51.2 MHz PLL rate entry to rk3568_pll_rates array in drivers/clk/rockchip/clk-rk3568.c for both kernel versions 6.18 and 6.19, enabling HDMI pixel clock support at 1024x600@60Hz. Single initializer inserted into static rate table.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A whisker-twitch of crystal clear,
51.2 megahertz in here!
HDMI dreams at six-twenty-four,
Now displays can show much more! 📺✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'rk3568: add 51.2MHz PLL rate for HDMI' directly and concisely describes the main change: adding a 51.2 MHz PLL rate entry to support HDMI display modes on the RK3568 chipset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines labels Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

Hey @skorobkov! 👋

Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡
Your effort doesn’t just improve Armbian — it benefits the entire community of users and developers.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀

Comment thread patch/kernel/rockchip64-current/rk356x-add-51.2MHz-PLL-rate-for-HDMI.patch Outdated
@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented Mar 4, 2026

You're aware that the patch at the moment only applies to current right? In case you want to copy to edge just leaving the link here as a reminder for me to add to rebase: #9445

@rpardini
Copy link
Copy Markdown
Member

rpardini commented Mar 4, 2026

You're aware that the patch at the moment only applies to current right? In case you want to copy to edge just leaving the link here as a reminder for me to add to rebase: #9445

this is probably a symptom of "this actually needs to be sent upstream"

@skorobkov
Copy link
Copy Markdown
Contributor Author

You're aware that the patch at the moment only applies to current right? In case you want to copy to edge just leaving the link here as a reminder for me to add to rebase: #9445

So, what should I do?
Add patches to patch/kernel/archive/rockchip64-6.* folders?

@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented Mar 4, 2026

Either you add for 6.19 which I will then take over to 7.0 via rebase or you leave this PR as it is and do another one later once the version bump has been merged. Your call.
Other folders than 6.12, 6.18 and 6.19 aren't used by the framework and are there for archival purpose only. 6.12 gets upstream fixes only.

Edit: I just realized you did not put your patch into the actual archive. Well since 6.18 is current atm, the correct folder would be patch/kernel/archive/rockchip64-6.18

@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines and removed size/small PR with less then 50 lines labels Mar 4, 2026
@skorobkov
Copy link
Copy Markdown
Contributor Author

Either you add for 6.19 which I will then take over to 7.0 via rebase or you leave this PR as it is and do another one later once the version bump has been merged. Your call. Other folders than 6.12, 6.18 and 6.19 aren't used by the framework and are there for archival purpose only. 6.12 gets upstream fixes only.

Edit: I just realized you did not put your patch into the actual archive. Well since 6.18 is current atm, the correct folder would be patch/kernel/archive/rockchip64-6.18

Placed patch to 6.18 & 6.19 folders.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Mar 4, 2026
@igorpecovnik igorpecovnik merged commit 40d5a9a into armbian:main Mar 4, 2026
1 check passed
@skorobkov skorobkov deleted the btt-cb2-hdmi7 branch March 4, 2026 23:39
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/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

5 participants