Repository navigation
Conversation
Detects the SoC from the kernel's root devicetree compatible: AX620E, AX630C and AX620Q devicetrees say "axera,ax620e", AX620U's (real deployed camera firmware) says "axera,ax620x", which is mapped to the ax620u family OpenIPC builds. Registered for both the ARM and arm64 paths (AX620E runs an arm64 kernel). With it ipcinfo -v/-c/-f report axera/<soc>/<family>, so OpenIPC's vendor init runs load_axera for the Axera media drivers; the sensor is reported from the devicetree.
PR Summary by QodoAdd Axera HAL detection for AX620E and AX620U
AI Description
Merge Risk
|
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.
Code Review by Qodo
1.
|
The root compatible is a list of NUL-separated strings and a board string usually comes first, so the Axera entry is searched for among all of them instead of only the first. One manufacturers[] entry under an __arm__/__aarch64__ guard replaces the two per-ABI copies. chip_generation stays 0 on purpose, as for Ambarella: ipctool has no pad-mux, clock or boot ROM tables for Axera.
|
Addressed Qodo's review in the latest commit:
|
Every AX620E-family devicetree says "axera,ax620e", whether the die is an AX620Q, AX630C or AX620QX, so the compatible now only picks the family and gates the register reads; the part comes from hardware. AX620E family: the SDK BL1 (board.c get_misc_info()) reads eFuse block 2 through EFSC0's shadow register, 0x02200000 + 0x58 + 2 * 4, takes bits 31:24 as a Hamming(7,4)-coded chip type and stores the decoded value in DUMMY_SW9 (0x02340220). ipctool decodes the fuse word the same way, falls back to DUMMY_SW9 when the word reads 0, and treats 0 as AX630C as BL1 does: ax620q, ax620qx, ax620v200, ax630c, ax631, ax620qz, ax620qp, ax620qe or ax620qf. AX620U family, from the stock ax_hwinfo.ko and ax_sys.ko: bit 24 of the DDR controller's 0x00102068 clear is AX620U; set, the bond option register 0x0222001C with all of 0x191800 is AX620D, otherwise AX620A. ipcinfo -f keeps the family OpenIPC builds (ax620e, ax620u) through a chip_generation per family. Without /dev/mem the family name is the model. axera_test checks the decode against BL1's own decoder on all 256 codes, every listed type with each single-bit error, and the AX620U rule.
|
Pushed 8755ade: ipctool now gets the model from hardware registers instead of the devicetree. The compatible tells only the family: every AX620E-family part says AX620E family (AX620Q, AX630C, AX620QX, …)
AX620U family (AX620U, AX620A, AX620D)
Families and fallback
Tests
|
The arm32 size check failed: ipcinfo grew 1602 bytes (51931 -> 53533), over the 1024 the workflow allows. Now 996 (-> 52927); IPCHW_VENDORS=none is unchanged at 0. - /proc/device-tree/compatible through open/read, which ipcinfo already imports, not fopen/fread (fread was a new import). - One register-read path for both families instead of two inlined copies. - The part names as an inline char table, not pointers (one relocation each in the PIE). - No private i2c opener: it ignored the bus number it was passed, so the sweep over other buses in sensors.c reopened i2c-6/8 every time. The fallback opener, with i2c_adapter_nr set at detection, does it right. - The decode helpers are static and axera_test.c includes axera.c, as novatek_test does. - ipcinfo (STANDALONE_LIBRARY) takes the type from the fuse's data bits, which is the type verbatim on a clean fuse; ipctool keeps BL1's single-bit correction, and axera_test checks that one against BL1. - A type the SDK does not list is named by the family, ax620e.
|
The arm32 failure was the 61e6699 brings it to 51931 -> 52927 (+996), and Where the bytes went, and what changed:
The budget is unchanged. |
Adds an Axera vendor HAL so
ipcinforecognises Axera AX620E and AX620U cameras.axera,ax620e(AX620E/AX630C/AX620Q) andaxera,ax620x(what the AX620U camera's own devicetree says, mapped to theax620ufamily OpenIPC builds). Registered on both the ARM and arm64 paths, since AX620E runs an arm64 kernel.axeraadded to the optional libipchw vendors.Why it matters: OpenIPC's vendor init only runs the chip's driver loader (
load_axera) whenipcinfo -vnames the vendor; without this it printedgeneric/unknownand the Axera media drivers never loaded.Tested inside OpenIPC firmware images for both chips (OpenIPC/firmware#2670) on the OpenIPC/qemu-bench
ax620eandax620umachines:ipcinfo -v/-c/-fprintaxera/ax620e/ax620e(sensor sc450ai) andaxera/ax620u/ax620u, and init loads all vendor modules. Not yet run on real hardware.