Skip to content

orangepi4pro: Add community support for Orange Pi 4 Pro (Allwinner A733) [new files only]#9967

Open
shkolnik wants to merge 13 commits into
armbian:mainfrom
shkolnik:orangepi-4-pro
Open

orangepi4pro: Add community support for Orange Pi 4 Pro (Allwinner A733) [new files only]#9967
shkolnik wants to merge 13 commits into
armbian:mainfrom
shkolnik:orangepi-4-pro

Conversation

@shkolnik

@shkolnik shkolnik commented Jun 11, 2026

Copy link
Copy Markdown

Hi friends - I wanted to use Armbian on my new Orange Pi 4 Pro and found it wasn't supported yet, so I put together this board support package. I have been using it successfully on my device for a few days now, including with booting from an installed NVMe SSD.

This is my first contribution to Armbian so please let me know if there is anything you want me to revise to stay consistent with the project norms and guidelines.

Thanks!

-James

Description

Adds community-supported (.csc) board config for the Orange Pi 4 Pro, a new Allwinner A733 (sun60iw2) SBC with no prior Armbian support. Target is a headless Debian Trixie server on Orange Pi's vendor BSP 6.6 kernel (single branch: vendor).

The change is purely additive — 9 new files, no existing files modified — so it cannot affect any other board:

  • config/boards/orangepi4pro.csc — board config (device tree, DRAM-blob fetch, bootloader write offsets)
  • config/sources/families/sun60iw2.conf — new A733 SoC family: fetches + builds the vendor U-Boot, packs the boot images, sets the kernel source/branch/config, and ships Orange Pi's bsp/ headers in the linux-headers package (so out-of-tree modules can build)
  • config/kernel/linux-sun60iw2-vendor.config — vendor 6.6 kernel config (Orange Pi's, adopted verbatim)
  • config/bootscripts/boot-sun60iw2.cmd, config/bootenv/sun60iw2.txt — boot script/env
  • patch/kernel/archive/sun60iw2-opi-vendor/ — 4 small DT cleanups (model string; disable unpopulated UFS / AXP515 BMU / AC101 audio)

Dependencies

  1. https://github.com/orangepi-xunlong/u-boot-orangepi.git @ b791be842935b27268ae3d00e943a9075495f30a
  2. https://github.com/orangepi-xunlong/orangepi-build @ 7f776a209b72b92e8c6a06abc83b1e7597eef5af

Bootloader Notes:

  • A working bootloader needs Orange Pi's vendor fork of U-Boot (v2018.05-based, 32-bit), never merged upstream. - BOOTSOURCE/BOOTBRANCH are pinned to the vendor commit.
  • The vendor tree needs a few build-host accommodations, applied via standard Armbian hooks: compatibility CFLAGS for newer toolchains (post_config_uboot_target), a PWD fix for the env -i make (uboot_make_config), and the Allwinner pack tools (x86-only) run under qemu-x86_64-static.
  • uboot_custom_postprocess packs the built U-Boot into boot0_*.fex / boot_package.fex with Orange Pi's pack tooling; the per-board DRAM-init blobs are fetched at build time by fetch_custom_uboot__orangepi4pro.
  • Nothing binary is committed to the tree — U-Boot is built from source; the only blobs (boot0 / DRAM init) are fetched from Orange Pi's pinned repo during the build.

Context / discussion: https://forum.armbian.com/topic/55919-35-orange-pi-4-pro

[GitHub issue] reference: N/A (no open issue found)
[Jira] reference number: N/A

What is not included?

Targeted at CLI / headless-server use. The following A733 features are not supported in this config — none are regressions, all are low-priority for the headless target, and they can land in later iterations:

  • GPU 3D acceleration (PowerVR) — the userspace driver is proprietary and non-redistributable, so it can't ship in the image. Display output (HDMI / framebuffer console) works; accelerated GL/Vulkan does not.
  • NPU (3 TOPS) — no open userspace.
  • Hardware video decode/encode (VPU) — same non-redistributable-userspace situation; not in the base image.
  • USB-C OTG (USB 2.0) — power-in works; OTG role/ID detection fails to probe at boot (otg manager: probe of 10.usbc0 failed), so dual-role / USB-gadget use is non-functional.

How Has This Been Tested?

Built a Trixie CLI image from a clean cache (Docker, arm64 host). Flashed and booted on hardware:

  • Boots to CLI from SD (serial ttyS0 + SSH)
  • Gigabit Ethernet (YT8531C) — load-tested ~900 Mbit/s sustained
  • M.2 NVMe (PCIe 3.0) — detected, formatted, read/write
  • WiFi 6 + Bluetooth (AIC8800D80; in-tree modules + armbian-firmware)
  • Audio (3.5 mm ES8389 + HDMI)
  • SPI-NOR + NVMe boot via armbian-install ("Boot from MTD Flash") — boots from NVMe with SD removed; SD-first override confirmed

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

Summary by CodeRabbit

  • New Features

    • Orange Pi 4 Pro board support, including a new board-specific boot script and headless-friendly boot defaults.
  • Improvements

    • Boot environment defaults: lower verbosity, dual console, boot logo enabled.
    • Device tree: human-readable model name; unused UFS, battery-management and unpopulated audio nodes disabled.
    • Family defaults for Allwinner sun60iw2 to streamline builds.
    • Wi‑Fi/BT module support declared.
  • Stability

    • Build-time vendor boot image generation and flashing helpers added.

@shkolnik shkolnik requested a review from igorpecovnik as a code owner June 11, 2026 15:36
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Orange Pi 4 Pro support: sun60iw2 family config, board metadata and post-tweaks, bootenv and U-Boot boot script, four device-tree patches, and a pinned vendor U-Boot builder that emits vendor .fex boot artifacts.

Changes

Orange Pi 4 Pro Board Support

Layer / File(s) Summary
SoC Family Foundation
config/sources/families/sun60iw2.conf
Establishes sun60iw2 family defaults (ARCH, LINUXFAMILY, ATF_COMPILE, KERNEL_BTF, INSTALL_HEADERS), sets BOOTENV_FILE/OVERLAY_DIR, and adds write_uboot_platform() and write_uboot_platform_mtd() for SD/eMMC and SPI NOR programming.
Boot Environment and Script
config/bootenv/sun60iw2.txt, config/bootscripts/boot-sun60iw2-opi.cmd
Adds bootenv defaults (verbosity=1, console=both, bootlogo=true) and a U-Boot boot script that loads armbianEnv.txt, derives PARTUUID rootdev, builds bootargs (with optional Docker cgroup tuning), loads uInitrd/Image/DTB, applies kernel and user DT overlays, and boots via booti.
Board Metadata and Configuration
config/boards/orangepi4pro.csc
Declares Orange Pi 4 Pro board metadata and build variables: kernel source/branch/patch dir, boot script, initrd arch, serial console, offsets, headless/desktop flags, and supported AIC8800 WiFi/BT modules.
Post-family Tweaks & Host Dependencies
config/boards/orangepi4pro.csc
Adds post_family_tweaks__orangepi4pro() to append minimal boot args, create aic8800D80 firmware symlink (or warn), and install mtd-utils into target rootfs; adds add_host_dependencies__orangepi4pro_uboot_xxd() to require xxd on the build host.
Custom U-Boot Builder
config/boards/orangepi4pro.csc
Implements build_custom_uboot__orangepi4pro() which validates inputs, checks host tools/QEMU, shallow-clones pinned Orange Pi u-boot and packaging repos, cross-compiles U-Boot for AArch32 (with native dtc rebuild fallback), runs vendor packaging to produce boot0_sdcard.fex, boot0_spinor.fex, and boot_package.fex, verifies outputs, and marks success via EXTENSION_BUILT_UBOOT="yes".
Device Tree Patches
patch/kernel/archive/sun60iw2-opi-vendor/*
Adds four DTS patches: set device-tree model to "Orange Pi 4 Pro", disable UFS controller, disable AXP515 PMIC BMU node, and disable unpopulated AC101 audio machine node.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • armbian/build#9879: Related handling of aic8800D80 SDIO firmware path and aic8800 firmware setup across boards.

Suggested labels

BSP

Suggested reviewers

  • igorpecovnik
  • JohnTheCoolingFan
  • SuperKali
  • Tonymac32
  • joekhoobyar
  • paolosabatino
  • catalinii

Poem

🐰 I hopped through scripts, patches, and tree,
I linked firmwares where they ought to be,
Built U‑Boot with careful art,
Tweaked DTs to spare the start,
Now Armbian wakes on Orange Pi with glee.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding community support for a new Orange Pi 4 Pro board configuration, including the SoC identifier (Allwinner A733) and scope indicator '[new files only]'.
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

Copy link
Copy Markdown
Contributor

Hey @shkolnik! 👋

Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡
Your effort doesn’t just improve Armbian — it benefits the entire community of users and developers.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀

@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 Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for orangepi4pro
    • Expected: board-images/orangepi4pro.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

@shkolnik shkolnik changed the title orangepi4pro: Add community support for Orange Pi 4 Pro (Allwinner A733 based) orangepi4pro: Add community support for Orange Pi 4 Pro (Allwinner A733) [new files only] Jun 11, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 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 `@config/boards/orangepi4pro.csc`:
- Around line 226-227: The final U-Boot output validation only checks
boot_package.fex and boot0_sdcard.fex; update the condition that currently tests
"[[ -f "${out_dir}/boot_package.fex" && -f "${out_dir}/boot0_sdcard.fex" ]]" to
also require "${out_dir}/boot0_spinor.fex" so the check verifies all three
artifacts (boot_package.fex, boot0_sdcard.fex, boot0_spinor.fex) before calling
exit_with_error; this keeps the validation consistent with the earlier
three-file check and ensures write_uboot_platform_mtd() has the required
boot0_spinor.fex.
🪄 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: 902ef391-59ee-4084-a0a9-b740d7d9a998

📥 Commits

Reviewing files that changed from the base of the PR and between bc21db1 and 8689e46.

📒 Files selected for processing (9)
  • config/boards/orangepi4pro.csc
  • config/bootenv/sun60iw2.txt
  • config/bootscripts/boot-sun60iw2-opi.cmd
  • config/kernel/linux-sun60iw2-opi-vendor.config
  • config/sources/families/sun60iw2.conf
  • patch/kernel/archive/sun60iw2-opi-vendor/0001-orangepi4pro-set-model-string.patch
  • patch/kernel/archive/sun60iw2-opi-vendor/0002-orangepi4pro-disable-unused-ufs.patch
  • patch/kernel/archive/sun60iw2-opi-vendor/0003-orangepi4pro-disable-axp515-bmu.patch
  • patch/kernel/archive/sun60iw2-opi-vendor/0004-orangepi4pro-disable-unpopulated-ac101-audio.patch

Comment thread config/boards/orangepi4pro.csc Outdated
@shkolnik

Copy link
Copy Markdown
Author

Added the board assets here: armbian/armbian.github.io#330

Comment thread config/bootenv/sun60iw2.txt Outdated
Comment thread config/boards/orangepi4pro.csc Outdated
@EvilOlaf

Copy link
Copy Markdown
Member

this needs to be looked at more careful. I find this code quite confusing, last but not least due to tons of comments (which could also be in commit messages).
From my guts feel lots of the custom uboot code could be placed in family config since I believe the majority of code can be shared across the whole soc family while the boards itself only need minimal adjustments, like defconfig.
Also quite ridiculous to see an uboot from 2018 in 2026 for a brand new soc family (again...). But well, orangepi keeps doing orangepi things as we're already used to.

Comment thread config/boards/orangepi4pro.csc Outdated
@shkolnik

Copy link
Copy Markdown
Author

@EvilOlaf Thanks for reviewing. I pushed a commit that attempts to improve the readability by reducing excessive comments and eliminating the HEREDOC. Let me know if this is a bit better.

I agree it's crazy to see this super old U-Boot code used for a board that was just released. I'm just trying to leverage what they provided (however ancient) to be able to boot Armbian.

Regarding the U-Boot board vs. family consideration... I'm not 100% sure but I don't think the currently available U-Boot tooling works consistently across the SoC family in a typical way.

https://github.com/NickAlilovic/build/tree/Radxa-A7A
I looked at this WIP to add support for Radxa Cubie A7A and found that Radxa also releases their own U Boot fork but as a .deb pacakge.

As far as I can tell The resulting bootloaders aren't interchangeable. Allwinner's boot0 carries board-specific DRAM training, and the two boards use different PMICs (OPi AXP8191 vs Radxa AXP318W), so Radxa's bootloader probably wouldn't bring up DRAM / power correctly.

I wanted to share this additional context, but If you prefer it I can still move all the custom U boot stuff into the sun60iw2 family file, since there's only one sun60iw2 board at this time. If or when another board is added then the family file can be adapted as needed to support it.

Just let me know!

@EvilOlaf

Copy link
Copy Markdown
Member

I be totally honest. For my guts feel this is too messy to have it in the framework as it is. Others may disagree with my opinion. In any case this is not your fault. As you said you try to use what is there in some way and I get that.

My suggestion would be to (try to) collaborate with nicka since he's being messing with the radxa equivalents for quite a whole to perhaps get A733 stuff unified in a more pretty way, less quirks.

@shkolnik

Copy link
Copy Markdown
Author

Thanks @EvilOlaf — I completely understand the desire to keep things clean and share as much build configuration as possible among boards in the same family. The vendor support for A733 boards is genuinely quirky and I'm not going to pretend it's elegant.

On coordinating with @NickAlilovic — I don't want to dismiss the idea, but I'd gently push back on it as the path for this PR. My goal here is deliberately narrow: get one minimal, working board (OPi 4 Pro) into people's hands now. I think that is more achievable if kept decoupled from Nick's effort, which is much larger and headed in a somewhat different direction (mainline-kernel carrying out-of-tree GPU/NPU patches). And I don't think coordinating would actually change the thing that makes this quirky: each vendor ships its own kernel and its own U-Boot fork, and those can't be unified (different boot0/DRAM, different PMICs). The quirk is inherent to the vendor stack, not to how this is organized — so a joint effort wouldn't make it less quirky, it'd mostly make it bigger and slower. I did try to leave room for convergence later: another A733 board can be added with its own vendor tooling without touching sun60iw2.conf, and if the open-stack work matures the family can absorb whatever becomes common.

On the "in the framework as it is" concern — I submitted this as a community (.csc) board precisely because it's vendor-dependent and not yet ideal. It's purely additive (9 new files, nothing existing changed), works with the standard hooks so caching and CI behave normally, and can't affect any other board.

I'd genuinely welcome concrete changes if there are specific ones that would help, and since you mentioned others might see it differently, I'm glad to hear the rest of the team's take too. I just want to find a path that lets people run Armbian on these devices today.

Thanks!

-James

@shkolnik

Copy link
Copy Markdown
Author

@EvilOlaf Good news, it looks like you were right and quite a bit more can be shared between the boards in the family! Please let me know if this appears to be moving in the right direction.

Shared (family):

Orange Pi's vendor U-Boot fork (fetch + build + Allwinner pack), the vendor 6.6 kernel source/branch/defconfig, boot env, and rootfs tweaks.

Per board:

device tree, kernel patch dir, the DRAM blobs (boot0 + sys_config), and SD boot offsets — each board fetches its own blobs in fetch_custom_uboot.

Details:

@NickAlilovic pointed me to this project by @dok2d that uses Orange Pi's vendor tools to build a (non-Armbian) Debian Trixie for the Radxa Cubie a7z: https://github.com/dok2d/cubie-a7z-debian.

That showed the OPi U-Boot fork can produce a working bootloader for both boards given each board's boot blobs, and the OPi kernel fork builds for the Cubie once patched with its device tree.

I didn't/don't have a Cubie device available to verify compatibility with the Orange Pi tooling, but using the @dok2d project as a reference for a working build on Cubie I was able to put together a strawman PR supporting both boards with a majority of functionality in the family file.

I am not including the Cubie configuration in this PR both because it has not been tested on hardware and to keep scope tight, but I thought it was a worthwhile exercise to put together and see what needed to vary board-to-board. That WIP is here (for reference): https://github.com/shkolnik/armbian-build/pull/5/changes

I ordered a Cubie a7z from Aliexpress to test, but no idea when that will actually reach me. I will post in the forums as well and see if someone wants to try it out while I'm waiting. I did flash and test these latest changes on my Orange Pi 4 Pro successfully.

@ijiki16

ijiki16 commented Jun 17, 2026

Copy link
Copy Markdown

I tested this and was able to boot image on my OPI 4 Pro

Screenshot 2026-06-18 at 00 23 51

About OPi AXP8191 vs Radxa AXP318W I think they are same: Sunxi Linux AXP wiki, Thats why it worked for Radxa boards too.

About GPU can't we use same hack as for OrangePi Zero 3W?

@shkolnik

Copy link
Copy Markdown
Author

@ijiki16 that's great, thanks for testing! I'll look at adding in the GPU hack you linked in another branch (just to keep this branch/PR stable for review).

Comment thread config/sources/families/sun60iw2.conf Outdated
Comment thread config/sources/families/sun60iw2.conf Outdated
@EvilOlaf

Copy link
Copy Markdown
Member

looks overall cleaner. Still wild but good for now

shkolnik added 5 commits June 17, 2026 23:29
…urfaced an issue where the default boot address layout in OPi's configuration is cramped and only allows for kernels up to ~30Mb, causing the device to fail to boot. This change spaces the boot addresses out so we can boot larger (but still completely reasonable) kernels.
@shkolnik

Copy link
Copy Markdown
Author

Thanks @EvilOlaf!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third 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.

3 participants