Skip to content

Youyeetoo YY3588: Enable ES8388 audio support + RK3588 I2S MCLK gate fix #9534

Merged
igorpecovnik merged 2 commits intoarmbian:mainfrom
OpenSource-YYT:yy3588-audio-support
Mar 15, 2026
Merged

Youyeetoo YY3588: Enable ES8388 audio support + RK3588 I2S MCLK gate fix #9534
igorpecovnik merged 2 commits intoarmbian:mainfrom
OpenSource-YYT:yy3588-audio-support

Conversation

@SuperKali
Copy link
Member

@SuperKali SuperKali commented Mar 15, 2026

Summary

Enable full audio support for the Youyeetoo YY3588 board (RK3588) with ES8388/ES8323 codec, and fix a missing I2S MCLK output gate clock that affects all RK3588 boards using I2S audio.

Root cause: On RK3588, the I2S0 MCLK output to the IO pin is gated by SYS_GRF_SOC_CON6 (offset 0x318, bit 0). Unlike RK3588S where this gate defaults to open after reset, RK3588 defaults to closed — the codec never receives MCLK. The mainline kernel lacks the clock gate entry because all existing boards were tested on RK3588S.

Fix: Add a GATE_GRF clock entry (I2S0_8CH_MCLKOUT_TO_IO) to clk-rk3588.c following the same pattern used for RK3576 SAI MCLKs by Nicolas Frattaroli (Collabora). I've already reached out to him via email to discuss whether this affects all RK3588 boards or only specific variants. Reference: https://patchew.org/linux/20250502-rk3576-sai-v3-0-376cef19dd7c@collabora.com/

Changes

  • Kernel patch (general-rk3588-i2s-mclk-output-gate.patch): Register SYS_GRF as auxiliary GRF and add GATE_GRF for I2S0 MCLK output — applied to both 6.18 and 7.0
  • DTS: ES8388 codec via ES8323 driver, headphones (LOUT2/ROUT2) with jack detection, speaker via CS8120 amplifier (LOUT1/ROUT1), onboard + jack microphone inputs
  • Board config: Add current kernel target, update description
  • asound.state: Default mixer configuration

How Has This Been Tested?

  • Kernel 7.0-rc3 (edge) on Youyeetoo YY3588 — headphones and speaker working
  • Kernel 6.1 (vendor) on Youyeetoo YY3588 — verified as reference
  • Kernel 7.0-rc3 (edge) on Youyeetoo R1 (RK3588S) — confirmed no regression
  • MCLK gate register verified via devmem on both RK3588 and RK3588S

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
    • Full audio support for YouYeeToo YY3588: ES8323 codec, headphone/mic I/O, and speaker amplifier control
    • Configured audio routing, headphone detect and speaker-enable controls
    • Enabled I2S MCLK output path for external audio use
    • Installed default ALSA mixer/state presets for consistent playback/capture behavior
    • Updated device header to reflect 1x GbE and 1x 2.5GbE ports

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 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: 1ca1d2e0-b297-4378-948d-b3de4d2dcc21

📥 Commits

Reviewing files that changed from the base of the PR and between 990d50c and 4e2a991.

📒 Files selected for processing (2)
  • config/boards/youyeetoo-yy3588.csc
  • packages/blobs/asound.state/asound.state.youyeetoo-yy3588
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/blobs/asound.state/asound.state.youyeetoo-yy3588

📝 Walkthrough

Walkthrough

Adds ALSA state and device-tree/clock support for an ES8323-based audio path (speaker amp, I2S0_8ch, I2C7) on the YouYeetoo YY3588 board, updates board config variables (kernel targets, removes SPI boot flags, adds asound state), and introduces an RK3588 GRF clock gate to route I2S0 8‑ch MCLK to an external IO pin.

Changes

Cohort / File(s) Summary
Board Configuration
config/boards/youyeetoo-yy3588.csc
Updated board header; changed KERNEL_TARGET to vendor,current,edge; added KERNEL_TEST_TARGET="vendor,current"; removed BOOT_SUPPORT_SPI and BOOT_SPI_RKSPI_LOADER; added ASOUND_STATE="asound.state.youyeetoo-yy3588".
ALSA Audio State
packages/blobs/asound.state/asound.state.youyeetoo-yy3588
New ALSA state file with 33 controls and defaults for ES8323-based mixer (volumes, ALC, muxes, switches, HP/speaker routing).
Device Tree (RK3588, kernel 6.18)
patch/kernel/archive/rockchip64-6.18/dt/rk3588-youyeetoo-yy3588.dts
Adds speaker_amp, es8323_sound simple-audio-card, i2c7 with audio-codec@11 (ES8323), i2s0_8ch node, headphone pinctrl and routing/widgets.
I2S MCLK Clock Gate (6.18)
patch/kernel/archive/rockchip64-6.18/general-rk3588-i2s-mclk-output-gate.patch
Introduces I2S0_8CH_MCLKOUT_TO_IO constant and GATE_GRF entry; registers SYS_GRF as aux GRF in early clock init; adds <linux/mfd/syscon.h>.
Device Tree (RK3588, kernel 7.0)
patch/kernel/archive/rockchip64-7.0/dt/rk3588-youyeetoo-yy3588.dts
Parallel additions for kernel 7.0: speaker_amp, es8323_sound, i2c7/es8323, i2s0_8ch, headphone pinctrl and audio routing.
I2S MCLK Clock Gate (7.0)
patch/kernel/archive/rockchip64-7.0/general-rk3588-i2s-mclk-output-gate.patch
Same gate and SYS_GRF registration additions for RK3588 rk3588 clock branches and DT binding ID (I2S0_8CH_MCLKOUT_TO_IO).

Sequence Diagram

sequenceDiagram
    participant Boot as Bootloader
    participant CLK as Clock Manager
    participant SYSGRF as SYS_GRF (syscon)
    participant I2S as I2S0_8ch Controller
    participant I2C as I2C7
    participant CODEC as ES8323 Codec
    participant AMP as Speaker Amp
    participant OUT as Audio Output

    Boot->>CLK: early_init clocks
    CLK->>SYSGRF: register SYS_GRF (aux_grf_table)
    CLK->>SYSGRF: enable I2S0_8CH_MCLKOUT_TO_IO gate
    Note over CLK,SYSGRF: MCLK path gated to IO

    CLK->>I2S: configure I2S0_8ch (mclk, format, pinctrl)
    I2C->>CODEC: configure codec via I2C7
    I2S->>CODEC: stream I2S audio
    CODEC->>AMP: drive speaker amp (SHDN via GPIO)
    CODEC->>OUT: route to Headphones / Speaker (hp_det GPIO)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped on traces, tiny paws on board and pin,

I coaxed MCLK outward, let the I2S sing in,
ES8323 woke, amps blinked with a grin,
Volumes found their places, muxes twitched just so,
YY3588 hums — a rabbit's happy glow.

🚥 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 accurately describes the main changes: enabling ES8388/ES8323 audio support for Youyeetoo YY3588 board and fixing the RK3588 I2S MCLK gate issue, matching the primary objectives and file modifications in the pull request.
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
📝 Coding Plan
  • Generate coding plan for human review comments

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, ... BSP Board Support Packages labels Mar 15, 2026
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/boards/youyeetoo-yy3588.csc`:
- Around line 8-9: The board config is missing ASOUND_STATE so the new mixer
blob won't be installed; update the board config (where KERNEL_TARGET and
KERNEL_TEST_TARGET are defined) to add ASOUND_STATE set to the package name
added in the PR (asound.state.youyeetoo-yy3588) so the rootfs installer picks up
and installs that asound state blob.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 56b43a0f-ce28-473d-9742-07286ced4178

📥 Commits

Reviewing files that changed from the base of the PR and between a76df5f and 63eef0c.

📒 Files selected for processing (6)
  • config/boards/youyeetoo-yy3588.csc
  • packages/blobs/asound.state/asound.state.youyeetoo-yy3588
  • patch/kernel/archive/rockchip64-6.18/dt/rk3588-youyeetoo-yy3588.dts
  • patch/kernel/archive/rockchip64-6.18/general-rk3588-i2s-mclk-output-gate.patch
  • patch/kernel/archive/rockchip64-7.0/dt/rk3588-youyeetoo-yy3588.dts
  • patch/kernel/archive/rockchip64-7.0/general-rk3588-i2s-mclk-output-gate.patch

@SuperKali SuperKali force-pushed the yy3588-audio-support branch from 63eef0c to 990d50c Compare March 15, 2026 14:13
@SuperKali SuperKali force-pushed the yy3588-audio-support branch from 990d50c to 4463c87 Compare March 15, 2026 16:59
On RK3588, the I2S0 MCLK output to the IO pin is gated by
SYS_GRF_SOC_CON6 (offset 0x318, bit 0). Unlike RK3588S where this
gate defaults to open, RK3588 defaults to closed, preventing MCLK
from reaching external audio codecs.

Add a GATE_GRF clock entry (I2S0_8CH_MCLKOUT_TO_IO) following the
pattern established for RK3576 SAI MCLKs using clk-gate-grf.c.
Add ES8388 codec support via ES8323 driver on I2C7 with:
- Headphones on LOUT2/ROUT2 with jack detection
- Speaker via CS8120 amplifier on LOUT1/ROUT1
- Onboard microphone and microphone jack inputs
- MCLK routed through I2S0_8CH_MCLKOUT_TO_IO gate clock
- Default mixer state via asound.state
- Board config: add current kernel target, update description
@SuperKali SuperKali force-pushed the yy3588-audio-support branch from 4463c87 to 4e2a991 Compare March 15, 2026 17:01
@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Mar 15, 2026
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot removed the Needs review Seeking for review label Mar 15, 2026
@igorpecovnik igorpecovnik merged commit e99fefe into armbian:main Mar 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release BSP Board Support Packages 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.

2 participants