Repository navigation
ambarella: s3l: build for the Cortex-A9, load the drivers at boot - #2764
Conversation
s3l_lite_defconfig targeted a Cortex-A7 with VFPv4. The S3L is a Cortex-A9 with NEON and VFPv3 (cpuinfo in OpenIPC/ipctool#266: part 0xc09, features "neon vfpv3"). With those flags gcc emits sdiv and vfma, which an A9 does not have, so a plain integer division can take SIGILL. The A9 flags call __aeabi_idiv for the same code. Buildroot resolves the new config to -mcpu=cortex-a9 -mfpu=neon.
load_ambarella was an empty file, so S70vendor ran it and nothing came up. It now loads iav and what it needs, then the sensor, then the DSP microcode, which is the vendor's order. iav registers no device class, so mdev never makes /dev/iav or /dev/ucode and the script does. The sensor comes from the environment, or from ipcinfo. The microcode and load_ucode are Ambarella's and are not in this package: the script uses them if present, and says video will not start if not.
PR Summary by QodoTarget S3L’s Cortex-A9 and load Ambarella drivers at boot
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. CPU target change reaches the whole image unverified
|
Device nodes are now root-only: nothing needs them world-writable. A stored sensor=unknown no longer stops detection, the same way load_goke handles it. Exact driver names are accepted. A bare imx290 or imx326 still means MIPI, since ipcinfo cannot tell the interface, and the LVDS drivers are reached with imx290_lvds and imx326_lvds.
Two S3L fixes that came out of the review of #2763.
CPU target.
s3l_lite_defconfigtargeted a Cortex-A7 with VFPv4, but the S3L is a Cortex-A9 with NEON and VFPv3 (cpuinfoin OpenIPC/ipctool#266). With the old flags gcc emitssdivandvfma, which an A9 doesn't have, so ordinary code can take SIGILL.load_ambarella. The script was 0 bytes, soS70vendorran it and nothing loaded. It now does the following, in the vendor's order:iav;modprobepulls indsp,hw_timer,imgprocandvout./dev/iavand/dev/ucode, root-only, becauseiavregisters no device class and mdev never sees them.sensorfrom the environment oripcinfo -s. A storedunknownfalls through to detection. A bare name means MIPI, becauseipcinfocan't tell the interface;imx290_lvdsandimx326_lvdsreach the LVDS drivers.load_ucode /lib/firmwareif the tool and microcode are present.This does not produce video on its own. The microcode isn't in this package, and it needs a licensing decision. The stock
load_ucodeis a glibc armhf binary that won't run on this musl image.s3l_lite_defconfigselects no streamer, and #2763 lists more that video needs: the board's device tree, a 3A process, an exact 30 fps VIN and an ISP configuration. The author plans PRs for those. Without them the drivers load, the DSP stays down, and the script logs that video will not start.Hardware evidence
s3l_lite./proc/devicesshowing248 iavand248 ucode, andmodules.depresolvingiavtohw_timer imgproc vout dsp.ov4689_mipineeds no arguments.BR2_cortex_a9NEON build with H.264 after a warm reboot, but that is a glibc armhf toolchain, not this musl softfp one. A cold boot doesn't stream yet.Tested here
-mcpu=cortex-a9 -mfpu=neon. Before, it wascortex-a7andneon-vfpv4.sdivandvfma.f64, and the A9 flags call__aeabi_idiv.dashwith stubbed commands, 15 cases: load order, node creation and mode, each sensor spelling, storedunknown, unsupported and missing sensors, and no microcode.iavfailing ran on the previous commit, and that code didn't change.Not tested: a full
s3l_liteimage build, its size before and after, and a run of a binary built with the new flags. No toolchain is published yet (#2765).