Skip to content

Conversation

SuperKali
Copy link
Member

Description

This PR adds initial support for the NanoPi M5 board based on the Rockchip RK3576 SoC. The implementation includes U-Boot device tree support and Armbian board configuration for a complete working system.

Summary of changes:

  • U-Boot Device Tree: Added rk3576-nanopi-m5.dts with hardware initialization for all major components
  • U-Boot Config: Added nanopi-m5-rk3576_defconfig with optimized build configuration
  • Board Configuration: Added Armbian board file for NanoPi M5 with RK35xx family integration

Hardware features enabled:

  • PCIe support with M.2 connector power control via GPIO
  • SPI NOR flash (SFC1) support for bootloader storage
  • SD card support for primary boot and storage
  • NVMe support via PCIe M.2 slot
  • GPIO-based system LED control
  • Debug UART support (ttyS0 at 1.5M baud)
  • Multiple boot sources (SD card, SPI NOR flash, NVMe drives)

Note: UFS support is compiled but disabled in device tree due to vendor U-Boot compilation issues. Will be enabled when resolved. look here #8647

How Has This Been Tested?

The implementation has been tested with the following configurations:

  • SD Card Boot Test: Successfully boots from SD card with full desktop environment
  • SPI Flash Boot Test: U-Boot loads from SPI NOR flash, boots kernel from SD/NVMe
  • NVMe Boot Test: Complete boot chain from NVMe drive via PCIe M.2 slot

Test Configuration:

  • Board: NanoPi M5 with 16GB RAM
  • Storage: 32GB SD card, 256GB NVMe SSD, 16MB SPI NOR flash
  • OS: Armbian Trixie with vendor kernel
  • Network: Both Ethernet ports tested, WiFi module verified

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 19, 2025

Walkthrough

Adds a new board configuration file config/boards/nanopi-m5.conf for the NanoPi M5 (Rockchip RK3576). Declares board metadata and boot parameters (BOARD_NAME, BOARDFAMILY=rk35xx, BOOTCONFIG, KERNEL_TARGET=vendor, FULL_DESKTOP, BOOT_LOGO, BOOT_FDT_FILE, BOOT_SCENARIO, SERIALCON, BOOT_SUPPORT_SPI, BOOT_SPI_RKSPI_LOADER, IMAGE_PARTITION_TABLE=gpt, BOARD_MAINTAINER). Adds post_family_tweaks__nanopi-m5_naming_audios() which logs an info message, ensures SDCARD/etc/udev/rules.d exists, writes two udev rules to name HDMI and RT5616 audio devices, and returns success.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • prahal
  • rpardini
  • ginkage
  • krachlatte
  • amazingfate
  • igorpecovnik
  • catalinii
  • Tonymac32
  • HeyMeco
  • chainsx
  • efectn
  • schwar3kat

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "add initial support of NanoPi M5" is concise and accurately summarizes the primary change of adding NanoPi M5 board support (board config, U-Boot DTS, and defconfig). It directly reflects the changeset and is clear to reviewers scanning the PR list. Minor wording could be improved for style but it correctly describes the main change.
Description Check ✅ Passed The PR description is detailed and directly related to the changeset, documenting added U-Boot device tree and defconfig files, the Armbian board configuration, enabled hardware features, testing performed, and a known limitation (UFS disabled due to vendor U-Boot issues). It provides sufficient context for reviewers to understand scope and verification steps. Therefore it meets the lenient criteria for passing the description check.
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

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 11 Milestone: Fourth quarter release size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Sep 19, 2025
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)
config/boards/nanopi-m5.conf (2)

17-17: Consider using more specific function naming.

The function name uses "nanopi-m5" which works but could be more consistent with board naming patterns in Armbian. However, this is functional and readable.


5-5: Confirm: 'current' and 'edge' are supported via rockchip64_common.inc.

config/sources/families/rk35xx.conf sources config/sources/families/include/rockchip64_common.inc, which defines the "current" and "edge" branches (sets LINUXFAMILY / LINUXCONFIG / KERNEL_MAJOR_MINOR). KERNEL_TARGET="vendor" is correct; update or remove the "WIP: current, edge kernel" comment in config/boards/nanopi-m5.conf if it implies those branches are unavailable.

📜 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 0567f2a and d00cb14.

📒 Files selected for processing (1)
  • config/boards/nanopi-m5.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.842Z
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: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.842Z
Learning: In Armbian board configuration files, .wip and .conf extensions require BOARD_MAINTAINER to be present and contain at least one maintainer. If no maintainer is present, the board support rules state it does not qualify for standard support and must be moved to community support (.csc extension). This is documented at https://docs.armbian.com/User-Guide_Board-Support-Rules/
📚 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-18T03:36:17.842Z
Learnt from: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.842Z
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).

Applied to files:

  • config/boards/nanopi-m5.conf
🔇 Additional comments (3)
config/boards/nanopi-m5.conf (3)

1-1: LGTM! Header follows Armbian standards.

The hardware description is comprehensive and follows the established pattern for Armbian board configuration files with SoC details, core count, RAM options, and key features.


2-14: Board configuration looks well-structured.

The board configuration follows Armbian conventions with appropriate values for the RK3576 SoC. The WIP comment on Line 5 correctly indicates that current/edge kernel support is planned but not yet implemented.


17-24: Audio naming function implemented correctly.

The function properly creates udev rules to provide descriptive names for HDMI and RT5616 audio devices. The implementation follows good practices with proper directory creation and file handling.

@SuperKali
Copy link
Member Author

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Sep 20, 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 20, 2025
@SuperKali SuperKali merged commit 48114ee into armbian:main Sep 20, 2025
11 checks passed
@SuperKali SuperKali deleted the nanopi-m5 branch September 20, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth 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.

2 participants