Skip to content

axera: AX620U on Axera's SDK kernel (4.19.125), all vendor media modules load - #260

Merged
dimerr merged 29 commits into
axera-ax620ufrom
axera-ax620u-sdk
Nov 18, 2026
Merged

dimerr merged 29 commits into
axera-ax620ufrom
axera-ax620u-sdk

Conversation

@dimerr

@dimerr dimerr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Replaces the minimal vanilla-4.19.125 AX620U bring-up with Axera's own SDK kernel (4.19.125 — exactly the version the AX620U camera's vendor media modules are built against) plus AX620U camera support. On the old branch there was no Axera clock, SMP, OSAL or driver support, so none of the vendor ax_*.ko could run; on this one all of them load.

What's in it

  • import the Axera AX620E SDK kernel — Axera's tree as shipped, so that commit is Axera's diff against upstream 4.19.125 (reviewable on its own).
  • Build it standalone, with the OSAL in-tree (drivers/soc/axera/osal); board pinmux tables behind an option; upstream .dtb rules restored for buildroot; a 64-bit modulo link fix in uvc_video.
  • AX620U (axera,ax620x) camera support: devicetree from the stock camera's FIT; a fixed-rate clock provider (clk-ax620u); the axera,ax620x-smp enable-method on the SDK's SMP code (all 4 CPUs); the AX620U modules' ax_printk/ax_vprintk convention plus ax_special_rtc_lock/unlock, read_adc_value (AXERA_AX620U_COMPAT); axera_ax620u_defconfig (the stock camera's config on this tree).
  • mtd: name a device after its devicetree label (keeps the stock spi4.0_nand mtd id); loop devices; AXI DMAC probes with an optional reset and allows AX620U's 2 channels; the SDK PWM driver binds axera,ax620x-pwm (the vendor App segfaults on a missing pwmchip).
  • A merge with the old axera-ax620u so this PR merges cleanly; the tree is the SDK-based one.

Finding worth knowing: AX620U is not register-compatible with AX620E (own map, UART at 0x4990000, own clock layout), but its kernel code base is the same lineage, so the vendor modules' struct layouts match the SDK tree; the only interface difference found is ax_printk's argument order.

Tested (QEMU, OpenIPC/qemu-bench -M ax620u -smp 4)

OpenIPC U-Boot → this kernel, 4 CPUs → UBIFS root from SPI NAND (standard OpenIPC all-in-UBI layout) with the rootfs_data overlay persisting across reboot → login, DHCP, SSH; all 28 vendor modules load (ax_audio registers its ALSA card, ax_pcal6416a binds) with 0 oops/WARNING; the stock vendor camera App run on this kernel streams 3840x2160 HEVC over RTSP with 0 decode errors.

Not yet: a real AX620U clock driver (every clock is a fixed 24 MHz stand-in — fine in QEMU, UART/SPI rates on real hardware unverified). Nothing tested on real hardware yet.

Used by the AX620U part of OpenIPC/firmware#2670.

…9.125)

Verbatim copy of kernel/linux/linux-4.19.125 from the Axera AX620E SDK
(sipeed maix_ax620e_sdk, kernel HEAD fd3114bfd) on top of vanilla
v4.19.125, so this commit is exactly Axera's diff against upstream:
mach-axera (holding-pen SMP), drivers/clk/axera, drivers/pinctrl/axera,
drivers/soc/axera, the DesignWare SPI/SPI-NAND driver Axera boots from,
dwmac-axera, ax_printk/AXLOG, AX620E/AX620Q/AX630C devicetrees and
defconfigs.
The SDK kernel builds only inside the SDK checkout: it compiles the OSAL
from ../../../../../osal, the board pinmux tables from build/projects/
$(PROJECT) and moves the %.dtb/dtbs rules to boot/dts/axera.

- import the OSAL (kernel/osal/linux/kernel + kernel/osal/include of
  the same SDK) as drivers/soc/axera/osal, built in (=y, as the SDK
  does) or as ax_osal.ko (=m);
- AXERA_AX620E_PINMUX gates the SDK board pinmux tables (default y);
- restore the upstream %.dtb/dtbs rules so buildroot's in-tree DTS
  handling works; SDK boards build as axera/<board>.dtb;
- uvc_video: 64-bit modulo on arm32 (__aeabi_uldivmod link error).
AX620U is a different die from AX620E (own register map, root
compatible "axera,ax620x"), but its vendor kernel is the same Axera
4.19.125 BSP lineage, so the closed AX620U media modules (ax_osal,
ax_sys, ax_cmm, ... ax_audio, ax_pcal6416a, Xm*) load against this
kernel with the config below: vermagic "4.19.125 SMP preempt
mod_unload ARMv7 p2v8", every symbol they import resolves, and the
struct layouts they use match (the platform_device/driver fields the
SDK adds are in the AX620U BSP too).

- ax620u.dts: the stock camera devicetree (JFtech IPC_AX620U_A8 FIT,
  fdt-1), with the SPI-NAND controller bound by the SDK spi-axera-mmio
  driver ("snps,dwc-ssi-1.03a", flashclk + pclk).
- clk-ax620u: fixed-rate provider for the nine ax620x clock syscons
  (the AX620U clock driver is not in the SDK; clk-ax620e binds the same
  compatibles with AX620E's layout, so it is off for this board).
- mach-axera: the SDK holding pen also serves enable-method
  "axera,ax620x-smp" (same /cpus/secondary-boot-reg release): 4 CPUs.
- ax620u_compat: the AX620U kernel's ax_printk/ax_vprintk take printk's
  arguments (fmt first) where the SDK's AXLOG ones take (id, tag, level,
  fmt): with AXERA_AX620U_COMPAT the SDK's become axlog_printk/
  axlog_vprintk in-tree and the printk-style pair is exported. Also
  ax_special_rtc_lock/unlock and read_adc_value (ax_rtc, ax_hwinfo).
- axera_ax620u_defconfig: the stock camera kernel's own config (from
  its /proc/config.gz) moved onto this tree: ARCH_AX620E, SDK drivers
  for AX620E-only blocks off, DRM off (display_dummy provides
  ax_display_register for ax_vo), memory_dump off, OVERLAY_FS on. The
  vendor modules bring their own OSAL, so AXERA_OSAL is off.

Boots in QEMU (-M ax620u) through the stock U-Boot from SPI NAND:
4 CPUs, rootfs on mtdblock4 through the SDK SPI-NAND driver, eth0; all
28 stock modules insmod in the stock loader's order with no oops.
Backport of the v5.5 behaviour (mtd_set_dev_defaults reads "label"):
AX620U's devicetree labels its SPI NAND "spi4.0_nand", the mtd id the
stock Xiongmai kernel uses, so the mtdparts= in the U-Boot env of every
deployed camera keeps applying.
…620U's

- axera-axi-dmac: devm_reset_control_get_optional() returns NULL for a
  devicetree without the reset, and IS_ERR_OR_NULL + PTR_ERR(NULL) ended
  the probe with 0 and no DMA device; AX620U's node (no reset, clock
  "core-clk") then left ax_dma_hal without a channel. Take NULL as no
  reset and fall back to the first clock.
- fs/proc/axlogctl.c registers ax_proc/logctl, which AX620U's closed
  ax_logctl.ko creates itself (proc_dir_entry already registered
  warning): not built with AXERA_AX620U_COMPAT.
The SDK driver caps dma-channels at 1 (AX620E's DMAC); AX620U's
devicetree has 2, so parse_device_properties() refused it (-EINVAL),
no DMA device existed and ax_dma_hal could not get a channel (no
/dev/axi_dma_hal). Allow up to 8, upstream dw-axi-dmac's limit; the
stock AX620U kernel reports "DesignWare AXI DMA Controller, 2 channels"
for the same node.
Same DesignWare timer-in-PWM-mode channels; AX620U's devicetree gives no
clock-register window (the SDK driver pokes AX620E's clock block
directly), so its channel clocks stay as the bootloader left them.
The stock Xiongmai App writes /sys/class/pwm/pwmchip0/export without
checking fopen() and crashes when no pwmchip exists.
….125 bring-up

The previous axera-ax620u branch (vanilla v4.19.125 + a minimal defconfig
and devicetree) had no Axera clock, SMP, OSAL or driver support, so the
vendor ax_*.ko media modules could not run on it. This branch keeps the
SDK-based tree; the old history stays reachable through this merge.
@qodo-free-for-open-source-projects

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

Copy link
Copy Markdown

PR Summary by Qodo

Port AX620U camera support to Axera's 4.19.125 SDK kernel

✨ Enhancement 🐞 Bug fix ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Replace the minimal AX620U kernel with Axera's SDK tree to match vendor media-module interfaces.
• Add AX620U boot, clock, storage, DMA and PWM support for the camera devicetree.
• Make SDK components build in-tree; QEMU boots four CPUs and loads all 28 vendor modules.
Merge Risk ⚪ Unavailable

Risk assessment unavailable.

The Risk agent did not return a valid assessment.

Assessed commit 1f6d97f

Diagram

graph TD
  DT["AX620U devicetree"] --> Clock["Stub clocks"] --> Kernel["SDK kernel"] --> OSAL["OSAL interfaces"] --> Modules["Vendor modules"] --> App["Camera App"]
  DT --> SMP["SMP boot"] --> Kernel
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Backport only AX620U support onto vanilla 4.19
  • ➕ Smaller vendor-code footprint and narrower review surface.
  • ➖ Would require reconstructing the SDK's kernel interfaces and structure layouts needed by closed modules.
  • ➖ Substantial risk of modules loading but failing at runtime.
2. Use the stock AX620U kernel
  • ➕ Likely the closest match to the camera's hardware and closed modules.
  • ➖ Does not provide the same reviewable SDK-source baseline or standalone build path.
  • ➖ May not support the desired OpenIPC kernel configuration.

Recommendation: Retain the SDK-kernel baseline: matching the closed modules' kernel lineage is the decisive constraint, and the isolated import helps distinguish vendor code from AX620U adaptations. Before treating this as hardware-ready, replace or validate the fixed-rate clock placeholders on a physical camera.

Files changed (77) +45809 / -302

Enhancement (56) +44734 / -275
ax620u.dtsAdapt the stock AX620U camera devicetree +14/-3

Adapt the stock AX620U camera devicetree

• Documents the stock-FIT origin, supplies the SDK SPI controller's binding and clock names, and labels the SPI NAND device for its expected MTD name.

arch/arm/boot/dts/ax620u.dts

platsmp.cSupport AX620U secondary-CPU startup +246/-0

Support AX620U secondary-CPU startup

• Adds the AX620U enable-method to the SDK holding-pen SMP implementation, using the devicetree secondary-boot register.

arch/arm/mach-axera/platsmp.c

headsmp.SImport Axera's secondary-CPU holding pen +42/-0

Import Axera's secondary-CPU holding pen

• Provides the assembly entry used by Axera SMP startup.

arch/arm/mach-axera/headsmp.S

ax620e_pm.cImport Axera platform power management +1589/-0

Import Axera platform power management

• Adds the SDK's AX620E-family power-management routines.

arch/arm/mach-axera/ax620e_pm.c

ax620e_sleep.SImport Axera sleep entry +163/-0

Import Axera sleep entry

• Adds the SDK assembly sleep path used by platform power management.

arch/arm/mach-axera/ax620e_sleep.S

AX620E.dtsiImport the AX620E-family SoC description +1899/-0

Import the AX620E-family SoC description

• Adds the vendor peripheral, interrupt, memory and bus definitions used by SDK boards.

arch/arm/boot/dts/axera/AX620E.dtsi

AX620E_clk.dtsiImport AX620E clock devicetree definitions +60/-0

Import AX620E clock devicetree definitions

• Describes clock hardware for the SDK's AX620E-family boards.

arch/arm/boot/dts/axera/AX620E_clk.dtsi

AX620E_pinctrl.dtsiImport AX620E pinmux definitions +6855/-0

Import AX620E pinmux definitions

• Adds vendor pin groups and mux settings for SDK board descriptions.

arch/arm/boot/dts/axera/AX620E_pinctrl.dtsi

AX620E_opptable.dtsiImport AX620E operating points +503/-0

Import AX620E operating points

• Defines vendor operating-point tables consumed by the SoC descriptions.

arch/arm/boot/dts/axera/AX620E_opptable.dtsi

AX620E_resets.dtsiImport AX620E reset definitions +114/-0

Import AX620E reset definitions

• Describes SDK reset lines referenced by vendor peripherals.

arch/arm/boot/dts/axera/AX620E_resets.dtsi

AX620Q_nand_arm32_k419.dtsImport AX620Q NAND board description +600/-0

Import AX620Q NAND board description

• Adds a vendor AX620Q NAND board devicetree from the SDK.

arch/arm/boot/dts/axera/AX620Q_nand_arm32_k419.dts

AX620E.dtsiImport arm64 AX620E-family SoC description +1885/-0

Import arm64 AX620E-family SoC description

• Adds the vendor arm64 hardware description used by AX630C boards.

arch/arm64/boot/dts/axera/AX620E.dtsi

AX630C_emmc_arm64_k419.dtsImport AX630C eMMC board description +824/-0

Import AX630C eMMC board description

• Adds a vendor arm64 AX630C board target.

arch/arm64/boot/dts/axera/AX630C_emmc_arm64_k419.dts

smp.cIntegrate Axera SMP behavior +4/-1

Integrate Axera SMP behavior

• Imports SDK changes to the ARM secondary-CPU path.

arch/arm/kernel/smp.c

smp.cIntegrate SDK arm64 SMP behavior +5/-1

Integrate SDK arm64 SMP behavior

• Imports vendor adjustments to arm64 CPU startup.

arch/arm64/kernel/smp.c

clk-ax620u.cProvide provisional AX620U clocks +39/-0

Provide provisional AX620U clocks

• Registers a fixed-rate provider for each AX620U clock-block compatible, defaulting to 24 MHz without changing bootloader clock settings.

drivers/clk/axera/clk-ax620u.c

clk-ax620e.cImport AX620E clock driver +572/-0

Import AX620E clock driver

• Adds the SDK clock implementation for the different AX620E-family register layout.

drivers/clk/axera/clk-ax620e.c

clk.cImport shared Axera clock implementation +668/-0

Import shared Axera clock implementation

• Adds common SDK clock operations used by AX620E-family support.

drivers/clk/axera/clk.c

ax620u_compat.cExport symbols expected by AX620U modules +58/-0

Export symbols expected by AX620U modules

• Adds AX620U-format ax_printk wrappers, RTC lock helpers and a placeholder board-ID ADC read.

drivers/soc/axera/ax620u/ax620u_compat.c

osal_axera_core.cImport the OSAL core +383/-0

Import the OSAL core

• Adds SDK initialization and core services for Axera's operating-system abstraction layer.

drivers/soc/axera/osal/osal_axera_core.c

osal_device.cImport OSAL device services +757/-0

Import OSAL device services

• Adds vendor device-abstraction support used by Axera drivers.

drivers/soc/axera/osal/osal_device.c

osal_ax.hImport OSAL public interfaces +527/-0

Import OSAL public interfaces

• Declares shared Axera OSAL types and APIs for in-tree consumers.

drivers/soc/axera/osal/include/osal_ax.h

axera-axi-dmac-platform.cImport and adapt the AXI DMA controller +1557/-0

Import and adapt the AXI DMA controller

• Adds the vendor DMA engine; accepts an absent reset and falls back to the first clock so the AX620U controller can probe.

drivers/dma/axera-axi-dmac/axera-axi-dmac-platform.c

axera-axi-dmac.hDefine Axera AXI DMA hardware structures +350/-0

Define Axera AXI DMA hardware structures

• Adds channel, descriptor and register definitions for the imported controller.

drivers/dma/axera-axi-dmac/axera-axi-dmac.h

core.cImport vendor SPI NAND behavior +168/-3

Import vendor SPI NAND behavior

• Adapts SPI NAND core handling for the SDK storage stack.

drivers/mtd/nand/spi/core.c

gigadevice.cAdd GigaDevice SPI NAND support +223/-0

Add GigaDevice SPI NAND support

• Imports vendor support for additional GigaDevice NAND parts.

drivers/mtd/nand/spi/gigadevice.c

winbond.cExtend Winbond SPI NAND support +237/-2

Extend Winbond SPI NAND support

• Imports vendor Winbond NAND-device handling.

drivers/mtd/nand/spi/winbond.c

spi-axera-mmio.cImport Axera SPI MMIO glue +255/-0

Import Axera SPI MMIO glue

• Adds the SDK SPI controller binding used by the camera's SPI NAND node.

drivers/spi/spi-axera-mmio.c

spi-axera.cImport Axera SPI controller support +757/-0

Import Axera SPI controller support

• Adds the vendor SPI controller implementation used by Axera platforms.

drivers/spi/spi-axera.c

spi-dw-mmio.cAdapt DesignWare SPI platform support +150/-75

Adapt DesignWare SPI platform support

• Imports SDK controller integration needed by Axera SPI devices.

drivers/spi/spi-dw-mmio.c

pwm-axera.cBind the SDK PWM driver to AX620U +541/-0

Bind the SDK PWM driver to AX620U

• Imports Axera PWM support and adds axera,ax620x-pwm matching so the camera exposes its pwmchip.

drivers/pwm/pwm-axera.c

rtc-axera.cImport the Axera RTC driver +479/-0

Import the Axera RTC driver

• Adds SDK platform RTC functionality.

drivers/rtc/rtc-axera.c

axera_reset.cImport Axera reset-controller support +298/-0

Import Axera reset-controller support

• Adds the SDK reset provider for supported Axera hardware.

drivers/reset/axera_reset/axera_reset.c

pinctrl-ax620e.cImport AX620E pin controller +728/-0

Import AX620E pin controller

• Adds the SDK AX620E-family pin-control implementation; AX620U does not select its project pinmux tables.

drivers/pinctrl/axera/pinctrl-ax620e.c

gpio-axera.cImport Axera GPIO controller +538/-0

Import Axera GPIO controller

• Adds the SDK GPIO driver for Axera platforms.

drivers/gpio/gpio-axera.c

i2c-designware-master.cImport SDK DesignWare I2C adaptations +261/-10

Import SDK DesignWare I2C adaptations

• Changes master-controller behavior for Axera's I2C integration.

drivers/i2c/busses/i2c-designware-master.c

i2c-designware-platdrv.cAdapt DesignWare I2C platform probing +108/-26

Adapt DesignWare I2C platform probing

• Imports SDK platform-device and controller integration for Axera I2C buses.

drivers/i2c/busses/i2c-designware-platdrv.c

sdhci-axera.cImport Axera SDHCI host support +1208/-0

Import Axera SDHCI host support

• Adds the SDK controller driver for SD and eMMC on supported boards.

drivers/mmc/host/sdhci-axera.c

dwmac-axera.cImport Axera Ethernet glue +803/-0

Import Axera Ethernet glue

• Adds vendor DWMAC integration for Axera Ethernet hardware.

drivers/net/ethernet/stmicro/stmmac/dwmac-axera.c

stmmac_main.cIntegrate vendor STMMAC behavior +149/-26

Integrate vendor STMMAC behavior

• Imports SDK changes to the shared Ethernet driver.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

8250_axera.cImport Axera UART support +542/-0

Import Axera UART support

• Adds the vendor 8250 serial integration for Axera hardware.

drivers/tty/serial/8250/8250_axera.c

dwc3-axera.cImport Axera DWC3 glue +531/-0

Import Axera DWC3 glue

• Adds SDK platform integration for USB DWC3.

drivers/usb/dwc3/dwc3-axera.c

f_uvc.cImport vendor UVC gadget behavior +471/-88

Import vendor UVC gadget behavior

• Adapts the UVC function to the SDK's camera transport requirements.

drivers/usb/gadget/function/f_uvc.c

uvc_configfs.cExtend UVC gadget configuration +965/-39

Extend UVC gadget configuration

• Imports SDK configfs controls for the vendor UVC function.

drivers/usb/gadget/function/uvc_configfs.c

ax_printk.cImport Axera kernel logging +1230/-0

Import Axera kernel logging

• Adds the SDK's Axera-specific logging implementation; AX620U's differing call convention is handled separately.

kernel/printk/ax_printk.c

ax_printk_safe.cImport safe Axera logging path +407/-0

Import safe Axera logging path

• Adds the SDK's safe-output implementation for Axera logging.

kernel/printk/ax_printk_safe.c

ax_printk.hDeclare Axera logging interfaces +94/-0

Declare Axera logging interfaces

• Adds the SDK logging declarations consumed by kernel components.

include/linux/ax_printk.h

axlogctl.cImport Axera log controls +326/-0

Import Axera log controls

• Adds the SDK proc interface for Axera logging configuration.

fs/proc/axlogctl.c

ax_cipher_crypto.cImport Axera cipher implementation +2077/-0

Import Axera cipher implementation

• Adds the SDK cryptographic implementation for supported Axera devices.

drivers/crypto/axera/ax_cipher_crypto.c

ax_drm_drv.cImport Axera DRM driver +448/-0

Import Axera DRM driver

• Adds the SDK display-driver integration and device lifecycle.

drivers/gpu/drm/axera/ax_drm_drv.c

axera_adc.cImport Axera ADC driver +307/-0

Import Axera ADC driver

• Adds SDK ADC support for platforms that select it; AX620U's compatibility export supplies a separate placeholder read.

drivers/iio/adc/axera_adc.c

rwnx_main.cImport AIC8800 wireless driver +6287/-0

Import AIC8800 wireless driver

• Adds the vendor wireless driver's main implementation as part of the SDK tree.

drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c

hynitron_core.cImport Hynitron touchscreen core +2208/-0

Import Hynitron touchscreen core

• Adds a vendor touchscreen implementation included in the SDK kernel.

drivers/input/touchscreen/hynitron/hynitron_core.c

super.cImport exFAT filesystem support +1178/-0

Import exFAT filesystem support

• Adds the vendor tree's exFAT mount and superblock implementation.

fs/exfat/super.c

dwc-i2s.cImport Axera I2S audio support +993/-0

Import Axera I2S audio support

• Adds the SDK I2S controller integration for supported boards.

sound/soc/axera/dwc-i2s.c

do_mounts.cImport SDK root-mount handling +53/-1

Import SDK root-mount handling

• Carries Axera's changes to early root-filesystem setup.

init/do_mounts.c

Bug fix (2) +262 / -25
mtdcore.cHonor a devicetree MTD label +6/-0

Honor a devicetree MTD label

• Uses a device's devicetree label when no MTD name is set, preserving the camera's spi4.0_nand identifier.

drivers/mtd/mtdcore.c

uvc_video.cImport SDK UVC transport and fix ARM32 arithmetic +256/-25

Import SDK UVC transport and fix ARM32 arithmetic

• Adds Axera UVC transport-metadata handling and uses 32-bit-safe division for its 48 MHz timestamp calculation.

drivers/usb/gadget/function/uvc_video.c

Other (19) +813 / -2
MakefileBuild the camera DTB under Axera platform selection +4/-1

Build the camera DTB under Axera platform selection

• Moves ax620u.dtb from the generic ARMv7 target to ARCH_AXERA.

arch/arm/boot/dts/Makefile

axera_ax620u_defconfigAdd the SDK-based AX620U camera configuration +274/-0

Add the SDK-based AX620U camera configuration

• Selects the SDK platform, AX620U stub clocks and compatibility exports, SPI NAND/UBIFS, DMA, PWM and loop devices; disables the AX620E clock driver, SDK board pinmux and in-tree OSAL.

arch/arm/configs/axera_ax620u_defconfig

KconfigRegister the Axera ARM platform +32/-0

Register the Axera ARM platform

• Introduces ARCH_AXERA and its AX620X-family platform selection.

arch/arm/mach-axera/Kconfig

MakefileBuild Axera machine support +10/-0

Build Axera machine support

• Connects SMP, chip and power-management implementation to the ARM platform build.

arch/arm/mach-axera/Makefile

MakefileRetain SDK board DTB rule +1/-0

Retain SDK board DTB rule

• Builds the SDK board DTB named by PROJECT when the Axera platform is selected.

arch/arm/boot/dts/axera/Makefile

MakefileRegister SDK arm64 board DTB rule +1/-0

Register SDK arm64 board DTB rule

• Connects the SDK's project-selected board description to the arm64 DTB build.

arch/arm64/boot/dts/axera/Makefile

KconfigExpose Axera ARM machine configuration +2/-0

Expose Axera ARM machine configuration

• Includes the imported Axera platform in ARM configuration.

arch/arm/Kconfig

MakefileBuild the Axera machine directory +1/-0

Build the Axera machine directory

• Connects mach-axera to the ARM platform build.

arch/arm/Makefile

Kconfig.platformsExpose Axera arm64 platform selection +5/-0

Expose Axera arm64 platform selection

• Adds SDK platform configuration for arm64 builds.

arch/arm64/Kconfig.platforms

KconfigSelect separate AX620E and AX620U clocks +26/-0

Select separate AX620E and AX620U clocks

• Adds configuration for SDK AX620E clocks and the AX620U fixed-rate stand-in, warning that their bindings overlap.

drivers/clk/axera/Kconfig

MakefileBuild selected Axera clock providers +7/-0

Build selected Axera clock providers

• Wires the SDK clock implementation and AX620U provider to their configuration options.

drivers/clk/axera/Makefile

KconfigConfigure SDK services and AX620U compatibility +275/-0

Configure SDK services and AX620U compatibility

• Exposes Axera services and OSAL; adds AX620U compatibility exports and an option to omit SDK-project pinmux tables.

drivers/soc/axera/Kconfig

MakefileConnect Axera services to the kernel build +20/-0

Connect Axera services to the kernel build

• Wires the imported services, in-tree OSAL, optional pinmux and AX620U compatibility object into Kbuild.

drivers/soc/axera/Makefile

MakefileBuild AX620U compatibility exports +1/-0

Build AX620U compatibility exports

• Includes the compatibility object when AXERA_AX620U_COMPAT is selected.

drivers/soc/axera/ax620u/Makefile

MakefileBuild the imported OSAL in-tree +40/-0

Build the imported OSAL in-tree

• Assembles SDK OSAL sources as built-in support or ax_osal.ko instead of requiring an SDK-relative source directory.

drivers/soc/axera/osal/Makefile

MakefileGate SDK-project pinmux compilation +2/-0

Gate SDK-project pinmux compilation

• Keeps the vendor project's pinmux include path behind AXERA_AX620E_PINMUX, which the AX620U configuration disables.

drivers/soc/axera/pinmux/Makefile

KconfigExpose Axera DMA engines +19/-1

Expose Axera DMA engines

• Adds options for AXI and peripheral DMA controllers.

drivers/dma/Kconfig

KconfigExpose Axera PWM support +9/-0

Expose Axera PWM support

• Adds the configuration option for the SDK PWM controller.

drivers/pwm/Kconfig

patch_defconfig.pyImport SDK defconfig helper +84/-0

Import SDK defconfig helper

• Adds the vendor script for composing project configurations.

scripts/axera/patch_defconfig.py

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Five cipher handles corrupt kernel memory ✓ Resolved
Description
cipher_create_handle() clears s_cipher_chn[i] before checking whether its scan found a free
entry. Once all four entries are occupied, the fifth creation request clears memory immediately
beyond the array.

2. RSA requests can overwrite kernel stacks ✓ Resolved
Description
The RSA verify and sign handlers use ioctl-supplied u32_hash_size as the bound for writes into the
fixed-size command token. An oversized value writes beyond both the supplied hash array and the
64-word token during either operation.

3. Cipher callers can target physical memory 🐞 Bug ⛨ Security
Description
Several cipher_ioctl() handlers place caller-supplied physical addresses and lengths directly into
hardware command tokens without checking buffer ownership or address ranges. A process granted
access to /dev/ax_cipher can direct the engine's reads or writes outside its own buffers.
Code

drivers/crypto/axera/ax_cipher_ioctl.c[R147-150]

Evidence
The new ioctl ABI contains raw physical addresses; the cipher, hash, and modular-exponentiation
handlers forward them into device tokens without an intervening ownership check.

drivers/crypto/axera/ax_cipher_ioctl.h[40-62]
drivers/crypto/axera/ax_cipher_ioctl.c[147-186]
drivers/crypto/axera/ax_cipher_ioctl.c[218-249]
drivers/crypto/axera/ax_cipher_ioctl.c[628-702]
drivers/crypto/axera/ax_cipher_device.c[100-119]

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

## Issue description
Cipher ioctls permit device operations at unchecked caller-supplied physical addresses.
## Fix Focus Areas
- drivers/crypto/axera/ax_cipher_ioctl.c[147-186]
- drivers/crypto/axera/ax_cipher_ioctl.c[218-249]
- drivers/crypto/axera/ax_cipher_ioctl.c[628-702]
## Recommended Fix
Resolve ioctl buffers through driver-managed allocations or validated mappings, check their lengths and ownership, and apply the same validation to every hardware-token builder.

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


View action required (10)
4. Malformed flash names overwrite kernel memory ✓ Resolved
Description
exfat_get_uniname_from_ext_entry() advances a fixed-size name destination for every extension
entry specified by an on-disk count, without bounding the number of name entries. A crafted exFAT
directory entry with a large num_ext writes beyond the name buffer while the directory is read;
the lookup path has the same unchecked advancement.

5. USB display frames corrupt kernel memory ✓ Resolved
Description
draw_a_frame() decodes every RGB565 frame as a fixed 480-by-480 image into a buffer sized for only
320-by-170 pixels. A USB host can select that frame type and supply an accepted payload, causing the
worker to read past the received frame and write past its decode buffer.

6. USB display frames crash the kernel ✓ Resolved
Description
draw_a_frame() copies RGB888 payloads to loop->screen_base, but the imported function never
assigns a display address to that field. A host-supplied RGB888 frame reaches the worker with a null
destination and faults during the copy.

7. Removing a USB display can use freed memory ✓ Resolved
Description
lb_free_func() frees the function object without first stopping the worker thread or clearing the
instance's pointer to it. Gadget-function removal can leave the worker running on freed storage, and
later instance cleanup dereferences the same pointer.

8. Any user can reprogram the touchscreen ✓ Resolved
Description
hyn_tool_fs_int() creates a world-writable debug proc node whose write handler accepts raw I²C
writes, reset commands, and firmware-update requests. On a system with this touchscreen driver
enabled, an ordinary local user can send those commands directly to the controller.

9. Firmware commands overflow touchscreen data ✓ Resolved
Description
The touchscreen debug write handlers accept commands much longer than fw_file_name and copy the
firmware-path portion into that fixed field with strcpy(). A long firmware-update command written
to either imported debug interface overwrites the surrounding kernel object.

10. Touchscreen reads can expose kernel data ✓ Resolved
Description
hyn_proc_tool_read() allocates its result buffer from a capped length but later copies count - 4
bytes from it in the factory-test path. A caller of the world-readable debug proc node can choose a
larger read count and make the kernel copy beyond that allocation.

11. Flash transfers change their wire format ✓ Resolved
Description
dw_spi_transfer_one() rewrites DMA-eligible transfers to 32-bit or 16-bit words according to byte
count, regardless of the caller's requested word size. Long eight-bit SPI-NAND transfers can
therefore use different controller framing, and the driver even selects 32-bit words while
advertising only eight- and 16-bit support.

12. Core dumps can overwrite files that other users can read 🐞 Bug ⛨ Security
Description
do_coredump now accepts an existing core file when (inode->i_mode & 0600) == 0600, where it used
to require (i_mode & 0677) == 0600, so group- and world-readable (and executable) files now pass
the check. A pre-existing core file owned by the dumping user with mode 0644 or 0666 is reused
as-is, so the new crash's memory image (keys, passwords, session data) can be read by every local
user.
Code

fs/coredump.c[741]

Evidence
Upstream masks with 0677 so that any group/other permission bit (or an owner exec bit) rejects the
file. The new 0600 mask only checks that owner read/write is set and ignores every other bit. The PR
introduces this change, and it applies to every kernel built from this tree, including the AX620U
camera.

fs/coredump.c[735-745]

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 core-dump reuse check was weakened from `(i_mode & 0677) != 0600` to `(i_mode & 0600) != 0600`, so an existing core file that others can read gets the new core dump written into it.
## Fix Focus Areas
- fs/coredump.c[739-742]
## Recommended Fix
Revert to `if ((inode->i_mode & 0677) != 0600) goto close_fail;`. If the vendor needs to reuse such files, fix their permissions in userspace.

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


13. AX620U I2C probe writes to the AX620E clock block ✓ Resolved
Description
dw_i2c_plat_probe() ignores failure to read ax_clk_id, then uses an uninitialised clk_id for
unchecked, unconditional access to the hard-coded AX620E clock block and substitutes the fixed 208
MHz I2C_CLK_SOURCE for the DT clock rate. AX620U’s ten enabled DesignWare I²C nodes lack
ax_clk_id and use a different register layout, so their probes can write unrelated registers at a
garbage bit position; other controllers also bypass framework-clock setup and may fault during
probe.


Remediation recommended

14. The first bulk camera stream never starts 🐞 Bug ≡ Correctness
Description
uvc_function_set_alt() enables the bulk endpoint on its first connected-state call but queues
UVC_EVENT_STREAMON only when that endpoint was already enabled. The first host activation returns
successfully without notifying the V4L2 application or transitioning to the streaming state.
Code

drivers/usb/gadget/function/f_uvc.c[R542-545]

Evidence
Only the already-enabled branch queues the stream-on event; bulk mode advertises one alternate
setting, making the first call the activation path.

drivers/usb/gadget/function/f_uvc.c[136-146]
drivers/usb/gadget/function/f_uvc.c[370-386]
drivers/usb/gadget/function/f_uvc.c[537-559]

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 first bulk UVC activation enables an endpoint without starting the application stream.
## Fix Focus Areas
- drivers/usb/gadget/function/f_uvc.c[537-559]
## Recommended Fix
After successfully enabling the endpoint, perform the same stream-start notification and state transition as the already-enabled branch, while handling enable errors.

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


15. Reading log controls can crash the kernel ✓ Resolved
Description
logctl_proc_init() ignores axera_logctl_init() failures and publishes a proc interface that
unconditionally uses the resulting global pointer. On a build without the expected device-tree node
or config property, an owner opening or reading that interface reaches a null dereference.

16. Long log commands overwrite kernel stacks ✓ Resolved
Description
logctl_proc_write() parses copied proc input with widthless %s conversions into two 64-byte
stack arrays. An owner able to write the proc node can submit a token longer than either array and
overwrite adjacent stack data.

View review recommended (9)
17. PHY diagnostics leave devices mispaged ✓ Resolved
Description
phy_reg_store() writes vendor page register 0x1f for every read or write request and never
restores its previous value. Because this attribute is installed on all PHY devices, using the
diagnostic on a paged PHY can redirect subsequent driver accesses, while a different PHY may treat
that write as an unrelated register change.

18. Axera board images are omitted from builds ✓ Resolved
Description
The Axera DT makefiles add only $(PROJECT).dtb rather than enumerating their supplied board files
or deriving a name from configuration. With PROJECT unset, a normal make dtbs does not select
any AX620Q or AX630C board image from those directories.

19. Reserve-memory patching skips its edits ✓ Resolved
Description
patch_reserve_mem.sh declares /bin/sh but uses the Bash-only [[ ... ]] conditional syntax to
gate its replacements. Running it with a POSIX shell such as dash makes those tests fail, so
requested reserved-memory substitutions are skipped.

20. UART overrun, parity and framing errors go unreported ✓ Resolved
Description
serial8250_handle_irq reads UART_LSR twice and carries only UART_LSR_BI over from the first
read. On 16550-class UARTs OE/PE/FE are cleared by reading LSR, so any error bit seen on the first
read never reaches serial8250_rx_chars. Every 8250 port is affected, including the AX620U's
snps,dw-apb-uart console and serial ports: corrupted or dropped bytes are delivered without
TTY_PARITY/TTY_FRAME/TTY_OVERRUN flags or icount updates.

21. Ethernet never recovers from a TX hang ✓ Resolved
Description
stmmac_tx_timeout() compiles out stmmac_global_err(priv) under #if 0 and only calls printk,
so it no longer requests the service-work reset. When the TX watchdog fires on any stmmac interface,
including the AX620U's axera,dwmac-4.10a eth0, a stuck DMA can leave the link dead until reboot.

22. Bad reset specifiers silently select the wrong reset line ✓ Resolved
Description
__of_reset_control_get comments out the args.args_count != rcdev->of_reset_n_cells check, so a
resets phandle with too few cells is passed straight to rcdev->of_xlate. of_reset_simple_xlate
and similar callbacks read args[0..n] beyond args_count, i.e. leftover values from the parser.
Any devicetree with a mismatched reset specifier, on any SoC built from this tree, then asserts or
deasserts some other peripheral's reset instead of failing the probe.

23. Setting a clock to its current rate reprograms it anyway ✓ Resolved

Resolving commit: 1f6d97f

Resolution reason
The #if 0 block is replaced by an active early return rate == clk_core_get_rate_nolock(core) that
skips reprogramming when the rate is unchanged, restricted to non-AX620E clock providers via
IS_ENABLED(CONFIG_COMMON_CLK_AX620E).
Description
clk_core_set_rate_nolock disables, via #if 0, the early return taken when the rounded rate
equals the current rate. Every clk_set_rate() to an unchanged rate, from any driver on any clock
provider, now runs the full rate-change path: PRE/POST notifiers, set_rate callbacks, and possible
glitches on parents and children. Drivers that call clk_set_rate on each transfer or open (PWM
config, MMC, audio) trigger this repeatedly.

24. Status-register writes can fail on non-Winbond NOR flash ✓ Resolved
Description
The file-scope SPI_NOR_WRITE_ENABLE_FOR_VOLATILE_STATUS_REGISTER definition makes
write_sr_and_check, the unlock path, and initialization send SPINOR_OP_WRENVSR (0x50) instead of
WREN (0x06), without checking the enable command’s result. On Micron/ST parts, 0x50 is CLFSR, so WEL
is not set and subsequent status writes are ignored, preventing quad-enable and block-protect unlock
and leaving SDK NOR boards unable to write; on Winbond/GigaDevice parts, the resulting status
changes are volatile and lost on power cycles.

25. eMMC sleep command can return while the card is busy ✓ Resolved

Resolving commit: 1f6d97f

Resolution reason
The commit removes the use_r1b_resp variable and changes the wait condition in both mmc_sleep and
mmc_awake to `if (!cmd.busy_timeout || !(host->caps & MMC_CAP_WAIT_WHILE_BUSY))
mmc_delay(timeout_ms);`, which is exactly the upstream condition the finding recommends. It also
removes the pr_info debug lines from both functions, addressing the logging complaint.
Description
mmc_sleep now waits in software only when ... && !use_r1b_resp. If the host takes the R1B branch
but lacks MMC_CAP_WAIT_WHILE_BUSY, it no longer waits out the sleep/awake timeout, which the
comment above the check says it must. The next command can then be sent while the card is still
busy, and the change also adds pr_info lines to every sleep on every MMC host.


Informational

26. Firmware-provided ARM restart hook is never used ✓ Resolved
Description
machine_restart replaces if (arm_pm_restart) with if (0), so the hook that PSCI and machine
code register is skipped and only do_kernel_restart() handlers run. On any ARM board in this tree
whose reboot depends on arm_pm_restart and has no restart-notifier driver, reboot prints "Reboot
failed -- System halted" and hangs; AX620U only works because dw_wdt registers a restart handler.

27. Audio apps lose pause and resume on DMA PCM ✓ Resolved
Description
dmaengine_pcm_set_runtime_hwparams no longer sets SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME
when the DMA channel reports pause/resume support; the old assignments were replaced by a comment
block. Every ASoC card using the generic dmaengine PCM, on any platform, now gets -ENOSYS from ALSA
for pause and resume even though the DMA controller supports them.

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

cipher_create_handle() cleared s_cipher_chn[i] before checking that the
scan found a free channel, so a fifth handle cleared the memory after
the four-entry array.  The RSA sign and verify ioctls copy
u32_hash_size / 4 words of hash_result[16] into the command token
without bounding u32_hash_size.  Clear the channel only once one is
found and reject a hash larger than hash_result[].

Not built by axera_ax620u_defconfig (CRYPTO_HW is off); AX620E only.
Backport of upstream commit d42334578eba ("exfat: check if filename
entries exceeds max filename length", v6.5) to the exfat copy in this
tree: a directory entry set with more file-name entries than
MAX_NAME_LENGTH allows overran the name buffer in
exfat_get_uniname_from_ext_entry() and exfat_find_dir_entry().
…free

- draw_a_frame(): nothing ever maps a display into screen_base (frames
  reach user space through /proc/nanokvm), so the worker would memcpy
  host data to NULL; return early without a destination.  RGB565 was
  decoded as a fixed 480x480 image into a 320x170x4 buffer: decode the
  received pixels only, bounded by rgb888x_buf.
- lb_free_func() freed the function object while the worker thread
  still ran on it and lb_opts->ctx still pointed to it, so
  lb_free_instance() later used freed memory.  Release the thread,
  procfs, kfifos and framebuffer file in lb_free_func() and clear ctx.

Sipeed NanoKVM display gadget; not built by axera_ax620u_defconfig.
The /proc tool node (raw I2C reads/writes, reset, firmware update) was
created 0777; make it 0600.  Its read handler copied up to count bytes
out of a buffer sized from a capped length, and its write handler
strcpy()'d a not NUL-terminated user command into the 128-byte
fw_file_name.  Allocate at least count bytes (count limited to 64 KiB,
at least the 4-byte status), and copy the name bounded and terminated.

Sipeed board touchscreen; not built by axera_ax620u_defconfig.
The SDK relaxed (i_mode & 0677) != 0600 to (i_mode & 0600) != 0600, so
a crash reused a pre-existing group/world-readable core file and wrote
the process memory into it.  Back to upstream.
The SDK replaced 'if (arm_pm_restart)' with 'if (0)' so Axera boards
reboot through their restart handler instead of the PSCI/machine hook,
which also left every board that only has arm_pm_restart halted.  Run
the restart handlers first and fall back to arm_pm_restart (the order
upstream later adopted by turning arm_pm_restart into a handler).
AX620U has no PSCI node and reboots through its restart handler either
way.
The SDK commented out the args_count != of_reset_n_cells check for
every reset controller because its AX620E controller mixes 3-, 4- and
10-cell specifiers in one node (its of_xlate checks args_count itself).
Keep the check unless that driver is built; AX620U does not build it.
The SDK compiled out the 'nothing to do' return in
clk_core_set_rate_nolock() for every clock provider, so setting a clock
to its current rate ran the full notifier/set_rate path.  The SDK gives
no reason; keep its behaviour only with the AX620E clock driver it
ships with, and restore upstream everywhere else.  AX620U uses
fixed-rate clocks (COMMON_CLK_AX620U), so nothing changes there.
serial8250_handle_irq() reads UART_LSR twice in the SDK and carried only
BI over from the first read; reading LSR clears OE/PE/FE on 16550-class
UARTs (AX620U's snps,dw-apb-uart included), so overrun, parity and
framing errors were never reported.  OR both reads.
stmmac_tx_timeout() only printed a debug line in the SDK; restore
upstream's stmmac_global_err() so a stuck TX DMA resets the interface
(AX620U eth0 is axera,dwmac-4.10a).  The SDK's 200 s TX_TIMEO for
DWMAC_AXERA is unchanged.
The SDK skipped the software wait in mmc_sleep() (and its new
mmc_awake()) whenever an R1B response was used, so a host without
MMC_CAP_WAIT_WHILE_BUSY could send the next command while the card was
still busy, and it logged every sleep with pr_info.  Restore upstream's
condition and drop the extra pr_info.
The SDK dropped SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME for every
generic dmaengine PCM to work around tinyalsa not resuming after
suspend, so pause/resume returned -ENOSYS on every card.  Back to
upstream.  AX620U's ALSA card (vendor ax_audio.ko) has its own PCM and
does not use this code.
logctl_proc_write() parsed into two 64-byte stack arrays with widthless
%s, and logctl_proc_init() registered the node even when
axera_logctl_init() failed, leaving its handlers to dereference a NULL
s_logctl_cfg.  Use %63s and return the init error instead.

Not built with AXERA_AX620U_COMPAT (AX620U's ax_logctl.ko owns the node).
The SDK's phy_reg sysfs attribute (on every PHY) wrote the page register
0x1f for each access and left it there, unlocked, so the PHY driver's
next access could land on the diagnostic's page.  Save the page, access
and restore it under the MDIO bus lock; registers are 0..31.
…ig option

The SDK defined SPI_NOR_WRITE_ENABLE_FOR_VOLATILE_STATUS_REGISTER at
file scope, so every SPI-NOR status register write (write_sr_and_check,
write_sr_cr, the unlock in spi_nor_init) used WRENVSR (50h) instead of
WREN (06h); on Micron/ST parts 50h is CLFSR and the write is ignored.
Move it behind MTD_SPI_NOR_WRENVSR, default y only on ARCH_AXERA so
Axera's NOR boards keep their behaviour.  AX620U does not build
SPI-NOR.
The SDK's dw_spi_transfer_one() switches any DMA-eligible transfer to
32- or 16-bit frames by length, whatever word size the caller asked
for.  That is how its APB SSI DMA (APB_SPI_DW_DMA) moves data; keep it
to that DMA so other can_dma() users keep their wire format.  On AX620U
APB_SPI_DW_DMA is off, the dw-apb-ssi nodes are disabled and the
SPI-NAND is on the separate spi-axera-mmio driver, so nothing there
reaches this path.
The SDK's probe read the optional "ax_clk_id" into an uninitialised
int, ignored a missing property, and always ioremapped the AX620E
peripheral clock block (0x4870000) to set its I2C mux and gate the bit
for that id.  AX620U's ten designware-i2c nodes have no ax_clk_id and a
different register map, so every probe wrote AX620E bits at an address
that is not that block on AX620U.

Use the AX620E block only when ax_clk_id is present (and < 8); without
it gate the devicetree clock the upstream way (i2c_dw_prepare_clk), and
skip the RISC-V ownership bit that is indexed by the same id.  The
timings keep the SDK's 208 MHz basis: AX620U's clocks are fixed-rate
stand-ins (clk-ax620u), so their rate would not be better.
It declares #!/bin/sh but used bash's [[ ]], so under dash every
firmware-type test failed and no reserved-memory edit was made.  Use
[ "$A" = "$B" ].
The SDK's probe read the optional "ax_clk_id" into an uninitialised
int, ignored a missing property, and always ioremapped the AX620E
peripheral clock block (0x4870000) to set its I2C mux and gate the bit
for that id.  AX620U's ten designware-i2c nodes have no ax_clk_id and a
different register map, so every probe wrote AX620E bits at an address
that is not that block on AX620U.

Use the AX620E block only when ax_clk_id is present (and < 8); without
it gate the devicetree clock instead (the SDK removed
i2c_dw_prepare_clk()), and skip the RISC-V ownership bit that is indexed
by the same id.  The timings keep the SDK's 208 MHz basis: AX620U's
clocks are fixed-rate stand-ins (clk-ax620u), so their rate would not
be better.
@dimerr

dimerr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. The import commit stays verbatim (it documents Axera's diff); the fixes are follow-up commits on top (743fcad..1f6d97f), one per topic.

Memory-safety in Axera's drivers

# Finding Result
1, 2 ax_cipher: 5th handle, RSA hash size fixed in 76c7420: the channel is cleared only once a free one is found; u32_hash_size > sizeof(hash_result) is rejected. Not built for AX620U (CRYPTO_HW off)
3 ax_cipher: physical addresses from the caller not changed. /dev/ax_cipher is a misc device with the default 0600 mode, so only root can use it. The engine takes physical addresses by design, the same way the vendor CMM buffers work, so it is a root-only interface like /dev/mem. Not built for AX620U
4 exfat name overflow fixed in 1c7f79f, a backport of upstream d42334578eba ("exfat: check if filename entries exceeds max filename length")
5, 6, 7 f_udisp: RGB565 decode, NULL screen_base, use after free fixed in 13fd21e: no draw without a destination; RGB565 decodes only the received pixels, bounded by rgb888x_buf; lb_free_func() stops the worker and frees its resources before freeing the function. This is the Sipeed NanoKVM display gadget, which no OpenIPC target builds
8, 9, 10 hyn touchscreen tool node fixed in 7857a9f: the node is 0600, reads allocate at least count bytes (4 B to 64 KiB), and the firmware name is copied bounded and NUL-terminated. drivers/input/touchscreen/hyn is not even in the touchscreen Makefile; the Sipeed boards build it out of tree
15, 16 axlogctl: NULL cfg, unbounded %s fixed in 1d690c3: %63s, and the proc node is not registered when axera_logctl_init() fails. Not built with AXERA_AX620U_COMPAT, because AX620U's ax_logctl.ko owns the node

Generic code Axera changed: upstream behaviour restored, or limited to the hardware that needs the vendor change

# Finding Result
12 coredump 0600 mask upstream check restored (6e5171c)
20 8250 LSR error bits 8f25d6a: both LSR reads are OR'd, so OE/PE/FE/BI from the first read survive the SDK's second read
21 stmmac tx_timeout stmmac_global_err() restored (487c268)
22 reset args_count check restored unless AXERA_RESET_AX620E is built (dc08904). That driver mixes 3-, 4- and 10-cell specifiers in one node and checks args_count in its own of_xlate. AX620U does not build it
23 clk same-rate early return restored unless COMMON_CLK_AX620E is built (858a7a9). AX620U uses fixed-rate clocks
25 mmc sleep busy wait upstream condition restored in mmc_sleep() and the SDK's mmc_awake(), and the per-sleep pr_info is gone (51337f5)
26 ARM machine_restart if (0) 8b04fb7 runs the restart handlers first, then falls back to arm_pm_restart. Upstream later reached the same order by making arm_pm_restart a handler. AX620U has no PSCI node; reboot verified
27 dmaengine PCM PAUSE/RESUME upstream restored (d3b60d4). AX620U's ALSA card (vendor ax_audio.ko) has its own PCM and does not use this code
17 phy_reg sysfs page a40face: the page is saved, the access is done and the page is restored under the MDIO bus lock; reg is limited to 0..31
24 spi-nor WRENVSR d63de51 moves it behind the new MTD_SPI_NOR_WRENVSR option, which defaults to y only on ARCH_AXERA so Axera's NOR boards keep their behaviour. AX620U builds no SPI-NOR
11 spi-dw word size 129d6eb limits the widening to Axera's APB SSI DMA (APB_SPI_DW_DMA), so other can_dma() users such as Intel MID keep their word size. On AX620U that option is off, every dw-apb-ssi node is disabled, and the SPI-NAND uses the separate spi-axera-mmio driver
13 i2c-designware AX620E clock block on AX620U 1516770 + 1f6d97f use the AX620E peripheral clock block only when ax_clk_id is present (and < 8). Otherwise the DT clock is gated through the clk framework, and the RISC-V ownership bit indexed by the same id is skipped. AX620U's ten nodes have no ax_clk_id, so they no longer write AX620E bits at 0x4870000. The timings keep the SDK's 208 MHz basis, because AX620U's clocks are fixed-rate stand-ins whose rate does not describe the hardware
18 dts Makefile $(PROJECT) without PROJECT, every .dts in arch/{arm,arm64}/boot/dts/axera is built (all 14 arm32 boards build). AX620U's ax620u.dtb is listed in arch/arm/boot/dts/Makefile. Note: this change went into 1f6d97f under the i2c commit message by mistake
19 patch_reserve_mem.sh [[ POSIX [ "$A" = "$B" ] (1bd396a); it passes dash -n
14 f_uvc bulk STREAMON not changed. In bulk mode the first set_alt(0) is the enumeration-time interface select and only enables the endpoint; the next one is the host's (re)start. Sending STREAMON on the first call would start streaming at enumeration. f_uvc is not used by the OpenIPC camera firmware

Verification: I built axera_ax620u_defconfig with the OpenIPC gcc 13.3 toolchain. The touched files that the camera config does not build were compile-tested with a config that enables them (crypto, f_udisp, spi-nor, axlogctl, hyn as an external module). I booted the new kernel in QEMU (-M ax620u -smp 4) through the OpenIPC U-Boot from the all-in-UBI NAND image: 4 CPUs, UBIFS root plus overlay, login, eth0 up and pinging, all 28 vendor modules loaded, the ALSA card "Axera_Audio" present, i2c-0/1/6/8 present, 0 Oops/WARNING. A reboot through the restart path came back up on the same kernel.

@dimerr
dimerr merged commit be56461 into axera-ax620u Nov 18, 2026
@dimerr
dimerr deleted the axera-ax620u-sdk branch November 18, 2026 19:56
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