Skip to content

Rockchip: youyeetoo yy3568: enable pci-e NVMe ssd#9877

Open
hqnicolas wants to merge 1 commit into
armbian:mainfrom
hqnicolas:main
Open

Rockchip: youyeetoo yy3568: enable pci-e NVMe ssd#9877
hqnicolas wants to merge 1 commit into
armbian:mainfrom
hqnicolas:main

Conversation

@hqnicolas
Copy link
Copy Markdown
Contributor

@hqnicolas hqnicolas commented May 22, 2026

Description

This PR replaces #9832 , applying the changes requested by https://github.com/Arthur97172
I keep this dedication here in recognition of Arthur's effort.

To the author, we can close the PR.
#9832

Fixed NVMe SSD detection issue on Youyeetoo YY3568.

tested on 7.0.9-edge-rockchip64 by @hqnicolas
https://paste.armbian.com/amimofemog

tested on 6.18.32-current-rockchip64 by @hqnicolas
https://paste.armbian.com/ekupotacut

Problem

  • PCIe PHY lock failed (rockchip_p3phy_rk3568_init: lock failed)
  • M.2 NVMe SSD not detected (Phy link never came up)

Root Cause

Missing / incorrect configuration for:

  • SSD 3.3V power enable (GPIO3_C3)
  • PCIe Clock generator enable (GPIO3_A7, active low)
  • REFCLK (100MHz) to PCIe3 PHY
  • Wrong regulator polarity and missing startup delay

Solution

  • Added correct pcie30_pwr and pcie_oe pinctrl
  • Added proper regulators (vcc3v3_pcie + pcie_oe_regulator with active-low)
  • Updated &combphy1, &pcie30phy and &pcie3x2 with correct clocks, phy-supply and reset polarity
  • Added startup-delay-us for power stability

This makes the M.2 NVMe SSD work reliably on YY3568.

Documentation summary for feature / change

  • Short description: Fixed NVMe SSD support on Youyeetoo YY3568
  • Summary: YY3568 now correctly detects and uses M.2 NVMe SSDs (PCIe 3.0).

How Has This Been Tested?

  • Test A: Booted 7.0.9-edge-rockchip64 on YY3568 with various NVMe SSDs (Samsung 970 EVO, WD SN770, etc.)
  • Test B: Verified lspci shows NVMe device and lsblk / nvme list works
  • Test C: Cold boot + warm reboot tested multiple times (stable)

Test Configuration:

  • Board: Youyeetoo YY3568
  • 6.18.32-current-rockchip64
  • 7.0.9-edge-rockchip64

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Enabled audio interface support on the RK3568 YY3568 board.
    • Improved PCIe controller configuration and power management.
    • Enhanced Ethernet PHY and clock configuration.
  • Bug Fixes

    • Adjusted power supply routing and regulator definitions for hardware stability.
    • Updated pinctrl configurations for peripheral control.
  • Chores

    • Updated device tree configurations across kernel versions 6.18, 7.0, and 7.1, and u-boot.
    • Enabled storage interface support.

Review Change Stack

@hqnicolas hqnicolas removed the request for review from chainsx May 22, 2026 16:11
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

This PR synchronizes device tree configurations for the Rockchip RK3568 Yooyeetoo YY3568 board across kernel versions (6.18, 7.0, 7.1) and u-boot. Changes add clock bindings, restructure PCIe regulator/PHY wiring, enable audio support, and extend u-boot board peripheral initialization including storage, networking, PMIC, and crypto support.

Changes

Kernel Device Tree Synchronization (6.18, 7.0, 7.1)

Layer / File(s) Summary
Clock controller bindings
patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
Added RK3568 clock controller (rk3568-cru) header includes to enable clock identifier usage across device tree nodes in all three kernel versions.
PCIe power regulator restructuring
patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
Introduced vcc3v3_pcie and pcie_oe_regulator nodes with GPIO/pinctrl control, replacing previous PCIe rail definitions and providing dedicated output-enable regulator wiring.
PCIe PHY and controller wiring
patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
Rewired combphy1 PHY supply to use new pcie_oe_regulator and updated pcie3x2 configuration to use revised pinctrl, vpcie3v3-supply, and PHY reference routing.
Audio DAI and PCIe pinctrl groups
patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
Enabled RK809 audio DAI support via #sound-dai-cells property and added dedicated PCIe power/output-enable pinctrl groups (pcie30_pwr, pcie_oe) with GPIO pin mappings.
I2S audio interface enablement
patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
Enabled i2s0_8ch node by setting status property to okay across all kernel versions.

U-Boot Board Device Tree Configuration

Layer / File(s) Summary
Board headers and root regulator base
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Added GPIO/input/rockchip bindings, set board model/compatible identifiers, established root aliases, and created vcc12v_input fixed regulator as top-level power rail source.
Peripheral and crypto enablement
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Extended regulator definitions for PCIe rails, reorganized ADC key and GPIO LED nodes, enabled crypto support, configured Ethernet (gmac0) with PHY reset/clocking, marked GPIO controller nodes for u-boot pre-relocation, and enabled i2c0 with fixed clock frequency.
RK809 PMIC node restructuring
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Reorganized RK809 PMIC node structure while preserving core address/interrupt setup and system-power-controller behavior; adjusted pinctrl naming and property formatting.
PMIC sleep/power/reset pinctrl configuration
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Added pwrkey node and expanded pinctrl_rk8xx gpio-controller with dedicated subnodes for PMIC sleep, power, and reset pin functions.
PMIC regulator state memory updates
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Modified multiple RK809 regulator definitions and their regulator-state-mem suspend/active configuration across multiple rails.
Board peripheral and bus configuration
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts
Configured board-level buses and peripherals: i2c0_xfer status, RGMII PHY reset timing, PCIe controller/PHY/lane setup with supplies, PMU I/O domain supplies, saradc vref, SD/eMMC buses with bus widths/speeds/card-detect/write-protect and pinctrl, and uart2 enablement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

size/medium

Suggested reviewers

  • igorpecovnik
  • HeyMeco
  • prahal
  • rpardini
  • paolosabatino
  • ColorfulRhino
  • SuperKali
  • JohnTheCoolingFan
  • catalinii

Poem

🐰 A rabbit hops through device trees with glee,
PCIe regulators, now wired properly.
Audio chirps, i2s sings with delight,
Board peripherals aligned just right.
Clock controllers and pinctrl align,
YY3568 hardware, now truly fine! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly addresses the main change: enabling PCIe NVMe SSD support on the Youyeetoo YY3568 board, which is the core purpose of this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 size/large PR with 250 lines or more 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels May 22, 2026
Copy link
Copy Markdown
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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts (1)

220-221: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

pmic-reset never selects the reset mux.

pinctrl-3 points at &soc_slppin_gpio, while soc_slppin_rst is defined below and otherwise unused. That leaves the pmic-reset state in GPIO mode instead of RK_FUNC_2, so PMIC reset requests will not drive the intended reset function.

🛠️ Proposed fix
-		pinctrl-3 = <&soc_slppin_gpio>, <&rk817_slppin_rst>;
+		pinctrl-3 = <&soc_slppin_rst>, <&rk817_slppin_rst>;

Also applies to: 553-557

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts` around lines
220 - 221, pinctrl-3 currently references &soc_slppin_gpio instead of the reset
mux, so the pmic-reset state remains in GPIO mode; update the device-tree
entries that define the pmic-reset pin state (pinctrl-3) to reference
&rk817_slppin_rst (which selects RK_FUNC_2) instead of &soc_slppin_gpio so PMIC
reset requests use the reset mux; apply the same correction to the duplicate
block around lines 553-557 where the same mistaken reference appears (look for
symbols pinctrl-3, &soc_slppin_gpio, &rk817_slppin_rst, and pmic-reset).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts`:
- Around line 126-143: The &gmac0 node currently uses phy-mode = "rgmii" with
clock_in_out = "output" but does not specify controller-side RGMII delays;
update the &gmac0 device tree node to either add appropriate tx_delay and
rx_delay properties (e.g., tx_delay = <...>; rx_delay = <...>) so the dwmac
controller applies the timing, or change phy-mode to the correct
rgmii-id/rgmii-rxid/rgmii-txid variant that indicates the PHY handles delays;
modify the properties in the &gmac0 node (phy-mode, add tx_delay/rx_delay)
accordingly to match where delays are implemented.

---

Outside diff comments:
In `@patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts`:
- Around line 220-221: pinctrl-3 currently references &soc_slppin_gpio instead
of the reset mux, so the pmic-reset state remains in GPIO mode; update the
device-tree entries that define the pmic-reset pin state (pinctrl-3) to
reference &rk817_slppin_rst (which selects RK_FUNC_2) instead of
&soc_slppin_gpio so PMIC reset requests use the reset mux; apply the same
correction to the duplicate block around lines 553-557 where the same mistaken
reference appears (look for symbols pinctrl-3, &soc_slppin_gpio,
&rk817_slppin_rst, and pmic-reset).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c55526ae-aeeb-430d-87b4-ad1cd4bbfd36

📥 Commits

Reviewing files that changed from the base of the PR and between 869f0df and 9f4c226.

📒 Files selected for processing (4)
  • patch/kernel/archive/rockchip64-6.18/dt/rk3568-yy3568.dts
  • patch/kernel/archive/rockchip64-7.0/dt/rk3568-yy3568.dts
  • patch/kernel/archive/rockchip64-7.1/dt/rk3568-yy3568.dts
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts

Comment on lines +51 to +57
vcc3v3_pi6c_05: vcc3v3-pi6c-05 {
u-boot,dm-pre-reloc;
compatible = "regulator-fixed";
regulator-name = "led_sys";
enable-active-high;
gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&pcie_enable_h>;
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 22, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

U-Boot still uses the stale PCIe REFCLK/OE wiring.

The board fix described in this PR moves the PCIe clock-buffer enable onto an active-low pcie_oe path, but this DTS still drives an active-high pcie_enable_h on GPIO0_C7 and never attaches that OE rail to &pcie30phy. As written, the Linux-side NVMe fix is not actually mirrored in U-Boot, so PCIe3/NVMe discovery can still fail before handoff.

Also applies to: 495-517, 521-534

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Arthur97172 feel free to include the PCIe3/NVMe uboot fixes, to enable the device also to boot from PCI-e, there is also an OTA feature that I fail to apply into this board, feel free to make it boot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment on lines +126 to +143
&gmac0 {
u-boot,dm-pre-reloc;
phy-mode = "rgmii";
clock_in_out = "output";
snps,reset-gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
snps,reset-delays-us = <0 20000 100000>;
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
assigned-clock-rates = <0>, <125000000>;
pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus>;
phy-handle = <&rgmii_phy0>;
status = "okay";
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 22, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

For Rockchip RK3568 dwmac device-tree configuration, when a node uses phy-mode = "rgmii"andclock_in_out = "output", should tx_delayandrx_delaybe provided unless the PHY mode isrgmii-id, rgmii-rxid, or rgmii-txid?

💡 Result:

Yes—provide tx_delay and rx_delay for phy-mode = "rgmii" (including when clock_in_out = "output"). Do not provide them for phy-mode = "rgmii-id", "rgmii-rxid", or "rgmii-txid". Evidence: In the Rockchip dwmac DT binding, tx_delay and rx_delay are defined as controller-provided RGMII delay settings (TXD timing / RXD timing) with defaults 0x30 and 0x10 [1][2]. For rgmii-id operation, Linux notes that “In rgmii-id mode these are disabled, no matter what they are set to in the dt”, because the rgmii-id variants “apply the delays in the phy” [3][4]. So the practical rule you’re asking about is: - phy-mode = "rgmii" (not rgmii-id/rxid/txid): tx_delay and rx_delay should be provided (or you’ll fall back to the binding defaults) [1][2]. - phy-mode = "rgmii-id" / "rgmii-rxid" / "rgmii-txid": tx_delay and rx_delay should not be provided/are ignored [3][4].

Citations:


Fix GMAC0 RGMII timing: add tx_delay/rx_delay or use an rgmii-*-id PHY mode

&gmac0 sets phy-mode = "rgmii" with clock_in_out = "output" but omits tx_delay/rx_delay; for plain rgmii the dwmac binding expects controller-side delay settings (the rgmii-id/rgmii-rxid/rgmii-txid variants are the ones where delays are handled in the PHY and DT delays are not used). Add tx_delay/rx_delay for &gmac0, or switch phy-mode to the correct *-id variant if the PHY is responsible for the RGMII delays.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts` around lines
126 - 143, The &gmac0 node currently uses phy-mode = "rgmii" with clock_in_out =
"output" but does not specify controller-side RGMII delays; update the &gmac0
device tree node to either add appropriate tx_delay and rx_delay properties
(e.g., tx_delay = <...>; rx_delay = <...>) so the dwmac controller applies the
timing, or change phy-mode to the correct rgmii-id/rgmii-rxid/rgmii-txid variant
that indicates the PHY handles delays; modify the properties in the &gmac0 node
(phy-mode, add tx_delay/rx_delay) accordingly to match where delays are
implemented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dear robot, I cannot invent gmac0 delay values for YY3568 kernel DTS if the vendor doesn’t provide them, so leaving gmac0 unset is safer than guessing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@hqnicolas, that's a fair point — using wrong delay values would be worse than relying on the binding defaults (0x30 tx / 0x10 rx). A few non-guessing alternatives if you want to revisit this later:

  1. Check the vendor BSP — Rockchip's BSP tree or Radxa's downstream kernel often carries board-specific tuned delay values; that would be the authoritative source.
  2. Check similar RK3568 boards — e.g., rk3568-evb*.dts or rk3568-rock-3*.dts in upstream may give calibrated ballpark values for the same RTL8211F PHY.
  3. Switch phy-mode to rgmii-id — if the RTL8211F is configured to provide internal RX/TX delay (the common default for that PHY), using rgmii-id makes the intent explicit and skips the need for controller-side delays entirely.

If you'd like to track this as a follow-up issue rather than blocking this PR, I'm happy to open one.

🐇 (understood, safety first over speculation)


✏️ Learnings added
Learnt from: hqnicolas
Repo: armbian/build PR: 9877
File: patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3568-yy3568.dts:126-143
Timestamp: 2026-05-22T16:23:45.422Z
Learning: On the Youyeetoo YY3568 board (RK3568), the `gmac0` DT node uses `phy-mode = "rgmii"` with `clock_in_out = "output"` but no `tx_delay`/`rx_delay` values are provided by the vendor, so they are intentionally left unset (falling back to dwmac binding defaults 0x30/0x10). Do not flag the absence of these properties as a definite error for this board; instead suggest checking vendor BSP or switching to `rgmii-id` as alternatives. The `gmac1` node does have explicit delays (`tx_delay = <0x44>; rx_delay = <0x26>`).

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: EvilOlaf
Repo: armbian/build PR: 9067
File: patch/kernel/archive/rockchip64-6.19/dt/rk3399-orangepi-4-lts.dts:869-875
Timestamp: 2025-12-23T04:44:25.212Z
Learning: During code reviews of device tree changes (any .dts file), verify node properties against the official kernel device tree binding documentation (*.yaml) rather than relying solely on patterns observed in existing DTS files. This helps catch copy-paste or drift errors and ensures properties align with authoritative bindings for each device node type.

Learnt from: paolosabatino
Repo: armbian/build PR: 9662
File: patch/u-boot/v2026.04/dt_upstream_rockchip/rk3318-box.dts:519-525
Timestamp: 2026-04-13T20:52:36.022Z
Learning: When reviewing Armbian U-Boot device-tree files (e.g., under `patch/u-boot/**`), some peripherals may have DT nodes that are not actually consumed by U-Boot (example: a Bluetooth child node under `&uart0` for BCM43341-bt). In such cases, DT issues that would only affect the unsupported U-Boot runtime (e.g., typos in the Bluetooth node, malformed/incorrect interrupt properties inside that Bluetooth subnode) should not be treated as a U-Boot runtime bug. Still correct obvious DT syntax/structural problems so the node can be safely reused in a kernel DTS context if applicable.

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, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

1 participant