Skip to content

fh8626v100: build its own toolchain, with 4.19 headers - #2804

Closed
difanz wants to merge 7 commits into
OpenIPC:masterfrom
difanz:fullhan/fh8626-toolchain
Closed

difanz wants to merge 7 commits into
OpenIPC:masterfrom
difanz:fullhan/fh8626-toolchain

Conversation

@difanz

@difanz difanz commented Nov 9, 2026

Copy link
Copy Markdown

Problem

After the move to the 4.19 kernel, fh8626v100_lite still borrows the FH8852V200 toolchain, whose 4.9 kernel headers predate UAPI the 4.19 drivers use, such as the HEVC pixel format. This adds the board to the toolchain workflow, so that it publishes toolchain.fullhan-fh8626, and builds against that with 4.19 headers.

Stacked on the board PR (fh8626v100: move to the fullhan-fh8626 4.19 kernel). The toolchain workflow has to be dispatched once, after this merges or from this branch, before CI can fetch the new toolchain.

Hardware tested on

FH8626V100, fh8626v100_lite image built with a locally built toolchain.fullhan-fh8626 (GCC 13.3, musl, 4.19 headers). It is the same image as in the board PR's evidence.

Evidence

See the board PR: that image was built with this commit applied.

The fh8626-arc remoteproc driver in OpenIPC/linux's fullhan-fh8626
kernel loads /lib/firmware/fh8626-arc.elf onto the FH8626V100's ARC.
This is the minimal firmware for it, in ARC600 assembly: a resource
table with two 32-entry vrings, the rpmsg-arc-echo name service and an
echo endpoint at address 1024. It checks every descriptor against the
shared DMA pool and reports a bad one as a crash, on doorbell bit 1,
which it keeps set until the driver resets the core.

arc-binutils builds the arc-elf32 assembler and linker for it from the
binutils sources Buildroot already uses.
rda-wlan carries a second driver, rdawlan-rda5995, for Linux 4.19. It
takes its firmware from /lib/firmware instead of compiling it in. Make
the driver a choice. The default stays the existing rdawlan build at
its current pin, so no board that selects the package changes. The new
choice installs only the station images the driver loads.
The FH8626V100 ISP driver in the kernel exports per-frame zone
statistics and its tuning controls through its V4L2 subdevice, but
nothing closes the loop: without it the sensor stays at its initial
exposure and the ISP at unity white balance. The daemon meters the
statistics and drives the sensor's exposure and gain and the ISP's
white balance, noise reduction and black level, next to whichever
application streams from the capture device.
On the 4.19 kernel the FH8626V100 media, audio and remaining SoC
drivers are modules bound from the device tree, and mdev does not load
modules for devices present at boot. Provide the family's load_fullhan:
it loads the modules the devices ask for. The device tree also reserves
the media and ARC memory, so the kernel needs all of the DDR; an
environment saved with the 4.9 SDK kernel's osmem 29M is raised once,
and the camera rebooted.
The FH8626V100 media and audio drivers are V4L2 and ALSA drivers in the
kernel, which divinus streams from when built with DIVINUS_V4L2. Build
it that way with alsa-lib when the board's driver package is selected,
and install a start script, since divinus is the only streamer there.
The board built the FH8852V200 4.9 kernel with an FH8626 config. That
kernel has no FH8626V100 media, audio or ARC drivers, so the image had
no streamer, and the only wireless firmware it carried was for a dongle
the kernel has no driver for.

Build OpenIPC/linux's fullhan-fh8626 kernel, whose drivers are V4L2,
ALSA and remoteproc drivers in the tree, with its device tree appended
to the uImage, and the FH8852V200 toolchain. Select divinus as the
streamer, the 3A daemon, the ARC firmware, the driver loader and the
RDA5995 driver for 4.19. The kernel reserves U-Boot's
boot counter, so select openipc-failsafe as well, which clears it once
the camera is up.

The kernel config is the kernel's fh8626_defconfig less what a camera
has no use for: ext4, swap, the VT console and PS/2 input, IPsec
transforms and signed regulatory database support. cfg80211 and the
V4L2 core are modules, loaded with the drivers that need them. That
takes the uImage from 2025K to 1678K of its 2048K.
The board borrowed the FH8852V200 toolchain, whose 4.9 kernel headers
predate UAPI the 4.19 kernel's drivers use, such as the HEVC pixel
format. Add the board to the toolchain workflow, so that it publishes
toolchain.fullhan-fh8626, and build against that with 4.19 headers.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Give FH8626V100 a 4.19 toolchain and complete camera support

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

Grey Divider

AI Description

• Build FH8626V100 with its own toolchain, 4.19 headers, and matching kernel configuration.
• Add V4L2 streaming, automatic camera controls, ARC firmware, and Linux 4.19 Wi-Fi support.
• Load board drivers at boot and document the camera daemon’s operation and limits.
Diagram

graph TD
  W["Toolchain workflow"] --> T["FH8626 toolchain"] --> B["Board image"] --> K["4.19 kernel"]
  K --> D["V4L2 and ALSA"] --> C["3A daemon"]
  D --> S["Divinus streamer"]
  B --> F["ARC firmware"]
  C --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Embed camera controls in Divinus
  • ➕ One process could coordinate capture and camera controls.
  • ➖ Couples exposure and white balance to a particular streamer and prevents other capture clients from using the same control loop.
2. Stage toolchain migration and camera features separately
  • ➕ Smaller reviews and clearer isolation of build failures from runtime camera behavior.
  • ➖ The intermediate board image would lack some of the support needed to exercise the new kernel end to end.

Recommendation: Keep the independent V4L2 statistics daemon: capture ownership remains with the streamer, and camera controls can work alongside other clients. Given the size and hardware sensitivity of the additions, consider staging the toolchain migration and runtime features as separately reviewable changes; publish the new toolchain before requiring CI to fetch it.

Files changed (34) +8103 / -10

Enhancement (23) +4312 / -2
Config.inSelect ALSA for FH8626 Divinus builds +1/-0

Select ALSA for FH8626 Divinus builds

• Makes ALSA available when Divinus is selected with the FH8626 driver-loading package.

general/package/divinus/Config.in

divinus.mkEnable FH8626 V4L2 and ALSA streaming +7/-0

Enable FH8626 V4L2 and ALSA streaming

• Adds an FH8626-specific Divinus build branch with ALSA linkage and the V4L2 compile definition. Installs a SysV service script for that branch.

general/package/divinus/divinus.mk

S95divinusStart Divinus as a board service +33/-0

Start Divinus as a board service

• Adds SysV start, stop, and restart commands with a PID file for the FH8626 streamer.

general/package/divinus/files/S95divinus

Config.inDeclare the FH8626 camera-control daemon +8/-0

Declare the FH8626 camera-control daemon

• Exposes a package for userspace automatic exposure and white balance using the kernel ISP subdevice.

general/package/fh8626-3ad/Config.in

fh8626-3ad.mkBuild and install the 3A daemon +31/-0

Build and install the 3A daemon

• Compiles the daemon against the selected kernel’s UAPI headers and installs its binary, defaults, and SysV service. Declares the kernel as a build dependency.

general/package/fh8626-3ad/fh8626-3ad.mk

S80fh8626-3adManage 3A startup and shutdown +116/-0

Manage 3A startup and shutdown

• Waits for the FH8626 ISP and a supported sensor before starting the daemon with explicit camera defaults. Provides PID-aware stop, restart, and status operations.

general/package/fh8626-3ad/files/S80fh8626-3ad

ae-controller.cImplement frame-aware automatic exposure +653/-0

Implement frame-aware automatic exposure

• Meters grid luminance with shadow and highlight constraints, compensates for delayed control effects, and allocates integration and gain. Adds stability hysteresis, anti-flicker quantization, and optional slow-shutter allocation.

general/package/fh8626-3ad/src/ae-controller.c

ae-controller.hDefine AE configuration, state, and interface +132/-0

Define AE configuration, state, and interface

• Defines sensor control ranges, exposure history, frame-delay and slow-shutter settings, meter results, and functions used by the daemon.

general/package/fh8626-3ad/src/ae-controller.h

awb-controller.cImplement statistics-driven white balance +357/-0

Implement statistics-driven white balance

• Estimates illuminant chroma from eligible grid cells and edges, constrains white-point estimates to a reference locus, and smooths gain changes. Also provides a gray-world mode.

general/package/fh8626-3ad/src/awb-controller.c

awb-controller.hDefine AWB modes and controller state +62/-0

Define AWB modes and controller state

• Declares white-balance gain limits, reference locus, estimates, confidence, and the controller interface.

general/package/fh8626-3ad/src/awb-controller.h

fh8626-3ad.cConnect ISP frame events to camera control loops +1657/-0

Connect ISP frame events to camera control loops

• Discovers subdevices, reads kernel grid statistics, and coordinates AE, AWB, motion estimation, and ISP tuning without owning video capture. Handles control changes, frame timing, delayed writes, daemon lifecycle, and observation mode.

general/package/fh8626-3ad/src/fh8626-3ad.c

fh8626-3ad.hDefine shared grid and numeric utilities +110/-0

Define shared grid and numeric utilities

• Provides the reduced 16-by-16 statistics-grid representation, logging helpers, defaults, and fixed-point function declarations shared by the controllers.

general/package/fh8626-3ad/src/fh8626-3ad.h

isp-tuning.cSchedule ISP tuning from gain and white balance +547/-0

Schedule ISP tuning from gain and white balance

• Adds GC1054-oriented black-level, noise-reduction, sharpening, saturation, gamma, and color-correction tuning. Interpolates calibration tables and writes supported V4L2 controls when their target values change.

general/package/fh8626-3ad/src/isp-tuning.c

isp-tuning.hDefine ISP tuning state and API +51/-0

Define ISP tuning state and API

• Declares supported tuning blocks, cached control values, profile state, and the initialization and per-frame update interface.

general/package/fh8626-3ad/src/isp-tuning.h

Config.inExpose ARC RPMsg firmware +10/-0

Expose ARC RPMsg firmware

• Adds the ARC firmware package and selects the host assembler/linker needed to build it.

general/package/fh8626-arc-firmware/Config.in

fh8626-arc-firmware.mkPackage the ARC remoteproc ELF +22/-0

Package the ARC remoteproc ELF

• Builds the local firmware with host ARC binutils and installs fh8626-arc.elf where the kernel remoteproc driver loads it.

general/package/fh8626-arc-firmware/fh8626-arc-firmware.mk

MakefileAssemble and link ARC600 firmware +17/-0

Assemble and link ARC600 firmware

• Defines assembler and linker commands to produce the firmware ELF from its assembly source and linker script.

general/package/fh8626-arc-firmware/src/Makefile

firmware.SImplement an ARC RPMsg echo endpoint +417/-0

Implement an ARC RPMsg echo endpoint

• Adds a resource table, two virtqueues, name-service announcement, and an echo endpoint. Validates shared-memory descriptors and reports fatal errors through diagnostics and a crash doorbell.

general/package/fh8626-arc-firmware/src/firmware.S

firmware.ldPlace ARC code and remoteproc resources +21/-0

Place ARC code and remoteproc resources

• Locates vectors, program code, the resource table, diagnostics, and data within the ARC private-memory region.

general/package/fh8626-arc-firmware/src/firmware.ld

Config.inDeclare FH8626 driver initialization +8/-0

Declare FH8626 driver initialization

• Exposes the board package that loads kernel modules and adjusts the bootloader’s memory setting.

general/package/fullhan-osdrv-fh8626/Config.in

fullhan-osdrv-fh8626.mkInstall the FH8626 loader +18/-0

Install the FH8626 loader

• Packages the board’s load_fullhan script without bundling a vendor SDK or separate driver binaries.

general/package/fullhan-osdrv-fh8626/fullhan-osdrv-fh8626.mk

Config.inOffer a Linux 4.19 RDA5995 driver choice +22/-2

Offer a Linux 4.19 RDA5995 driver choice

• Adds the firmware-loading rdawlan-rda5995 driver as an alternative while retaining the existing built-in-firmware driver as the default.

general/package/rda5995-openipc/Config.in

rda5995-openipc.mkPackage the selected RDA5995 driver and firmware +12/-0

Package the selected RDA5995 driver and firmware

• Builds the Linux 4.19 driver from its separate module directory when selected and installs its station firmware. Leaves the original module build path in place for other boards.

general/package/rda5995-openipc/rda5995-openipc.mk

Bug fix (1) +29 / -0
load_fullhanLoad device-tree modules and restore available memory +29/-0

Load device-tree modules and restore available memory

• Sets U-Boot osmem to 64M and reboots when an older saved value is present. Loads modules for existing sysfs device aliases that mdev would otherwise miss at boot.

general/package/fullhan-osdrv-fh8626/load_fullhan

Documentation (2) +296 / -0
README.mdDocument 3A algorithms and operating boundaries +275/-0

Document 3A algorithms and operating boundaries

• Explains ISP statistics, exposure and white-balance behavior, motion-aware tuning, slow shutter, service options, and CLI controls. Records GC1054-specific calibration and scene types that have not been validated.

general/package/fh8626-3ad/src/README.md

LICENSELicense the ARC firmware source +21/-0

License the ARC firmware source

• Adds the MIT license text for the new firmware.

general/package/fh8626-arc-firmware/src/LICENSE

Other (8) +3466 / -8
ci-matrix.pyCorrect the FH8626 toolchain-sharing comment +3/-2

Correct the FH8626 toolchain-sharing comment

• Removes FH8626V100 from a comment claiming it shares the FH8852V200 kernel and toolchain. The other edit only reformats the package list.

.github/scripts/ci-matrix.py

toolchain.ymlInclude FH8626V100 in toolchain builds +1/-0

Include FH8626V100 in toolchain builds

• Adds fh8626v100_lite to the workflow’s board list so a dedicated toolchain can be published.

.github/workflows/toolchain.yml

fh8626v100.generic.configAdd the FH8626 Linux 4.19 kernel configuration +3389/-0

Add the FH8626 Linux 4.19 kernel configuration

• Adds a generated Linux 4.19.325 ARM configuration under the board’s new SoC family. It replaces the board’s former 4.9 configuration with settings for the FH8626 kernel and its supported devices.

br-ext-chip-fullhan/board/fh8626/fh8626v100.generic.config

fh8626v100_lite_defconfigSwitch the lite image to FH8626’s 4.19 stack +14/-6

Switch the lite image to FH8626’s 4.19 stack

• Selects 4.19 external-toolchain headers and the fh8626 family, and sets the appended-DTB uImage load address. Enables Divinus, the 3A daemon, ARC firmware, driver loading, failsafe, and the Linux 4.19 RDA5995 driver instead of the former MT7601 firmware selection.

br-ext-chip-fullhan/configs/fh8626v100_lite_defconfig

Config.inExpose the new FH8626 packages +4/-0

Expose the new FH8626 packages

• Sources the ARC host-binutils, camera daemon, ARC firmware, and FH8626 driver-loading package configurations.

general/package/Config.in

Config.inDeclare host ARC binutils +8/-0

Declare host ARC binutils

• Adds the host-only package symbol needed to assemble and link bare-metal ARC firmware.

general/package/arc-binutils/Config.in

arc-binutils.mkBuild an ARC assembler and linker on the host +37/-0

Build an ARC assembler and linker on the host

• Reuses Buildroot’s binutils sources and version, targeting arc-elf32. Builds and installs GAS and LD for the firmware package.

general/package/arc-binutils/arc-binutils.mk

fh8626-3ad.defaultSet service defaults for automatic controls +10/-0

Set service defaults for automatic controls

• Enables AE and AWB by default and sets a 12.5 fps slow-shutter floor. Documents how to relinquish actuator ownership for manual control.

general/package/fh8626-3ad/files/fh8626-3ad.default

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. FH8626 cameras start without media drivers 🐞 Bug ≡ Correctness
Description
fullhan-osdrv-fh8626 installs load_fullhan but provides no boot hook to call its -i
module-loading path. On a normal boot, S35modules loads only the two entries in /etc/modules, so
the modular FH8626 media and sensor drivers are absent when the 3A daemon and Divinus start.
Code

general/package/fullhan-osdrv-fh8626/fullhan-osdrv-fh8626.mk[R13-15]

+define FULLHAN_OSDRV_FH8626_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(FULLHAN_OSDRV_FH8626_PKGDIR)/load_fullhan \
+		$(TARGET_DIR)/usr/bin/load_fullhan
Evidence
The only package install command places the loader in /usr/bin, and its module scan requires an
explicit -i. The shared boot scripts do not invoke it; the existing module list lacks the FH8626
drivers, which the new kernel config builds as modules.

general/package/fullhan-osdrv-fh8626/fullhan-osdrv-fh8626.mk[13-16]
general/package/fullhan-osdrv-fh8626/load_fullhan[18-24]
general/overlay/etc/init.d/rcS[19-25]
general/overlay/etc/init.d/S35modules[5-15]
general/overlay/etc/modules[1-2]
br-ext-chip-fullhan/board/fh8626/fh8626v100.generic.config[1716-1720]
general/package/fh8626-3ad/files/S80fh8626-3ad[40-59]

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 FH8626 module loader is installed but never invoked at boot, leaving camera services without their modular drivers.
## Fix Focus Areas
- general/package/fullhan-osdrv-fh8626/fullhan-osdrv-fh8626.mk[13-16]
- general/package/fullhan-osdrv-fh8626/load_fullhan[18-24]
## Recommended Fix
Install an init script that invokes `load_fullhan -i` before S80fh8626-3ad and S95divinus, and verify that the required devices appear on a fresh boot.

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



Remediation recommended

2. Camera gain changes can be overwritten 🐞 Bug ≡ Correctness
Description
process_ae() applies pending gain writes before handling the sensor control events that signal
another client's change. When a capture client changes a control during the default three-frame gain
delay, the daemon can write its older queued gain before resync_ae() reads the client's new
setting.
Code

general/package/fh8626-3ad/src/fh8626-3ad.c[R1054-1060]

+	uint32_t old_dgain = ae->current_digital_gain;
+	uint32_t lines;
+	int ret;
+
+	loop->frames++;
+	if (!check_exposure_auto(isp_fd, sensor_fd, ae_cli_enabled)) {
+		/* Manual: follow the controls for the tuning, resync on return. */
Evidence
The main loop reads sensor events before calling process_ae(), but that function writes pending
gains before consuming those events. Its event handler calls resync_ae() only afterward, and the
default gain delay creates the pending-write window.

general/package/fh8626-3ad/src/fh8626-3ad.c[1597-1604]
general/package/fh8626-3ad/src/fh8626-3ad.c[1054-1077]
general/package/fh8626-3ad/src/fh8626-3ad.c[1009-1024]
general/package/fh8626-3ad/src/ae-controller.c[136-148]

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

## Issue description
Pending AE gain writes run before queued external control changes are handled and can overwrite a capture client's newer setting.
## Fix Focus Areas
- general/package/fh8626-3ad/src/fh8626-3ad.c[1054-1077]
## Recommended Fix
Handle external control events and resynchronize or discard stale pending gains before applying any queued gain write.

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


3. Exposure changes mistime black correction 🐞 Bug ≡ Correctness
Description
isp_tuning_update() receives ae.current_exposure_lines, which ae_controller_commit() replaces
as soon as it commands a new exposure. During an exposure transition, the black-level table can
therefore be selected for an integration time that has not yet reached the frames being tuned.
Code

general/package/fh8626-3ad/src/fh8626-3ad.c[R1627-1630]

+			isp_tuning_update(&tuning, gain, again,
+					  (uint32_t)((uint64_t)ae.current_exposure_lines *
+						     ae.config.line_time_ns / 1000),
+					  wb[0], wb[1], wb[2], m);
Evidence
AE history explicitly accounts for a delayed effective exposure, but the tuning call instead
converts the immediately updated current exposure into microseconds. Black-level selection depends
on that supplied exposure.

general/package/fh8626-3ad/src/ae-controller.c[136-148]
general/package/fh8626-3ad/src/ae-controller.c[205-235]
general/package/fh8626-3ad/src/fh8626-3ad.c[1610-1630]
general/package/fh8626-3ad/src/isp-tuning.c[205-221]
general/package/fh8626-3ad/src/isp-tuning.c[379-389]

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

## Issue description
Black-level tuning uses the newly commanded exposure instead of the exposure effective for the frames receiving that tuning.
## Fix Focus Areas
- general/package/fh8626-3ad/src/fh8626-3ad.c[1617-1630]
- general/package/fh8626-3ad/src/ae-controller.c[205-239]
## Recommended Fix
Expose the effective exposure from AE history and select it for the frame at which the ISP tuning change takes effect.

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


4. White-balance read failures go unnoticed 🐞 Bug ◔ Observability
Description
process_awb() returns without logging when read_gains() fails during resynchronization, while
its caller has no error result to check. If that control read keeps failing while frame statistics
remain readable, the daemon continues running with cached white-balance gains and no diagnostic for
the failed read.
Code

general/package/fh8626-3ad/src/fh8626-3ad.c[R1115-1118]

+		}
+		if (!loop->isp_events && read_digital_gain(isp_fd, ae) < 0)
+			return -1;
+	}
Evidence
The failed read exits the void AWB function without a diagnostic; the main loop subsequently copies
the controller's cached gains for AE and tuning.

general/package/fh8626-3ad/src/fh8626-3ad.c[1115-1122]
general/package/fh8626-3ad/src/fh8626-3ad.c[1560-1593]

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

## Issue description
A failed white-balance gain read silently leaves the daemon using cached gains.
## Fix Focus Areas
- general/package/fh8626-3ad/src/fh8626-3ad.c[1115-1122]
- general/package/fh8626-3ad/src/fh8626-3ad.c[1560-1593]
## Recommended Fix
Propagate or log the gain-read error with its cause, and prevent the caller from treating cached gains as successfully synchronized.

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



Informational

5. A failed gain write leaves exposure mismatched 🐞 Bug ☼ Reliability
Description
apply_ae() writes V4L2_CID_EXPOSURE first, then returns early if the analogue or ISP gain write
fails, without putting the exposure back. The daemon's cleanup restores only VBLANK, so after a
single failed control write the sensor keeps the new exposure with the old gain, and the image stays
over- or under-exposed after the daemon exits.
Code

general/package/fh8626-3ad/src/fh8626-3ad.c[R988-996]

+		loop->gain_pending = true;
+		loop->gain_wait = ae->config.exposure_delay - ae->config.gain_delay;
+		loop->pending_again = ae->target_analog_gain;
+		if (!loop->gain_wait && write_again(sensor_fd, loop) < 0)
+			return -1;
+	}
+	if (ae->target_digital_gain != ae->current_digital_gain) {
+		loop->dgain_pending = true;
+		loop->dgain_wait = ae->config.exposure_delay - ae->config.digital_gain_delay;
Evidence
The exposure is written at lines 979-983, and the function returns on gain failures at lines
988-996. The cleanup at lines 1648-1653 restores only the nominal VBLANK, not the exposure or gain.

general/package/fh8626-3ad/src/fh8626-3ad.c[975-1000]
general/package/fh8626-3ad/src/fh8626-3ad.c[1640-1657]

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

## Issue description
`apply_ae()` writes the new exposure before the gains. If a gain write fails, it returns without restoring the previous exposure, and cleanup restores only VBLANK.

## Fix Focus Areas
- general/package/fh8626-3ad/src/fh8626-3ad.c[975-1000]
- general/package/fh8626-3ad/src/fh8626-3ad.c[1640-1657]

## Recommended Fix
If the analogue or ISP gain write fails, write the previously applied exposure back before returning. Alternatively, have cleanup restore the last consistent exposure/gain pair as well as VBLANK.

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


6. Unlisted sensors stall boot and get no AE 🐞 Bug ☼ Reliability
Description
The S80fh8626-3ad start loop treats a sensor as ready only if its subdevice name matches one of five
hardcoded prefixes (gc1054, gc2053, jxf37, sp2306, sp1405). On an FH8626V100 camera with any other
sensor, boot blocks for 10 seconds and then the daemon is not started, so the sensor stays at its
initial exposure.
Code

general/package/fh8626-3ad/files/S80fh8626-3ad[R48-51]

+                case "$name" in
+                    fh8626-isp*) isp_ready=1 ;;
+                    gc1054\ *|gc2053\ *|jxf37\ *|sp2306\ *|sp1405\ *) sensor_ready=1 ;;
+                esac
Evidence
sensor_ready is set only by the case arm on line 50. Otherwise the loop sleeps 10 times and the
script exits with FAIL (lines 41-60). S80 runs synchronously during boot.

general/package/fh8626-3ad/files/S80fh8626-3ad[40-60]

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 init script recognises only five sensor names. Any other sensor causes a 10 s boot stall and AE never starts.

## Fix Focus Areas
- general/package/fh8626-3ad/files/S80fh8626-3ad[40-60]

## Recommended Fix
Find the sensor subdevice through the media graph or by its V4L2 entity function rather than a hardcoded list, or let the daemon find the sensor itself. At minimum, document the list and log which subdevices were seen when it fails.

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


Grey Divider

Context sources
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: 🧠 Deep: Many independent risky sites: new C daemons, ARC firmware, shared load script, toolchain flags.
ⓘ  4 issues published inline · 6 in summary

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai

Copy link
Copy Markdown
Collaborator

The change itself looks right: toolchain.mk already maps BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19 to BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19. But #2803 isn't buildable without this commit (its evidence image used these headers), and this branch repeats everything in #2803. Please fold this commit into #2803 and close this one, so one PR builds the board.

Before CI can pass, toolchain.yml needs to run once from that branch so that toolchain/toolchain.fullhan-fh8626.tgz exists. The other prerequisites are listed in the review on #2803.

@difanz

difanz commented Nov 9, 2026

Copy link
Copy Markdown
Author

Folded into #2803 as asked; the toolchain change is now part of its board commit.

@difanz difanz closed this Nov 9, 2026
@difanz
difanz deleted the fullhan/fh8626-toolchain branch November 9, 2026 20:40
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