Repository navigation
aic8800-openipc: install the firmware for specific aic8800 version - #3003
Conversation
PR Summary by QodoInstall AIC8800DC firmware with the wireless driver package
AI Description
Merge Risk
|
Code Review by Qodo
1. Firmware change lacks hardware evidence
|
3c1f99f to
d808d95
Compare
The driver loads its firmware with plain file opens (the repo builds with CONFIG_USE_FW_REQUEST=n) from aic_fw_path, /lib/firmware by default, appending the variant directory itself, but the package installed only the modules. A board that selects it therefore gets a wlan driver that cannot probe: rwnx_load_firmware fails to open fmacfw_patch_8800dc_h_u02.bin and the USB probe errors out. Install the blobs for a chip variant the board picks in a new Kconfig choice, as atbm-wifi does for its models; fw/ carries four variants totalling 5.5 MB, more than an 8 MB NOR board can spare, so one is shipped. The aic8800DC path is hardware-tested on the Vstarcam C8622 (OpenIPC/builder#278, through the identical hook carried as a device override there): the chip probes, loads fmacfw_patch_8800dc_h_u02.bin and associates. The other three entries install the fw/ directory the driver asks for but have no board to test on yet.
d808d95 to
94981e6
Compare
|
@qodo-free-for-open-source-projects @openipc-ai |
|
/review |
openipc-ai
left a comment
There was a problem hiding this comment.
The code is right. I checked it against openipc/aic8800 at 0e218ed:
- The firmware is opened as a plain file. The top-level Makefile exports
CONFIG_PLATFORM_UBUNTU=y, which makesaic_default_fw_path/lib/firmwarerather than/vendor/etc/firmware. - The variant directory is appended by the driver:
aic8800DCinrwnx_platform.c,aic8800D80andaic8800D80X2in the compat files, andaic8800inaic_load_fw. Those are exactly the four choice entries. - Shipping one of the four (about 5.6 MB together) is the right call for 8 MB NOR.
- No board in OpenIPC/builder master selects
BR2_PACKAGE_AIC8800_OPENIPC, so the DC default changes no existing image.
Before merge:
- Pin the source (Qodo #3 is valid). With
AIC8800_OPENIPC_VERSION = HEAD, the blobs in/lib/firmwarechange whenever upstream does. Please pin the commit you tested:AIC8800_OPENIPC_VERSION = 0e218ed686ee04a3006bb142ca70450dfa72f4d2 - Untick "New code is selected by a defconfig, so CI actually builds it." No defconfig here selects the package, and
.github/scripts/ci-matrix.pylistsaic8800-openipcinNOT_BUILT. CI built 13 boards and none of them ran the new hook. Say instead that its only user is OpenIPC/builder#278 and that you built it there. - The PR body.
- The Problem section and both Before/After blocks are empty; the evidence sits above the template.
- Please move the probe-failure log into "Before", and the
rwnx_load_firmware/ association lines from the C8622 into "After". - The paragraph starting "Adjust the 'Hardware tested on' ticking…" reads as a note to you, not to reviewers.
- That covers Qodo #1 too. The hardware claim itself is fine: the same hook, in #278, ran on the camera.
- Consider moving the board's Wi-Fi profile here.
- #278 carries a full copy of
general/overlay/etc/wireless/usbjust to add itsaic8800-t23-vstarcam-c8622arm, and that copy is already behind master. It lacksrt2800usb-genericand the XM232 ATBM arm, and has the old Xiongmai V200 arm. - The arm has nothing T23-specific, so it can sit next to
aic8800-ssc337de-broadbandin the shared file, under a generic name such asaic8800-usbthat other boards can use. modprobe mac80211can go from it: the aic8800 driver is FullMAC and calls no mac80211 functions, so loading it only costs RAM.
- #278 carries a full copy of
Small things:
- The DC entry's help could say it also covers the AIC8800DW; the driver uses
aic8800DCfor both chip IDs. ifneq ($(AIC8800_OPENIPC_FW_DIR),)is always true, because the choice always has one entry selected.- Qodo #2, the stale directory after switching variants: an incremental build after a config change is not supported in Buildroot anyway. I wouldn't do anything about it.
openipc-ai
left a comment
There was a problem hiding this comment.
Requesting changes, as detailed in my review above (#3003 (review)). Blocking: pin AIC8800_OPENIPC_VERSION to 0e218ed686ee04a3006bb142ca70450dfa72f4d2 instead of HEAD; untick the defconfig/CI box, since no defconfig here selects the package and CI never ran the hook; and fill the Problem and Before/After sections with the logs you already have.
HEAD makes the tarball unfetchable to reproduce and rebuilds can silently pick up a moved master. Pin to current master 0e218ed.
|
Thanks, the pin, the unticked CI box and the Problem/Before sections cover three of the four blocking items. What's left is After: it still describes the result instead of showing it. Please paste the C8622's dmesg lines from a boot of this build: aic8800 loading |
Baseus P1 Pro, the AK3918AV100X pan/tilt camera: SmartSens SC5336 on 2-lane MIPI, AIC8800D80 USB Wi-Fi, 8 MB NOR, microSD, two GPIO steppers, IR-cut, IR LEDs, red and blue LEDs, reset button. Everything common is upstream, so the profile only names it: - the kernel: the generic AV100X config with the board's device tree (OpenIPC/linux, ak3918av100x-baseus-s0tv022132) and gpio-leds; - the sensor: sensor_sc5336.ko built from source by anyka-opensdk-ak3918av100 (OpenIPC/firmware), so no vendor module is shipped; the ISP tuning is the stock firmware's, unmodified (sha256 13b66407...); - Wi-Fi: aic8800-openipc with its D80 chip variant, powered up on GPIO 98 by the board's /etc/wireless/usb profile; - pan/tilt: gpiostep (pins in /etc/modules, in the stock motor driver's half-step order) driven by majestic-af, travel from the stock driver's limits in /etc/gpiostep.conf; - the reset button (GPIO 3) through reset-button and gpio.conf; - day/night on the ISP gain (no light sensor on the board), IR-cut on 4/8, IR LEDs on 70, seeded by customizer.sh. Needs OpenIPC/linux (the device tree) and OpenIPC/firmware (anyka-opensdk-ak3918av100, and aic8800-openipc's chip variants, OpenIPC/firmware#3003). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Baseus P1 Pro, the AK3918AV100X pan/tilt camera: SmartSens SC5336 on 2-lane MIPI, AIC8800D80 USB Wi-Fi, 8 MB NOR, microSD, two GPIO steppers, IR-cut, IR LEDs, red and blue LEDs, reset button. Everything common is upstream, so the profile only names it: - the kernel: the generic AV100X config with the board's device tree (OpenIPC/linux#345, ak3918av100x-baseus-s0tv022132) and gpio-leds; - the sensor: sensor_sc5336.ko built from source by anyka-opensdk-ak3918av100 (OpenIPC/firmware), so no vendor module is shipped; the ISP tuning is the stock firmware's, unmodified (sha256 13b66407...); - Wi-Fi: aic8800-openipc with its D80 chip variant, powered up on GPIO 98 by the board's /etc/wireless/usb profile; - pan/tilt: gpiostep (pins in /etc/modules, in the stock motor driver's half-step order) driven by majestic-af, travel from the stock driver's limits in /etc/gpiostep.conf; - the reset button (GPIO 3) through reset-button and gpio.conf; - day/night on the ISP gain (no light sensor on the board), IR-cut on 4/8, IR LEDs on 70, seeded by customizer.sh. Needs OpenIPC/linux#345 (the device tree) and OpenIPC/firmware (anyka-opensdk-ak3918av100, and aic8800-openipc's chip variants, OpenIPC/firmware#3003). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Baseus P1 Pro, the AK3918AV100X pan/tilt camera: SmartSens SC5336 on 2-lane MIPI, AIC8800D80 USB Wi-Fi, 8 MB NOR, microSD, two GPIO steppers, IR-cut, IR LEDs, red and blue LEDs, reset button. Everything common is upstream, so the profile only names it: - the kernel: the generic AV100X config with the board's device tree (OpenIPC/linux#345, ak3918av100x-baseus-s0tv022132) and gpio-leds; - the sensor: sensor_sc5336.ko built from source by anyka-opensdk-ak3918av100 (OpenIPC/firmware#3007), so no vendor module is shipped; the ISP tuning is the stock firmware's, unmodified (sha256 13b66407...); - Wi-Fi: aic8800-openipc with its D80 chip variant, powered up on GPIO 98 by the board's /etc/wireless/usb profile; - pan/tilt: gpiostep (pins in /etc/modules, in the stock motor driver's half-step order) driven by majestic-af, travel from the stock driver's limits in /etc/gpiostep.conf; - the reset button (GPIO 3) through reset-button and gpio.conf; - day/night on the ISP gain (no light sensor on the board), IR-cut on 4/8, IR LEDs on 70, seeded by customizer.sh. Needs OpenIPC/linux#345 (the device tree), OpenIPC/firmware#3007 (anyka-opensdk-ak3918av100) and OpenIPC/firmware#3003 (aic8800-openipc's chip variants). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The D80 entry now has a board behind it: the Baseus P1 Pro (AK3918AV100X, USB One thing for 8 MB boards: of the twelve files in |
openipc-ai
left a comment
There was a problem hiding this comment.
Approving. The install hook is the same for every variant; only the directory name changes, and aic8800DC is the name the driver appends for DC and DW (rwnx_platform.c). The D80 run on the Baseus P1 Pro (builder#282) shows this PR's hook working on hardware: the driver finds every file it asks for in /lib/firmware/aic8800D80 without an aic_fw_path override, and wlan0 associates. Thanks @echoechoechoechoechoechoechoecho.
A follow-up worth doing: a per-variant list of the files the driver actually loads, instead of the whole fw/<variant> directory. On D80, the _ipc images are only used with CONFIG_FOR_IPCAM, which the Makefiles turn off; _h_u02 is for the H revision; and the BLE filter goes unused. Dropping those three saves about 590 KiB of squashfs, which decides whether an 8 MB board fits.
OpenIPC/firmware#3003 taught the stock package to install the selected variant's firmware, pinned to the same 0e218ed, so the device override goes away and the defconfig just picks the DC variant.
A pan/tilt camera: Ingenic T41LQ (64 MiB), GC4023 on I2C0 at 0x21 with
its reset on PA18, AIC8800D40L Wi-Fi/BT on USB, RMII Ethernet, 16 MiB NOR
(XM25QH128C). Pin map from the stock firmware (motogpio.ko, sinfo.ko,
encoder, device tree) and checked on the board.
- Kernel: the generic T41 config on the marmot DT, which is tomcat with
the SD card-detect on PB27, as the stock DT has it.
- muxes.sh, on every boot:
- PC19 high powers the AIC8800; OpenIPC U-Boot leaves it low and the
module never shows up on USB.
- PC20 low powers the SD slot, then msc0 is re-bound so it probes the
card again: U-Boot leaves the slot off, and neither mmc-pwrseq nor a
gpio-hog brought the card up at boot on this kernel.
- PB28 pulsed low resets the Ethernet PHY: after U-Boot has brought it
up, Linux reads it over MDIO but gets no link until it is reset.
- The PHY extended register the stock ipcam.sh writes; resetd.sh.
- customizer.sh, once:
- osmem=40M with rmem=24M@0x2800000. With Wi-Fi up, the default 32/32
split left Linux about 5 MiB. U-Boot keeps rmem as its own variable,
so it moves with osmem or the video memory overlaps Linux's.
- video0 1920x1080, which fits 24 MiB of rmem.
- Day/night: IR-cut pin 1 = 50, pin 2 = 49 (the reverse put the
filter in at night), IR LEDs 82, light sensor 71, white light 81.
- Speaker amplifier 63; sensor I2C bus 0, reset 18.
- wlandev aic8800-generic; wlanmac = ethaddr with the local bit set,
or eth0 and wlan0 share one MAC and DHCP hands both one address.
- PTZ through gpio-motors (ptz_control=gpio). Each axis is listed in
reverse coil order, or the WebUI arrows move the head backwards.
- etc/sysctl.conf: the common file plus vm.min_free_kbytes = 2048,
vm.dirty_background_bytes = 512 KiB, vm.dirty_bytes = 2 MiB, as the
Tapo C210 v2 keeps its own. Linux has about 34 MiB: a full-speed write
to the SD card while streaming left ~5 MiB in writeback, MemFree at the
default watermark, and the OOM killer took majestic.
- etc/modprobe.d/aic8800.conf: ps_on=0. The driver enables Wi-Fi power
save by default and compiles out set_power_mgmt, so only the module
parameter turns it off; with it on, pings to the camera reached 510 ms
and SSH echo lagged, with it off 90 ms at most. aicwf_dbg_level=1 for
both modules: errors only. Their default info/debug/trace output, hundreds of
lines a boot at KERN_ERR, pushed the boot messages out of dmesg
and logread.
- etc/sensor/gc4023.yaml: address 0x21, where this board straps it.
- etc/modules: motor.ko is not loaded, gpio-motors owns the coil pins.
- resetd.sh and gpio.conf: taken from t23_lite_jooan-q3r-u (same button
GPIO 62). sleep 0.25 became usleep 250000, since busybox here has no
fractional sleep and the loop would spin. LED feedback on GPIO 57.
Bridge patches for aic8800 until OpenIPC/aic8800#3 is merged and firmware
moves its aic8800 pin (BR2_GLOBAL_PATCH_DIR): include linux/vmalloc.h
(the 4.4 build fails without it); no RX skb preallocation, 1000 x 20 KiB
at load, which ran the camera out of memory; flow control for
CONFIG_ONE_TXQ, which the board turns on
(BR2_PACKAGE_AIC8800_OPENIPC_ONE_TXQ): one netdev TX queue instead of
257, whose 257 uevents started 257 mdev processes at once and
OOM-killed majestic. Until firmware has that option, a fourth bridge sets
CONFIG_ONE_TXQ = y in the driver's Makefile for this board.
Uses BR2_PACKAGE_AIC8800_OPENIPC_D80 (OpenIPC/firmware#3003), which
installs the D80 firmware this AIC8800D40L runs, and needs the firmware
change adding the aic8800-generic Wi-Fi profile;
BR2_PACKAGE_AIC8800_OPENIPC_ONE_TXQ follows in firmware after
OpenIPC/aic8800#3. ipctool already takes this T41LQ,
which reports the T40 SoC family, as a T41 (OpenIPC/ipctool#300).
Tested on the camera: video, Ethernet, Wi-Fi at boot, IR-cut, IR LEDs,
light sensor, white light, pan/tilt from the WebUI, SD recording,
microphone, reset button. Speaker: the amplifier switches on, but
the internal codec gives no sound yet (under investigation). These ran on a firmware tree
whose board DT carried the PHY reset and card-detect; the move of those
two to marmot + muxes.sh, for builder, has not been booted yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The aic8800 driver loads its chip firmware with plain file opens (the repo builds with CONFIG_USE_FW_REQUEST=n) from aic_fw_path — /lib/firmware by default, with the variant directory appended by the driver itself — but the package installed only the kernel modules. A board selecting BR2_PACKAGE_AIC8800_OPENIPC therefore gets a wlan driver that cannot probe.
What this does: adds a Kconfig choice for the chip variant (same pattern as atbm-wifi's model selection) and installs the matching fw/ directory into /lib/firmware/ — the exact path the driver asks for. The four variants in fw/ total 5.5 MB, more than an 8 MB NOR board can spare, so exactly one is shipped. aic8800DC is the default as the chip on the one board selecting this package (Vstarcam C8622, OpenIPC/builder#278); D80, D80X2 and the original aic8800 join as selectable entries.
Evidence:
• Build, default config: BR2_PACKAGE_AIC8800_OPENIPC_DC=y auto-selected, 19 files installed into /lib/firmware/aic8800DC, image fits with room (6464/7616 KB).
• Build, BR2_PACKAGE_AIC8800_OPENIPC_D80X2=y: choice switches cleanly, 7 files in /lib/firmware/aic8800D80X2, no DC directory.
• Hardware (Vstarcam C8622, Ingenic T23N): with the same 19 blobs in /lib/firmware/aic8800DC — installed there by the identical hook carried as a device override in
OpenIPC/builder#278 — the chip probes, loads fmacfw_patch_8800dc_h_u02.bin, and associates to an AP.
• The D80/D80X2/aic8800 entries install the directory the driver requests but have no board behind them yet; only the DC path is hardware-tested.
Once this merges, OpenIPC/builder#278 drops its device override and rides the stock package.
Problem
AIC8800 chip variants require loading its firmware, current mk file does not copy required firmware files.
Hardware tested on
t23n (vstarcam c8622)
Evidence
Before:
aic8800 fw was not making it into firmware:
The package had no in-tree user until now, which is why this went unnoticed.
After:
Selecting Kconfig choice for the chip variant installs the matching fw/ directory into
/lib/firmware/
Scope
general/package/all-patches/linux/(those go to OpenIPC/linux)general/overlay/or in a sharedload_<vendor>script hardcodes a value specific to my boardLD_PRELOAD, and no binaries that cannot be rebuilt from source