Skip to content

Conversation

SuperKali
Copy link
Member

@SuperKali SuperKali commented Sep 28, 2025

Description

This PR adds support for kernel edge 6.16 to the FriendlyELEC NanoPi M5 board based on the Rockchip RK3576 SoC.

Changes included:

  • Added comprehensive device tree source (DTS) file for NanoPi M5 with RK3576 chipset
  • Updated board configuration file (nanopi-m5.conf) to support edge kernel branch
  • Added proper hardware support for dual Ethernet, USB-C, HDMI, audio, WiFi/Bluetooth, and PCIe interfaces
  • Configured power management with RK806 PMIC support
  • Added GPIO pin mapping and peripheral configurations

How Has This Been Tested?

Test Configuration:

  • Board: FriendlyELEC NanoPi M5 (RK3576)
  • Kernel: Linux 6.16.9 (edge branch)
  • Build system: Armbian build framework
  • Host OS: Debian 13 Trixie

Tests performed:

  • Kernel Compilation Test: Successfully compiled kernel using ./compile.sh kernel BOARD=nanopi-m5 BRANCH=edge
  • Device Tree Validation: DTS file compiles without errors or warnings
  • Configuration Validation: Board configuration file properly parsed and applied
  • Build Log Analysis: No compilation errors, warnings reviewed and addressed

Test Results:
Build completed successfully with no errors. Full board log available at: https://paste.armbian.com/obuwikesag

Hardware Components Tested (via DTS validation):

  • Dual Ethernet controllers (GMAC0/GMAC1) with RGMII PHY configuration
  • USB controllers (USB 3.0 host)
  • HDMI output pipeline and display controller
  • Audio subsystem (I2S, RT5616 codec)
  • Power management (RK806 PMIC with multiple voltage rails)
  • Storage interfaces (MicroSD, SPI NOR flash, PCIe/NVMe)
  • Wireless connectivity (SDIO WiFi, UART Bluetooth)
  • GPIO and peripheral pin configurations

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

Copy link
Contributor

coderabbitai bot commented Sep 28, 2025

Walkthrough

  • config/boards/nanopi-m5.conf: KERNEL_TARGET changed from "vendor" to "vendor, edge" and the trailing comment updated from "WIP: current, edge kernel" to "WIP: current kernel". Added new public variable ASOUND_STATE="asound.state.nanopi-m5".
  • config/kernel/linux-rockchip64-edge.config: many ASoC/SND and Rockchip sound-related kernel options moved from module or disabled to built-in/enabled (CONFIG_SOUND, CONFIG_SND, CONFIG_SND_SOC and multiple SND_SOC_ROCKCHIP drivers/codecs like I2S_TDM, SAI, SPDIF, MAX98090, MULTICODECS, RT5645, RT5651, HDMI, DUMMY_CODEC, etc., set to y or otherwise enabled).
  • packages/blobs/asound.state/asound.state.nanopi-m5: new ALSA state file added defining controls and initial state for a Realtek RT5616-based audio setup (numerous MIXER/PCM/CARD controls and values; data-only).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • igorpecovnik
  • rpardini
  • prahal
  • ginkage
  • krachlatte
  • amazingfate
  • pyavitz
  • efectn
  • catalinii
  • joekhoobyar

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “rockchip: Add NanoPi M5 board support to edge kernel” clearly and concisely summarizes the primary change of this pull request by indicating that NanoPi M5 support is being added to the edge kernel branch, making it immediately understandable to reviewers and maintainers scanning the commit history.
Description Check ✅ Passed The pull request description thoroughly outlines the purpose of adding support for the NanoPi M5 on the edge kernel, enumerates the key changes such as DTS and configuration updates, and provides detailed testing procedures and results, demonstrating strong relevance to the actual changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

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.

📥 Commits

Reviewing files that changed from the base of the PR and between f35091a and e6cf4bc.

⛔ Files ignored due to path filters (1)
  • patch/kernel/archive/rockchip64-6.16/dt/rk3576-nanopi-m5.dts is excluded by !patch/**
📒 Files selected for processing (2)
  • config/boards/nanopi-m5.conf (1 hunks)
  • packages/blobs/asound.state/asound.state.nanopi-m5 (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/boards/nanopi-m5.conf
🔇 Additional comments (2)
packages/blobs/asound.state/asound.state.nanopi-m5 (2)

410-444: Ensure headphone playback path defaults to unmuted

HP Playback Switch is set to false for both channels, which will mute the headphone path immediately after alsactl restore. Unless you intend headphones to stay off by default, this prevents out-of-the-box audio. Please confirm the intended behavior and flip the switch to true if audio should be enabled.

-		value.0 false
-		value.1 false
+		value.0 true
+		value.1 true

1-5: Confirm ALSA card name alignment
state.realtekrt5616co only takes effect if the kernel exposes the sound card under the exact same ID. Manually inspect your NanoPi M5’s DTS simple-audio-card,name and, on the running device, run aplay -l to verify the card ID matches this state block (e.g. nanopi-m5-rt5616). If it differs, rename the block to the actual card name.


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 11 Milestone: Fourth quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Sep 28, 2025
@coderabbitai coderabbitai bot requested a review from ginkage September 28, 2025 07:09
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

📜 Review details

Configuration used: CodeRabbit UI

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.

📥 Commits

Reviewing files that changed from the base of the PR and between a96702d and 1fec62a.

⛔ Files ignored due to path filters (1)
  • patch/kernel/archive/rockchip64-6.16/dt/rk3576-nanopi-m5.dts is excluded by !patch/**
📒 Files selected for processing (2)
  • config/boards/nanopi-m5.conf (1 hunks)
  • config/kernel/linux-rockchip64-edge.config (2 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: SuperKali
PR: armbian/build#8609
File: config/boards/nanopi-r76s.conf:5-5
Timestamp: 2025-09-11T06:12:54.213Z
Learning: In the Armbian build system, board family configuration files (like config/sources/families/rk35xx.conf) can inherit kernel branch definitions from common include files (like config/sources/families/include/rockchip64_common.inc). Even if a branch like "edge" is not defined directly in the family conf file, it may be available through the sourced include file.
Learnt from: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.862Z
Learning: In Armbian board configuration files (regardless of file extension), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features. The file extensions indicate board support status: .conf (standard support), .csc (community supported), .eos (end of support), .tvb (tvbox), .wip (work in progress).
Learnt from: tabrisnet
PR: armbian/build#8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: The kernel_config_set_m function in lib/functions/compilation/armbian-kernel.sh preserves existing 'y' (built-in) settings and only sets options to 'm' (module) when they are not already built-in, achieving "prefer modules but allow built-ins" behavior.
Learnt from: tabrisnet
PR: armbian/build#8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: The kernel_config_set_m function in lib/functions/compilation/armbian-kernel.sh preserves existing 'y' (built-in) settings and only sets options to 'm' (module) when they are not already built-in, achieving "prefer modules but allow built-ins" behavior.
📚 Learning: 2025-09-11T06:16:10.236Z
Learnt from: SuperKali
PR: armbian/build#8609
File: config/boards/nanopi-r76s.conf:5-5
Timestamp: 2025-09-11T06:16:10.236Z
Learning: In Armbian board configuration files, WIP (Work In Progress) comments describe intended goals or planned features rather than current implementation state. For example, a comment like "WIP: current kernel" indicates that current kernel support is being worked toward, even if KERNEL_TARGET doesn't yet include "current".

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-09-11T06:12:54.213Z
Learnt from: SuperKali
PR: armbian/build#8609
File: config/boards/nanopi-r76s.conf:5-5
Timestamp: 2025-09-11T06:12:54.213Z
Learning: In the Armbian build system, board family configuration files (like config/sources/families/rk35xx.conf) can inherit kernel branch definitions from common include files (like config/sources/families/include/rockchip64_common.inc). Even if a branch like "edge" is not defined directly in the family conf file, it may be available through the sourced include file.

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-09-14T06:29:18.958Z
Learnt from: amazingfate
PR: armbian/build#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.

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-06-25T03:42:09.086Z
Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-08-21T08:10:59.502Z
Learnt from: leggewie
PR: armbian/build#8524
File: config/boards/orangepi2.csc:6-6
Timestamp: 2025-08-21T08:10:59.502Z
Learning: Not all Armbian boards support all kernel versions (legacy, current, edge). Some boards may only support specific kernel versions due to hardware limitations or lack of mainline support, which is why their KERNEL_TARGET contains only the supported options (e.g., just "legacy").

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-08-02T05:46:10.664Z
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the modern recommended approach for kernel configuration is to use the kernel-config command via "./compile.sh BOARD=boardname BRANCH=branchname kernel-config" instead of the deprecated KERNEL_CONFIGURE=yes flag. This provides a two-step workflow: configure using menuconfig, then build, with better transparency and control over configuration changes.

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-09-12T21:44:09.061Z
Learnt from: Grippy98
PR: armbian/build#8624
File: config/boards/sk-am62p.conf:8-8
Timestamp: 2025-09-12T21:44:09.061Z
Learning: For TI K3 family boards in Armbian, BOOT_FDT_FILE uses .dts extension (not .dtb) as the standard convention. The build system handles this correctly by automatically compiling .dts to .dtb during kernel build and using the BOOT_FDT_FILE value directly in bootloader configurations.

Applied to files:

  • config/boards/nanopi-m5.conf
📚 Learning: 2025-05-05T12:35:07.143Z
Learnt from: Grippy98
PR: armbian/build#8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.

Applied to files:

  • config/boards/nanopi-m5.conf

Set CONFIG_SOUND, CONFIG_SND, and CONFIG_SND_SOC to built-in (y)
to allow Rockchip audio drivers to be built-in instead of being
silently downgraded to modules by olddefconfig.
@SuperKali
Copy link
Member Author

@SuperKali SuperKali requested a review from a team as a code owner September 28, 2025 09:47
@github-actions github-actions bot added the BSP Board Support Packages label Sep 28, 2025
@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Sep 28, 2025
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 Sep 28, 2025
@SuperKali SuperKali merged commit 412f67c into armbian:main Sep 28, 2025
10 checks passed
@SuperKali SuperKali deleted the nanopi-m5 branch September 28, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth 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