Skip to content

Initial Support for Orange pi 5 pro board #8348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

c127dev
Copy link

@c127dev c127dev commented Jul 2, 2025

Description

Tested and Working:

  • Wireless & Bluetooth
  • USB 2.0 + USB 3.1
  • HDMI 2.1
  • Gigabit Ethernet (PCIe to RJ45 - Need drivers YT6801)
  • NVMe PCIe 2.0
  • MicroSD
  • Audio Controller es8388 - Audio Out
  • FAN PWM
  • LEDs PWM

Not Working:

  • Onboard Microphone
  • HDMI 2.0 (DP-HDMI) (rockchip,rk3588-dp No Driver)

Not Tested:

  • Camera 1,2
  • eMMC
  • VPU (Unable to test due to lack of VAAPI support)

Extras:

Gigabit Ethernet Driver

u-boot patch

  • 2024.04: It's the most Stable for Orange Pi 5 Pro

Test images

https://github.com/c127dev/build/releases/

How Has This Been Tested?

  • edge build

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

(All kernel and u-boot dependencies are included as patches in this PR)

c127dev and others added 2 commits July 2, 2025 14:48
Tested and Working:
Wireless & Bluetooth
USB 2.0 + USB 3.1
HDMI 2.1
Gigabit Ethernet (PCIe to RJ45 - Need drivers YT6801)
NVMe PCIe 2.0
MicroSD
Audio Controller es8388 - Audio Out
FAN PWM
LEDs PWM

Not Working:
Onboard Microphone
HDMI 2.0 (DP-HDMI - rockchip,rk3588-dp No Driver)

Not Tested:
Camera 1,2
eMMC
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

## Walkthrough

The changes update the Orange Pi 5 Pro board configuration to support both the vendor and edge kernel targets by modifying the `KERNEL_TARGET` variable. A new function, `post_family_config_branch_edge__orangepi5pro_use_mainline_uboot()`, is introduced to configure the board for mainline U-Boot usage, including setting specific boot variables and redefining U-Boot writing functions. Additionally, a new function `pre_customize_image__orangepi5pro_add_phy_driver()` automates the installation of an Ethernet PHY driver during first boot by preparing the image with necessary dependencies, driver package, and a systemd service to install the driver offline. The vendor U-Boot configuration function remains unchanged.

## Possibly related PRs

- armbian/build#8082: Adds a function for Orange Pi board mainline U-Boot configuration on the "edge" branch, including redefinitions for U-Boot writing functions.
- armbian/build#8275: Introduces multiple kernel target support and mainline U-Boot configuration for another board, with similar function additions and structure.

## Suggested labels

`Ready to merge`, `BSP`

## Suggested reviewers

- EvilOlaf
- igorpecovnik
- joekhoobyar

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4170d92 and 18f508e.

📒 Files selected for processing (1)
  • config/boards/orangepi5pro.csc (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/boards/orangepi5pro.csc
✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added size/large PR with 250 lines or more 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jul 2, 2025
@coderabbitai coderabbitai bot requested a review from chainsx July 2, 2025 20:25
@coderabbitai coderabbitai bot added 05 Milestone: Second quarter release Ready to merge Reviewed, tested and ready for merge labels Jul 2, 2025
@c127dev c127dev changed the title Orange pi 5 pro dev Initial Support for Orange pi 5 pro board Jul 2, 2025
@EvilOlaf EvilOlaf removed Ready to merge Reviewed, tested and ready for merge 05 Milestone: Second quarter release labels Jul 3, 2025
@EvilOlaf
Copy link
Member

EvilOlaf commented Jul 3, 2025

You could add a function to make ethernet make work out of the box.
Something like

function pre_customize_image__orangepi5pro_add_phy_driver() {
    display_alert "Adding ethernet driver" "${EXTENSION}" "info"
    chroot_sdcard apt-get update
    chroot_sdcard apt-get install dkms build-essential -y
    chroot_sdcard wget https://github.com/dante1613/Motorcomm-YT6801/raw/main/tuxedo-yt6801/tuxedo-yt6801_1.0.28-1_all.deb
    chroot_sdcard dpkg -i tuxedo-yt6801_1.0.28-1_all.deb

Probably also neet to set declare -g INSTALL_HEADERS="yes" since I guess they're needed.

c127dev and others added 2 commits July 3, 2025 15:07
Implemented a simple script to install the driver
during first boot using the installation headers
included in the image. Takes just a few seconds
on first boot.

Disclaimer: Attempted installation in a chroot env but failed.
@coderabbitai coderabbitai bot requested a review from EvilOlaf July 3, 2025 22:15
@coderabbitai coderabbitai bot added 05 Milestone: Second quarter release Ready to merge Reviewed, tested and ready for merge labels Jul 3, 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 (1)
config/boards/orangepi5pro.csc (1)

73-145: Ethernet driver automation addresses user feedback effectively.

This implementation successfully addresses EvilOlaf's suggestion to automate the YT6801 Ethernet driver installation. The approach is well-structured:

Strengths:

  • Pre-installs required dependencies (dkms, build-essential)
  • Uses offline installation approach to avoid network dependencies during first boot
  • Proper systemd service integration with self-disabling mechanism
  • Good error handling with dependency fix fallback

Areas for improvement:

  • Consider adding validation for the downloaded .deb file (checksum verification)
  • The hardcoded GitHub URL could be brittle if the repository changes

Consider adding file integrity verification:

    # Create directory and download .deb (Not installing due to chroot issue with dkms and kernel headers)
    chroot_sdcard mkdir -p /usr/local/share/eth-driver
    chroot_sdcard wget "https://github.com/dante1613/Motorcomm-YT6801/raw/main/tuxedo-yt6801/${deb_file}" -O "/usr/local/share/eth-driver/${deb_file}"
+   
+   # Verify download succeeded
+   if ! chroot_sdcard test -f "/usr/local/share/eth-driver/${deb_file}"; then
+       exit_with_error "Failed to download Ethernet driver package"
+   fi
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17ce2ea and 4170d92.

📒 Files selected for processing (1)
  • config/boards/orangepi5pro.csc (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
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.
Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.
Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.
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.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.
Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.
Learnt from: djurny
PR: armbian/build#8315
File: lib/functions/rootfs/distro-agnostic.sh:54-68
Timestamp: 2025-06-22T00:45:26.182Z
Learning: In Armbian build system, external command dependencies like envsubst are handled by adding the required packages (e.g., gettext for envsubst) to host_dependencies in adaptative_prepare_host_dependencies function in lib/functions/host/prepare-host.sh, rather than checking command availability at runtime.
Learnt from: EvilOlaf
PR: armbian/build#8298
File: extensions/https_proxy.sh:1-9
Timestamp: 2025-06-14T05:53:10.627Z
Learning: Armbian build framework extensions are NOT designed to run standalone but are called by the supervisor. The framework provides environment variables like USERPATCHES_PATH and SDCARD, and commands are executed with protection via run_host_command_logged and chroot_sdcard functions that use bash -e -o pipefail.
config/boards/orangepi5pro.csc (16)
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), 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.
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.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.
Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.
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.
Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.
Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.
Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:13-23
Timestamp: 2025-06-12T21:08:11.318Z
Learning: In config/bootscripts/boot-sunxi.cmd the variable name `align_overlap_oboe_avoidance` intentionally uses the acronym “OBOE” (Off-By-One Error); it is not a typo and should not be renamed.
Learnt from: Grippy98
PR: armbian/build#8202
File: config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh:2-3
Timestamp: 2025-05-16T15:34:34.672Z
Learning: The shell scripts in the Armbian build system's desktop configuration files, such as config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh, rely on environment variables like $SRC and $destination that are expected to be set externally before the script is executed.
Learnt from: djurny
PR: armbian/build#8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the `fdtfile` variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If `fdtfile` is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.
Learnt from: The-going
PR: armbian/build#8147
File: config/sources/families/include/sunxi64_common.inc:38-39
Timestamp: 2025-04-30T16:16:47.150Z
Learning: The Armbian build system references Linux kernel versions in the form "tag:v6.14.4" in the KERNELBRANCH variable, even when point release tags might not be directly visible in the upstream repository in the same form.
Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.
Learnt from: EvilOlaf
PR: armbian/build#8298
File: extensions/https_proxy.sh:1-9
Timestamp: 2025-06-14T05:53:10.627Z
Learning: Armbian build framework extensions are NOT designed to run standalone but are called by the supervisor. The framework provides environment variables like USERPATCHES_PATH and SDCARD, and commands are executed with protection via run_host_command_logged and chroot_sdcard functions that use bash -e -o pipefail.
Learnt from: djurny
PR: armbian/build#8315
File: lib/functions/rootfs/distro-agnostic.sh:54-68
Timestamp: 2025-06-22T00:45:26.182Z
Learning: In Armbian build system, external command dependencies like envsubst are handled by adding the required packages (e.g., gettext for envsubst) to host_dependencies in adaptative_prepare_host_dependencies function in lib/functions/host/prepare-host.sh, rather than checking command availability at runtime.
🔇 Additional comments (2)
config/boards/orangepi5pro.csc (2)

8-8: LGTM! Enables dual kernel support.

The change from "vendor" to "vendor,edge" properly enables support for both vendor and edge kernels as outlined in the PR objectives.


52-71: Mainline U-Boot configuration looks solid.

The function properly configures mainline U-Boot for the edge kernel branch with appropriate settings:

  • Uses stable v2024.04 tag as mentioned in PR objectives
  • Sets INSTALL_HEADERS="yes" which is crucial for driver compilation
  • Properly unsets existing functions before redefining them
  • The write_uboot_platform functions use correct mainline U-Boot binary names

@EvilOlaf
Copy link
Member

EvilOlaf commented Jul 4, 2025

Hm didn't expect not to work while building. Might be worth to dig a little deeper. Though if it works this way fair enough.

@c127dev
Copy link
Author

c127dev commented Jul 4, 2025

The Shellcheck job is failing on this PR due to the SC2148 error in the new orangepi5pro.csc file. The linter is treating it as a script but doesn't know the shell type. What is the standard practice in this project to resolve this? I considered adding a #!/bin/bash shebang, but I see other config files don't use one. Another option could be to disable the check for that line with # shellcheck disable=SC2148.

What would be the preferred way to proceed?

@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label Jul 5, 2025
@EvilOlaf
Copy link
Member

EvilOlaf commented Jul 5, 2025

I'd say ignore for now. This has never been an issue before...

The `eth-driver-firstboot.service` would sometimes fail on first boot with a "Resource temporarily unavailable" error. This happened when another process had a lock on `dpkg`.

To fix this, the installation script now waits for any `dpkg` locks to be released before attempting to install the driver package. It also includes a retry mechanism (3 attempts) in case of a transient failure.

This ensures the network driver is successfully installed, providing a better out-of-box experience.
@coderabbitai coderabbitai bot added BSP Board Support Packages Ready to merge Reviewed, tested and ready for merge labels Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release 08 Milestone: Third quarter release BSP Board Support Packages Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review 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