Repository navigation
Conversation
New chip-family skeleton following the usual br-ext-chip-<vendor> layout: defconfigs (lite + toolchain-only, aarch64 musl for AX620E's kernel 5.15.73, arm musleabihf for AX620U's kernel 4.19.125 -- both read directly off real deployed camera firmware, not the public vendor SDK which never shipped a kernel newer than 4.19), and axera-osdrv-* packages carrying the vendor's closed kernel modules (ax_sys/ax_pool/ ax_cmm/ax_proton/ax_npu/ax_venc/ax_vdec/... plus the Xiongmai Xm*.ko peripheral modules from the same firmware) with a load_axera script that insmods them in the real dependency order read from each module's own `depends=`. Each osdrv package's README documents exactly where its modules came from and why no public source exists for them at any kernel version. Board kernel .config files (board/ax620e/ax620e.lite.config etc.) don't exist yet -- they depend on the axera-ax620e / axera-ax620u kernel branches, still in progress.
ax620e_lite_defconfig/ax620u_lite_defconfig already referenced board/<family>/<family>.lite.config via BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE, but neither file existed -- a build would have failed copying the kernel config. Both kernel branches now build clean with real artifacts (openipc-linux-ax620e's Image, openipc-linux-ax620u's zImage), so copy their real working .config in as the referenced file and update the board READMEs from "scaffold/not started" to reflect that.
PR Summary by QodoAdd AX620E and AX620U board support and vendor module packages
AI Description
Diagram
High-Level Assessment
Files changed (66)
|
Code Review by Qodo
1.
|
|
The two toolchain configs from this PR are now in #2852, with your authorship kept, along with their CI registration. Once that merges, a The rest stays here, because none of it can land yet:
Which cameras did the IVG-A6 (AX620E) and the OS04A10 (AX620U) dumps come from? That is the hardware the module evidence has to come from. |
Cut from #2670: only the two toolchain configs, aarch64 musl with 5.15 headers for AX620E and armhf musl with 4.19 headers for AX620U. They are registered in ci-matrix as image-less configs and named in toolchain.yml, so a dispatch publishes toolchain.axera-ax620e and toolchain.axera-ax620u. The board images, osdrv packages and kernel configs stay in #2670 until a camera and a majestic build exist. Co-authored-by: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com>
- uImage of a multiplatform ARM kernel needs LOADADDR: 0x40008000, the
vendor FIT's own kernel load address (build failed: 'multiple (or no)
load addresses').
- build ax620u.dtb in-tree; nothing else produces the devicetree the
kernel cannot boot without.
- libcurl-openipc: the lite set every other lite board uses; with
EXTRA_PROTOCOLS_FEATURES left at its default, configure fails
('couldn't detect the LDAP libraries').
- majestic: majestic.ax620u.lite.master.tar.bz2 does not exist (403),
the download aborts the build.
ax_cmm without cmmpool= has no media memory at all; the stock loader (/usr/lib/modules/Load_AX620U) passes anonymous,0,<0x40000000+osmem>, <total-osmem>. Follow its order, take osmem from mem= and totalmem from the env (stock defaults 87M/256M), load the Xm* helpers the stock loadpublic loads, and leave out ax_audio and ax_pcal6416a, which oops in probe on the OpenIPC kernel (vendor struct layouts) and stall all CPUs. Verified in QEMU: 25 modules load from S70vendor at boot.
The near-allnoconfig config had no CONFIG_MODULES (the vendor modules cannot load at all), no networking, no sysfs/tmpfs, no MTD/SPI/UBI/ squashfs (no root filesystem), no 8250_dw, and Thumb-2 + PREEMPT_NONE where the vendor modules' vermagic is 'SMP preempt mod_unload ARMv7'. This adds those plus what the closed modules import (HIGHMEM, STACKPROTECTOR, DMA engine/virt-dma, ASoC, MMC/SDIO, pinctrl, debugfs, kernel-mode NEON) and CONFIG_AXERA_AX620U_COMPAT from the companion kernel patch.
- Kernel: OpenIPC/linux axera-ax620u rebased on Axera's SDK kernel (4.19.125 + Axera BSP + AX620U support); ax620u.lite.config is the stock camera kernel's own config on that tree, so the stock modules load unchanged. zImage + ax620u.dtb. - Layout as on the other NAND boards: one UBI partition with rootfs (UBIFS, kernel inside as /boot/fitImage from nand-fit.its) and rootfs_data (autoresize); ubinize-nand.cfg; package fitImage, rootfs.ubifs, rootfs.ubi (openipc.ax620u-nand-lite.tgz). mtdparts spi4.0_nand:1024k(spl),1536k(boot),512k(env),-(ubi): the vendor SPL keeps the first 1 MiB and loads U-Boot from 0x100000. - Booted by OpenIPC's AX620U U-Boot (u-boot branch openipc-ax620u). - mknand.py: whole-flash image (vendor SPL + U-Boot + rootfs.ubi).
On the SDK-based kernel their struct layouts match the vendor kernel's: all 28 load in the stock order (loadpublic: XmCommon, XmDemux, XmGpio; Load_AX620U; XmGpioI2c), XmIrCut last.
ipcinfo -v answers "axera" (devicetree root compatible, axera,ax620x is AX620U) instead of "generic". Carried as a package patch until ipctool has it.
- majestic: there is no majestic.ax620e.lite.master.tar.bz2 on the
release bucket (S3 answers AccessDenied, i.e. no such key; the
gk7205v200/t31 ones answer 206), so the download step stops the build.
Leave it out until an Axera majestic exists.
- libcurl-openipc: EXTRA_PROTOCOLS_FEATURES defaults to y and turns on
--enable-ldap, whose configure fails ("couldn't detect the LDAP
libraries"). Use the libcurl lines every other lite board carries.
The config was arm64 defconfig plus ARCH_AXERA: every other ARM64 platform (Tegra, QCOM, Rockchip, ...), 715 modules (47 MB in the rootfs), a 33.8 MB Image -- 4x the 16 MB flash before the rootfs. Drop the foreign ARCH_* platforms, PCI, DRM, sound, KVM, debug info and all modules; build in what the NOR camera needs to boot from flash: SPI_DESIGNWARE + SPI_DW_MMIO (the boot NOR), MTD_CMDLINE_PARTS (U-Boot passes mtdparts=), SQUASHFS_XZ (the rootfs is xz squashfs, it was off), JFFS2_FS and OVERLAY_FS (rootfs_data overlay), STMMAC + DWMAC_GENERIC (the EMAC). CC_OPTIMIZE_FOR_SIZE. Image 12.3 MB, 3.6 MB as LZMA. vermagic stays "5.15.73 SMP preempt mod_unload aarch64" (PREEMPT, MODULE_UNLOAD, no MODVERSIONS), which the vendor .ko require.
busybox insmod resolves no dependencies, and the order here broke four of them (modinfo depends=): ax_pool needs ax_cmm, ax_vpp needs ax_ivps, ax_gdc needs ax_ivps and ax_vpp, ax_tdp needs ax_vo. ax_cmm also needs cmmpool=: without it there is no pool for anything above it. Follow the stock IVG-A6 firmware instead (/usr/lib/modules/Load_AX620E and /usr/etc/loadpublic): XmCommon/XmDemux/XmGpio first, then sys, cmm (cmmpool=anonymous,0,<0x40000000 + mem=>,<totalmem - mem=>M), pool, base, npu, vo, ivps, vpp, gdc, tdp, venc, jenc, mipi_rx, proton, audio, vdec, then XmGpioI2c/XmIrCut. totalmem comes from the U-Boot env (default 256M, the stock script's TOTAL_MEM). -r unloads, -a reloads, anything else (S70vendor passes -i) loads.
The board built no DTB at all, and the only one in the kernel branch is
ax630c.dts, a NanoKVM-Pro HDMI box (LT6911, JD9853 panel, RGMII PHY).
The ax620e.dtsi has no node for the boot SPI NOR. repack then failed:
there is no images/uImage.
ax620e-xm-ipc.dts, from the stock IVG-A6 firmware's own DT:
- the SPI NOR at 0x1a00000 (CS GPIO2_29, jedec,spi-nor);
- internal EPHY over RMII (ethernet-phy-id0044.1400), resets dropped
(no reset-controller driver in the kernel branch yet: the probe would
defer forever);
- spin-table SMP at 0x23400dc and no PSCI node: this NOR profile has
no ATF (SPL -> DDRINIT -> U-Boot), nothing answers an SMC;
- 256 MB at 0x40000000; U-Boot passes mem= (osmem), the rest is CMM.
Image: the split NOR layout (post-image-split.sh) at 0x60000, after the
vendor spl (64K) + U-Boot (256K) + env (64K). Two fixes there for arm64:
- LZMA: this U-Boot's bootm has no gunzip ("Unimplemented compression
type 1"); BR2_OPENIPC_ARM64_UIMAGE_COMP selects lzma (default gzip).
- the multi-file format pads parts to 4 bytes, so the DTB can land on a
4-byte boundary; with fdt_high=0xffffffffffffffff (this U-Boot) it is
booted in place and arm64 Linux spins in setup_arch on the misaligned
FDT with no output. Pad the empty cpio to put the DTB on 8 bytes.
Kernel read size 6M: the uImage is 3.6M; U-Boot reads what its env says.
Verified in qemu-bench -M ax620e (flash-file= of the IVG-A6 dump with
this firmware.bin at 0x60000): U-Boot loads, LZMA-unpacks and boots the
kernel; both CPUs come up via spin-table.
The kernel branch now carries Axera's SDK drivers ported to 5.15.73 (clocks, pinctrl, GPIO, resets, the vendor SPI NOR driver + AX_DMAPER, EQOS + EPHY, watchdog reboot, the built-in OSAL with /proc/ax_proc, hwinfo/os_mem/hrtimer) and the Xiongmai IVG-A6 devicetree, axera/ax620e-xm-ipc.dts, rebuilt from the stock camera's own DT. Use both; the board-dir DTS (a cut-down copy that had to drop the resets) goes. ax620e.lite.config is the branch's ax620e_xm_ipc_defconfig: HZ=100, SMP, PREEMPT, KPROBES, unload, no modversions, as the closed ax_*.ko need; squashfs xz + jffs2 (xattr) + overlay on 64 KiB-erase MTD named spi_nor.0 (the label the vendor kernel and its mtdparts= use). Verified in qemu -M ax620e from the stock U-Boot (env from flash): both CPUs (spin-table), root from NOR through the vendor SPI driver, jffs2 overlay, DHCP and dropbear, S70vendor -> load_axera loads all 21 vendor modules with no oops (ax_vdec fails its probe on QEMU's missing decoder, as the stock firmware does), reboot through the watchdog. For a local kernel tree: make BOARD=ax620e_lite LINUX_OVERRIDE_SRCDIR=...
ipcinfo -v printed "unknown" on Axera boards, so S70vendor never ran load_axera. Detect the SoC from the root compatible (axera,ax620e; AX620U's devicetree says axera,ax620x) on both the 32-bit (AX620U) and the 64-bit (AX620E/AX630C) builds, and look for the sensor on the bus the boards use: i2c6 on the AX620E IPC (SC450AI at 0x30), i2c8 on AX620U. Build only that HAL into libipchw for the axera family.
Kernel 2M @0x50000 and rootfs 5M @0x250000 instead of the Xiongmai boot area's 0x60000: the board boots with OpenIPC's own U-Boot for it (the SDK U-Boot 2020.04, openipc_ax620e_nor_defconfig) behind the vendor SPL, which leaves boot 256K and env @0x40000 as on every OpenIPC NOR camera. The camera kernel drops KALLSYMS_ALL and IKCONFIG to keep the LZMA uImage (with its 137K devicetree) inside the 2M kernel slot, and gains /dev/mem for the vendor user-space libraries. Verified in qemu -M ax620e: vendor SPL -> OpenIPC U-Boot (first-start env save) -> kernel on both CPUs -> squashfs + jffs2 overlay, DHCP, load_axera with all 21 modules, fw_setenv extras reaching the next boot's command line through U-Boot, reboot via the watchdog.
The AX620E patch covers AX620U too (axera,ax620x maps to ax620u); the AX620U-only copy would fail to apply on top of it. Carried until OpenIPC/ipctool#290 is in a release.
ax620e_lite ships OpenIPC's fixed NOR slots (kernel 2M @0x50000, rootfs @0x250000) and its kernel has no mtdsplit, so post-image-split.sh's guard (from master) rightly refuses it. Move the arm64 multi-file uImage step into post-image-arm64-uimage.sh, which post-image-split.sh still runs first, and point ax620e_lite at it alone: the build now packages uImage and rootfs.squashfs as openipc.ax620e-nor-lite.tgz instead of a -split firmware.bin the kernel could not have booted.
ax620e_lite and ax620u_lite build against the kernels in OpenIPC/linux#259 and #260; the axera-ax620e/u branch tarballs CI downloads do not have them yet. List both boards in UNBUILT_BOARDS with that reason, their board directories in UNBUILT_FAMILIES and their osdrv packages in NOT_BUILT, so --self-test passes; they move into ALL_BOARDS once the kernels merge.
The modules sit under /lib/modules/<release>/axera, where Buildroot's depmod indexes them (21 and 28 entries in modules.dep), so load_axera now uses modprobe by module name. The stock order stays: ax_cmm has to be loaded with its cmmpool= before anything that depends on it. A failed load is logged and makes load_axera return non-zero. The READMEs state where the binaries come from, the vermagic and kernel config they bind to, and their declared licences.
Every NUL-separated compatible entry is read, the HAL is registered once under an __arm__/__aarch64__ guard, chip_generation is documented as 0. Diffed against the merge base e2ebc24; applies to ipctool master.
|
Thanks for the review. Pushed
Also in this push:
|
|
Follow-up on the re-review at 837f87c (no new findings; 1, 4, 12, 13 resolved):
|
… env (#342) The AX620E SPI-NOR model answers reads of the U-Boot env window with a synthetic env (what the stock Xiongmai firmware needs to boot). OpenIPC firmware, with its own U-Boot and 'fw_setenv', needs the env it wrote to the flash file back. -global axera-spi-nor.env-from-flash=on serves the flash contents there; off by default, so the stock dumps boot as before. Used to boot OpenIPC's AX620E image (OpenIPC/firmware#2670).
Their kernels are on OpenIPC/linux axera-ax620e (#259) and axera-ax620u (#260) now, and toolchain.axera-ax620{e,u} are published, so the images build in CI like every other board: both join ALL_BOARDS, the axera family and its osdrv packages leave the unbuilt lists, and ax620u_lite (an all-in-UBI NAND image) joins SMOKE_BOARDS so the vendor has cover.
The ISP bins, sensor library and AI-ISP models the stock App runs each camera's sensor with: SC450AI on the Xiongmai IVG-A6 (AX620E), OS04A10 on the JFtech IPC_AX620U_A8 (AX620U). Without a bin, AX_ISP_LoadBinParams leaves the ISP on the sensor driver's defaults, so any streamer on these cameras needs them. Bins go to /etc/sensors, libsns_<sensor>.so to /usr/lib/sensors, as in the other vendors' osdrv packages, filtered by BR2_OPENIPC_SNS_MODEL when a board sets it. The bins and libsns name AI-ISP models by the stock path /mnt/custom/ai_isp/<name>; the models go to /etc/sensors/ai_isp and that path links there. AX620U (NAND) ships its three models; AX620E's 1.3 MB model (rootfs 2948 KB -> 4460 KB of the 5 MB NOR slot) is behind BR2_PACKAGE_AXERA_OSDRV_AX620E_AI_ISP, off by default.
|
aedb3ee adds the image tuning each camera's stock firmware runs its sensor with. Any streamer that drives Axera's ISP on these cameras needs it, not just the stock App: without a bin,
The package READMEs give provenance, sizes and the stock-to-OpenIPC path mapping. Both boards were rebuilt with the kernels from OpenIPC/linux and booted in QEMU. The installed files have the stock md5s; |
|
Pushed
Matrix (
CI is green: 163 checks pass, including both Axera boards. The six ssc377/ssc378 boards no longer fail "size exceeded". #2910 fixed that on master, and it is merged in here. |
Summary
Axera AX620E (2x Cortex-A53, kernel 5.15.73, SPI NOR) and AX620U (4x Cortex-A7, kernel 4.19.125, SPI NAND) camera support:
br-ext-chip-axeraboards, defconfigs, kernel configs/devicetrees, andaxera-osdrv-ax620e/axera-osdrv-ax620upackages carrying the vendor media modules with aload_axerathat loads them as the stock firmware does.Both images follow OpenIPC's standard flash layouts and boot with OpenIPC's own U-Boot (no vendor bootloader beyond the DDR-init SPL the boot ROM loads):
axera-ax620e(Axera's drivers ported from the SDK to 5.15.73 incl. the OSAL the vendor modules need).board/ax620u/nand-fit.its+ubinize-nand.cfg: UBIFSrootfswith the kernel as/boot/fitImage, autoresizerootfs_data;openipc.ax620u-nand-lite.tgz); kernel = OpenIPC/linuxaxera-ax620u(Axera's SDK 4.19.125 kernel + AX620U support).Also: the build fixes a first full buildroot build needed (libcurl options as on other lite boards; kernel image load address/devicetree), majestic disabled for now (there is no Axera majestic build yet), and an ipctool Axera HAL patch so the vendor init runs
load_axera(carried until OpenIPC/ipctool#290 is in a release).Depends on
axera-ax620e) and axera: AX620U on Axera's SDK kernel (4.19.125), all vendor media modules load linux#260 (AX620U kernel →axera-ax620u) — the build downloads those branches.Test plan (OpenIPC/qemu-bench
ax620e/ax620umachines; real hardware pending)Built at 837f87c with
LINUX_OVERRIDE_SRCDIR= the OpenIPC/linux#259 / #260 heads, then booted from whole-flash images (vendor SPL + OpenIPC U-Boot + this build's images, env blank):make BOARD=ax620e_lite→openipc.ax620e-nor-lite.tgz(uImage 1960K/2048K, squashfs 3692K);make BOARD=ax620u_lite→openipc.ax620u-nand-lite.tgz.rootfs_dataon/overlay→ first login sets the password;ipcinfo -v/-c/-f=axera/ax620e/ax620e;S70vendor→load_axera(modprobe): 21/21 modules loaded, no failure logged, no oops; a file in/etcand the password survive a reboot./boot/fitImagefrom UBIFS → 4.19.125 on 4 CPUs, UBIFSrootfs_dataon/overlay→ first login;ipcinfo=axera/ax620u/ax620u; 28/28 modules loaded, no oops; persistence across reboot as above.ci-matrix.py --self-testok (both boards in UNBUILT_BOARDS until linux#259/Uboot-env integration in Busybox #260 merge).axera-ax620e/axera-ax620u(no override):make BOARD=ax620e_lite→ squashfs 2948K (4460K withBR2_PACKAGE_AXERA_OSDRV_AX620E_AI_ISP=y, off by default),make BOARD=ax620u_lite→ rootfs.ubi 18432K/24576K. Booted both in QEMU: the 6 SC450AI / 8 OS04A10 bins in/etc/sensorsand the 3 AX620U.promodels in/etc/sensors/ai_isp(also through/mnt/custom/ai_isp) have the stock files' md5s;libsns_*.soin/usr/lib/sensorsdiffers from stock only by the.commentsection Buildroot's strip drops; still 21/21 and 28/28 modules loaded, no oops. AX620E option toggled on and off in one build dir: model and link appear, then are removed.