Skip to content

axera: toolchain-only configs for AX620E and AX620U - #2852

Merged
openipc-ai merged 2 commits into
masterfrom
axera-toolchain
Nov 14, 2026
Merged

openipc-ai merged 2 commits into
masterfrom
axera-toolchain

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Axera AX620E (aarch64, kernel 5.15) and AX620U (Cortex-A7, kernel 4.19) have no published OpenIPC toolchain. Until one exists, majestic can't be ported to either chip, and without majestic no Axera firmware image can build. Right now majestic.ax620e.lite.master.tar.bz2 and majestic.ax620u.lite.master.tar.bz2 both return 403 from S3.

This is the first slice of #2670, and it is the only part that can land without hardware:

  • ax620e_toolchain_defconfig / ax620u_toolchain_defconfig come from axera: AX620E and AX620U on OpenIPC's kernel, U-Boot and flash layouts #2670 unchanged, with authorship kept. They work like hi3519dv500_toolchain and build no image.
  • ci-matrix.py lists both in UNBUILT_BOARDS as toolchain configs.
  • toolchain.yml names them, so a dispatch publishes toolchain.axera-ax620e.tgz and toolchain.axera-ax620u.tgz.

Everything else in #2670 stays there: the lite defconfigs, kernel configs, osdrv packages, and the .ko files taken from factory firmware. Those wait for a camera and a majestic build.

Hardware tested on

None, and none applies. This adds no image and changes no shipped file. The two defconfigs only run in toolchain.yml, which produces the SDK tarball and nothing else.

Evidence

Both toolchains were built locally with make BOARD=<x>_toolchain toolchain:

aarch64-openipc-linux-musl_sdk-buildroot.tar.gz      106060317 bytes
  gcc 13.3.0, LINUX_VERSION_CODE 331695 (5.15.175)
  static C -> ELF 64-bit LSB executable, ARM aarch64; C++ links
arm-openipc-linux-musleabihf_sdk-buildroot.tar.gz     99457220 bytes
  gcc 13.3.0, LINUX_VERSION_CODE 267263 (4.19.255)
  static C -> ELF 32-bit LSB executable, ARM, EABI5; C++ links

Each binary ran under QEMU linux-user v10.2.0 (aarch64-linux-user / arm-linux-user, from the qemu-bench tree), with the CPU pinned to the target core. There was one static C program printing LINUX_VERSION_CODE and one C++ program using std::string and std::thread, the latter built both static and dynamic. The dynamic build ran against the SDK's own sysroot through -L:

$ qemu-aarch64 -cpu cortex-a53 t-aarch64              # static C
331695
$ qemu-aarch64 -cpu cortex-a53 s-aarch64              # static C++
cxx-thread-ok
$ qemu-aarch64 -cpu cortex-a53 -L <sysroot> d-aarch64 # dynamic C++, ld-musl-aarch64.so.1
cxx-thread-ok
$ qemu-arm -cpu cortex-a7 t-armhf
267263
$ qemu-arm -cpu cortex-a7 s-armhf
cxx-thread-ok
$ qemu-arm -cpu cortex-a7 -L <sysroot> d-armhf        # ld-musl-armhf.so.1
cxx-thread-ok
$ python3 .github/scripts/ci-matrix.py --self-test
ci-matrix: self-test ok (127 boards, 172 packages, 80 cases)
$ python3 .github/scripts/lint-workflow-shell.py
all run blocks parse clean

Note that ci-matrix.py is in the diff, so the selector builds the full matrix for this PR. That is intended.

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it. These are toolchain-only configs, built by toolchain.yml on dispatch and not by the board matrix, the same as hi3519dv500_toolchain.

dimerr and others added 2 commits November 14, 2026 06:07
Cut from #2670: only the two toolchain configs, which build a cross toolchain
and nothing else. aarch64 musl with 5.15 headers for AX620E, arm musleabihf
with 4.19 headers for AX620U. These are the kernel versions the deployed
firmware's modules carry in their vermagic. The board images, the osdrv
packages and the kernel configs wait for hardware and for a majestic build.
They build no image, so ci-matrix lists them in UNBUILT_BOARDS the same way
as hi3519dv500_toolchain. toolchain.yml now names them, so a dispatch
publishes toolchain.axera-ax620e and toolchain.axera-ax620u.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add toolchain-only builds for Axera AX620E and AX620U

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add AX620E and AX620U cross-toolchain configs so Axera software can be ported before firmware
 images exist.
• Register both configs for toolchain publishing while excluding them from firmware-image CI.
Diagram

graph TD
  Dispatch["Manual dispatch"] --> Select["Platform selection"] --> E["AX620E config"] --> SDK["SDK build"] --> Release["Toolchain releases"]
  Select --> U["AX620U config"] --> SDK
Loading
High-Level Assessment

The existing toolchain-only defconfig pattern fits this staged rollout: it allows SDK publication without requiring unavailable Axera firmware dependencies or adding image builds. Reusing the firmware-image path would couple toolchain availability to the blocked board bring-up.

Files changed (4) +70 / -0

Enhancement (2) +61 / -0
ax620e_toolchain_defconfigDefine the AX620E aarch64 toolchain +32/-0

Define the AX620E aarch64 toolchain

• Adds a toolchain-only Cortex-A53 musl config with GCC 13, C++ support, and 5.15 kernel-header selections. It defines no firmware variant or image.

br-ext-chip-axera/configs/ax620e_toolchain_defconfig

ax620u_toolchain_defconfigDefine the AX620U ARM hard-float toolchain +29/-0

Define the AX620U ARM hard-float toolchain

• Adds a toolchain-only Cortex-A7 musleabihf config with Thumb-2, NEON/VFPv4, C++ support, and 4.19 kernel-header selections. It defines no firmware variant or image.

br-ext-chip-axera/configs/ax620u_toolchain_defconfig

Other (2) +9 / -0
ci-matrix.pyExclude Axera toolchain configs from firmware-image CI +5/-0

Exclude Axera toolchain configs from firmware-image CI

• Adds both configs to UNBUILT_BOARDS with an explicit toolchain-only reason, satisfying matrix coverage without treating them as firmware images.

.github/scripts/ci-matrix.py

toolchain.ymlMake both Axera toolchains selectable for publication +4/-0

Make both Axera toolchains selectable for publication

• Adds AX620E and AX620U to the workflow's curated platform list so dispatches can build and publish their SDK archives.

.github/workflows/toolchain.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. AX620E SDK gets the wrong kernel headers 🐞 Bug ≡ Correctness
Description
ax620e_toolchain_defconfig requests 5.15 external headers, but general/toolchain.mk does not
translate that selection into the host-header setting used when it converts the config to a
Buildroot-built SDK. When make BOARD=ax620e_toolchain toolchain runs its second defconfig, the
5.15 SDK header selection is absent, so the published toolchain can use Buildroot's default headers
instead.
Code

br-ext-chip-axera/configs/ax620e_toolchain_defconfig[R28-29]

+BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_15=y
+BR2_KERNEL_HEADERS_5_15=y
Evidence
make toolchain invokes the conversion script and reruns Buildroot defconfig before building the
SDK. The script maps 5.10 and older external-header choices to host-header choices, but has no
branch for the newly requested 5.15 choice; retaining BR2_KERNEL_HEADERS_5_15 in the input does
not supply that missing host-header selection.

br-ext-chip-axera/configs/ax620e_toolchain_defconfig[24-29]
Makefile[145-153]
general/toolchain.mk[23-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The AX620E toolchain build does not carry its requested 5.15 headers into the generated SDK configuration.
## Fix Focus Areas
- br-ext-chip-axera/configs/ax620e_toolchain_defconfig[28-29]
- general/toolchain.mk[23-27]
## Recommended Fix
Add a 5.15 branch to the external-to-Buildroot header conversion that emits `BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y`. Verify the generated Buildroot configuration and SDK report 5.15 headers.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai

Copy link
Copy Markdown
Collaborator Author

On "AX620E SDK gets the wrong kernel headers": this doesn't happen.

For an internal toolchain, Buildroot picks headers from the BR2_KERNEL_HEADERS_* choice. The defconfig sets BR2_KERNEL_HEADERS_5_15=y for exactly that reason, the same pattern as hi3519dv500_toolchain with 5.10. BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_* only applies when headers come from a custom kernel tarball or version. A toolchain.mk branch for it would change nothing.

Here is the resolved config from make BOARD=ax620e_toolchain toolchain, after toolchain.mk has run:

BR2_TOOLCHAIN_BUILDROOT=y
BR2_KERNEL_HEADERS_5_15=y
BR2_DEFAULT_KERNEL_HEADERS="5.15.175"
BR2_TOOLCHAIN_HEADERS_AT_LEAST="5.15"
$ ls output/build | grep linux-headers
linux-headers-5.15.175

The packaged SDK's sysroot linux/version.h gives LINUX_VERSION_CODE 331695, which is 5.15.175. That is also the value the static test binary printed under qemu-aarch64, as shown in the PR description.

@openipc-ai
openipc-ai merged commit e02033e into master Nov 14, 2026
43 of 44 checks passed
@openipc-ai
openipc-ai deleted the axera-toolchain branch November 14, 2026 06:41
@dimerr dimerr mentioned this pull request Nov 17, 2026
6 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants