Skip to content

t23_lite_vstarcam-c8622: add the Vstarcam C8622 board - #278

Draft
PeterBeklemishev wants to merge 5 commits into
OpenIPC:masterfrom
PeterBeklemishev:vstarcam-c8622
Draft

PeterBeklemishev wants to merge 5 commits into
OpenIPC:masterfrom
PeterBeklemishev:vstarcam-c8622

Conversation

@PeterBeklemishev

@PeterBeklemishev PeterBeklemishev commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Ingenic T23 + GC1084, AIC8800DC USB wifi, 8MB NOR.

Pan/tilt and the IR-cut filter hang off a GC6153F 5-channel driver (dual SPI/I2C chip, wired in i2c mode at 0x10, bit-banged on PB21/PB20 from userspace): the new gc6153 package initialises the chip at boot, and a majestic-af patch adds the gc6153 actuator, which also swings the ircut by watching the nightMode lamp pin. The board pins majestic-af ahead of the firmware's pin (3852baf, needs the ptzpos position hook) via a package .mk override; drop it once the firmware pin catches up. IR lamp on GPIO61, white lamp on GPIO50, both gated by the shared PB17 brightness line; speaker amp on GPIO63.

WiFi builds from openipc/aic8800 (pinned 0e218ed6) through an aic8800-openipc .mk override that also installs the repo's fw/aic8800DC into /lib/firmware, so no prebuilt modules or firmware blobs ship in the overlay; the /etc/wireless/usb arm modprobes the modules and reports wlan0 only when it appears, so a unit without the radio falls back to the wired port.

  • адекватно настроить автопереключение ночь-день чот в этот подход не получилось
  • веб не везде корректно отображает что иркат управляется не через гпио напрямую
  • веб не отображает что птз у нас есть но через модуль к маджестик-аф
  • веб отображает что есть зум-фокус но их на самом деле нет

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

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

Copy link
Copy Markdown

PR Summary by Qodo

Add OpenIPC support for the Vstarcam C8622 camera

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add a T23/GC1084 firmware profile for the C8622’s 8 MB NOR flash.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 6 capabilities

  • 6 affected capabilities span independent functional scopes: c8622_camera_control, c8622_camera_imaging, c8622_device_recovery, c8622_firmware_integration, c8622_wireless_integration.
  • The changed defconfig, package overrides, environment file and runtime overlays jointly produce and boot one board-specific firmware image; they are implementation hops of the same image capability.
  • The sensor kernel module, sensor-info registration, YAML metadata and runtime sensor selection all serve the single end-to-end outcome of producing C8622 camera frames.
  • The profile, driver package, firmware files and persistent wlandev selection form one bounded wireless integration; they do not independently implement separate user outcomes.
  • The actuator registration, stepping thread, homing, position state and GC6153 init utility jointly implement the camera's pan/tilt outcome across build and runtime components.
  • IR-cut switching and IR/white lamp control are separate user-visible outcomes within the same bounded camera-control integration; the source connects them through the GC6153 and night-mode GPIO configuration.
  • The startup hook, GPIO mapping and reset daemon form one bounded physical-reset operation; it is independent of video, wireless and PTZ outcomes because it changes device configuration rather than media or motion output.
Sources

devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig[41-45]

BR2_OPENIPC_SOC_VENDOR="ingenic"
BR2_OPENIPC_SOC_MODEL="t23"
BR2_OPENIPC_SOC_FAMILY="t23"
BR2_OPENIPC_SNS_MODEL="gc1084"
BR2_OPENIPC_VARIANT="lite"

devices/t23_lite_vstarcam-c8622/general/package/ingenic-osdrv-t23/files/sensor/gc1084.yaml[1-6]

sensor:
  name: gc1084
  address: 0x37
  width: 1280
  height: 720
  bus: i2c

devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk[15-19]

define AIC8800_OPENIPC_INSTALL_FW
	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib/firmware/aic8800DC
	$(INSTALL) -m 0644 $(@D)/fw/aic8800DC/* $(TARGET_DIR)/lib/firmware/aic8800DC/
endef
AIC8800_OPENIPC_POST_INSTALL_TARGET_HOOKS += AIC8800_OPENIPC_INSTALL_FW
Behavioral complexity 🔴 High 🧩 Multiple interactions

  • Before, this board had no GC6153 actuator path.
  • After, a background thread coordinates homing, persisted position, command generations, counted and continuous moves, soft limits, motor stopping and lamp-driven IR-cut pulses.
  • New correctness conditions: position must remain consistent with interrupted bursts and reboot recovery; PTZ commands must not race homing or stop cleanup; lamp transitions must not corrupt shared I2C/motor state.
  • The use of pthreads alone is not the basis for complexity; these newly interacting state and ordering rules are.
Potential damage 🔴 High 🩹 Integrity

  • If the button is miswired, falsely read, or the threshold logic regresses, an unintended firstboot can erase persistent device configuration.
  • This is a concrete persistent-state integrity failure, not merely temporary unavailability; the source does not establish automatic restoration of erased settings.
  • Reverting prevents new reset invocations, but already erased configuration requires manual reprovisioning or a backup.
  • Reverting code cannot restore settings already removed by firstboot.
Assessed commit fe97655
Diagram

graph TD
  B["C8622 profile"] --> S["GC1084 driver"] --> M["Majestic video"] --> A["GC6153 actuator"] --> G["Motor and IR-cut"]
  B --> W["AIC8800 package"] --> U["USB radio profile"] --> N["Network interface"]
  B --> M
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use a kernel-managed I²C bus for GC6153F
  • ➕ Avoids duplicate userspace bit-banging and direct /dev/mem GPIO access.
  • ➕ Provides a single bus owner for initialization and PTZ.
  • ➖ Requires kernel pin and adapter integration for this board.
  • ➖ Adds kernel-level work where no adapter currently owns those pins.
2. Wait for upstream Majestic plugin support
  • ➕ Eliminates the compatibility shim and board-specific Majestic pin.
  • ➕ Reduces the long-term maintenance of private actuator integration.
  • ➖ Delays usable PTZ and IR-cut support on the current published binary.
  • ➖ Still requires a GC6153F actuator implementation.

Recommendation: The board-local integration is a practical route to working hardware now. Treat the Majestic pin and symbol shim as temporary, and consider a kernel-managed I²C bus if this transport is reused or GPIO ownership becomes problematic.

Files changed (19) +4524 / -0

Enhancement (6) +4201 / -0
usbLoad the C8622 AIC8800 USB radio with wired fallback +478/-0

Load the C8622 AIC8800 USB radio with wired fallback

• Provides the USB wireless profile script, including the C8622 arm that loads AIC8800 dependencies and waits for wlan0. It fails when the interface never appears so network startup can use Ethernet; the script also contains profiles for other boards.

devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb

resetd.shMonitor a configured GPIO for factory reset +38/-0

Monitor a configured GPIO for factory reset

• Polls the reset-button pin, invokes firstboot after a sustained press, and exits when the board has no valid button pin configured.

devices/t23_lite_vstarcam-c8622/general/overlay/usr/sbin/resetd.sh

0001-add-gc1084-for-t23.patchAdd a GC1084 sensor driver to the T23 OpenSDK +1381/-0

Add a GC1084 sensor driver to the T23 OpenSDK

• Adds the 1280×720 GC1084 kernel driver, sensor metadata and proc support, and a sensor-detection entry. The driver handles initialization, exposure, frame rate, and image orientation.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch

0001-gc6153-actuator-and-shim.patchIntegrate GC6153F pan, tilt, and IR-cut with majestic-af +1417/-0

Integrate GC6153F pan, tilt, and IR-cut with majestic-af

• Adds a GC6153 actuator with homing, position tracking, soft limits, movement control, and lamp-triggered IR-cut operation. Includes configuration and motion helpers, compatibility symbols for the published Majestic binary, and test-linkage stubs.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch

S65gc6153Initialize the GC6153F and park lamp lines at boot +29/-0

Initialize the GC6153F and park lamp lines at boot

• Runs the chip’s power-on initialization, enables the shared lamp-brightness line, and switches both lamps off. Its stop action switches off the lamps.

package/gc6153/files/etc/init.d/S65gc6153

gc6153.cImplement GC6153F register and GPIO control +858/-0

Implement GC6153F register and GPIO control

• Implements userspace GPIO-backed I²C, the vendor chip initialization and motor sequences, IR-cut pulses, and one-shot lamp GPIO control. Also provides register access and hardware diagnostic commands.

package/gc6153/src/gc6153.c

Bug fix (1) +21 / -0
yaml-cli.mkPin yaml-cli before its scalar-write regression +21/-0

Pin yaml-cli before its scalar-write regression

• Selects a known-working revision so CLI writes used by board customization preserve Majestic settings.

devices/t23_lite_vstarcam-c8622/general/package/yaml-cli/yaml-cli.mk

Other (12) +302 / -0
t23_lite_vstarcam-c8622_defconfigDefine the C8622 T23 lite firmware build +73/-0

Define the C8622 T23 lite firmware build

• Selects the MIPS T23 kernel and toolchain, GC1084 sensor, 8 MB NOR layout, Wi-Fi and GC6153 packages, and Majestic PTZ web UI.

devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig

fw_env.configSet the board’s U-Boot environment location +2/-0

Set the board’s U-Boot environment location

• Points firmware-environment tools at the 64 KiB environment sector on /dev/mtd1.

devices/t23_lite_vstarcam-c8622/general/overlay/etc/fw_env.config

rc.localLaunch the board reset-button monitor +17/-0

Launch the board reset-button monitor

• Starts resetd.sh in the background after multiuser startup.

devices/t23_lite_vstarcam-c8622/general/overlay/etc/rc.local

customizer.shApply C8622 camera, PTZ, and network defaults +66/-0

Apply C8622 camera, PTZ, and network defaults

• Sets the upgrade URL, AIC8800 profile, GC1084 sensor, Majestic video and audio settings, lamp GPIOs, and gc6153 PTZ actuator. Configures memory reservations and reboots after customization.

devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh

gpio.confRecord the board’s GPIO assignments +19/-0

Record the board’s GPIO assignments

• Defines IR and white lamp and speaker pins while marking reset, LEDs, and GPIO-driven IR-cut as unavailable.

devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf

muxes.shProvide a no-op board mux script +7/-0

Provide a no-op board mux script

• Supplies the expected board hook without changing pin muxes.

devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh

aic8800-openipc.mkPin and package the AIC8800 driver and firmware +22/-0

Pin and package the AIC8800 driver and firmware

• Builds the driver from a fixed openipc/aic8800 commit and installs its AIC8800DC firmware under /lib/firmware instead of placing prebuilt blobs in the overlay.

devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk

gc1084.yamlDescribe the GC1084 sensor +6/-0

Describe the GC1084 sensor

• Registers its I²C address and 1280×720 dimensions for the T23 sensor package.

devices/t23_lite_vstarcam-c8622/general/package/ingenic-osdrv-t23/files/sensor/gc1084.yaml

majestic-af.mkPin majestic-af to the required position-hook revision +20/-0

Pin majestic-af to the required position-hook revision

• Overrides the package revision with a fixed commit containing the position hook required by the GC6153 actuator patch.

devices/t23_lite_vstarcam-c8622/general/package/majestic-af/majestic-af.mk

t23_lite.listTrim unused modules from the lite image +32/-0

Trim unused modules from the lite image

• Excludes selected I²C, USB networking and serial, and F2FS kernel modules. The sensor entries shown are commented out.

devices/t23_lite_vstarcam-c8622/general/scripts/excludes/t23_lite.list

Config.inExpose the GC6153 userspace package +19/-0

Expose the GC6153 userspace package

• Adds a MIPS-targeted Buildroot option describing the board’s bit-banged GC6153F tool and boot initialization.

package/gc6153/Config.in

gc6153.mkBuild and install the GC6153 command-line tool +19/-0

Build and install the GC6153 command-line tool

• Compiles the local C source for the target and installs the executable and init script into the root filesystem.

package/gc6153/gc6153.mk

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. New board is missing from the README device table ✓ Resolved Bug Correctness
Description
The PR adds a new device, t23_lite_vstarcam-c8622, with its defconfig declaring the SoC and model
(BR2_OPENIPC_SOC_MODEL="t23"), but no change to README.md appears in the PR's file list. The
device therefore will not appear in the documented device inventory, so users and maintainers
looking for supported boards will not find the Vstarcam C8622. This is a clear miss under the README
rule, not an ambiguous case.

2. Frame-rate zero can crash the kernel 🐞 Bug ☼ Reliability
Description
sensor_set_fps() divides by the low 16 bits of fps before checking whether the requested rate is
valid. If the sensor FPS ioctl supplies zero or another value with a zero denominator, execution
reaches integer division by zero in the sensor module.
Code

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[594]

++	newformat = (((fps >> 16) / (fps & 0xffff)) << 8) + ((((fps >> 16) % (fps & 0xffff)) << 8) / (fps & 0xffff));
Evidence
The ioctl passes its integer argument directly to sensor_set_fps; that function divides by its low
16 bits before its range check.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[583-610]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[756-758]

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 new GC1084 FPS handler divides by the supplied FPS denominator before validating it.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[583-610]
## Recommended Fix
Reject a zero numerator or denominator before calculating `newformat` or `vts`, then apply the supported-rate check.

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


3. Sensor files remain after module unload 🐞 Bug ☼ Reliability
Description
sensor_common_init() creates procfs files backed by callbacks and a heap context, but
exit_sensor() only unregisters the I²C driver. When the GC1084 module is unloaded, those entries
and their callback pointers remain, and a later read can reach unloaded module code.
Code

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[R1026-1028]

++static __exit void exit_sensor(void) {
++	private_i2c_del_driver(&sensor_driver);
++}
Evidence
Initialization allocates a context and registers per-sensor and legacy proc entries with module
callbacks, while the sole exit operation is I²C-driver removal.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[1014-1028]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[1162-1170]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[1186-1248]

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 GC1084 module creates procfs entries but leaves them installed when the module exits.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[1014-1028]
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[1150-1249]
## Recommended Fix
Track the created entries and remove them, including legacy entries, before module unload; free the associated context and handle partial creation failures.

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



Remediation recommended

4. Stopping video leaves the sensor running 🐞 Bug ≡ Correctness
Description
sensor_stream_off_mipi contains only the end sentinel, so sensor_s_stream() and the
prepare-change ioctl return without writing a stop command. Whenever the ISP disables streaming or
prepares a configuration change, the driver reports success without stopping sensor output.
Code

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[R378-379]

++static struct regval_list sensor_stream_off_mipi[] = {
++	{SENSOR_REG_END, 0x00},
Evidence
The array writer stops at the end sentinel, which is the first element of both arrays; the stream
and configuration-change callbacks use those arrays.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[374-380]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[442-454]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[571-580]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[750-755]

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

## Issue description
Both GC1084 stream-control arrays are empty, so disabling or resuming the stream performs no sensor writes.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[374-380]
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[571-580]
## Recommended Fix
Populate the on and off arrays with the appropriate GC1084 stream-control register sequences and propagate write failures through both stream and configuration-change paths.

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


5. WiFi never comes up because the driver module name is wrong 🐞 Bug ≡ Correctness
Description
The aic8800-t23-vstarcam-c8622 branch runs modprobe aic8800 || exit 1, while the sibling AIC8800
USB profile loads the function driver as aic8800_fdrv. If the pinned build does not provide an
aic8800 module, the branch exits before checking for wlan0 and network setup takes the wired
fallback even on a unit with the radio; the noted test unit had been converted to ethernet.
Code

devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[R464-465]

+	modprobe aic_load_fw || exit 1
+	modprobe aic8800 || exit 1
Evidence
The board selects the new wireless profile, whose final modprobe uses aic8800 and exits on
failure before the wlan0 check. The existing broadband profile uses the same openipc/aic8800
driver source but loads aic8800_fdrv, making the new module name suspect; the customizer also
notes that the test unit was converted to ethernet.

devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[275-279]
devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[460-476]
devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh[49-53]
devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh[10-12]
devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[275-278]
devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[461-475]

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 C8622 Wi-Fi profile loads `aic8800` instead of the function-driver module used by the sibling AIC8800 USB profile. If the pinned build does not install a module by that name, it exits before checking for `wlan0` and network setup takes the wired fallback.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb[461-476]
## Recommended Fix
List the `.ko` files installed under `/lib/modules` by the pinned openipc/aic8800 commit, then replace `modprobe aic8800` with the actual USB function-driver module name, likely `aic8800_fdrv`. Retain the interface-appearance check and wired fallback, and test the profile on a unit with the radio.

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


6. Slow motor settings make pan/tilt bursts end early 🐞 Bug ≡ Correctness
Description
gc_burst_ms computes (long)steps * c->step_us * gc_period(...) in long, which is 32 bits on
mipsel. With the accepted config limits (step_us up to 20000, chunk up to 1023, period up to
485) the product reaches about 9.9e9 and overflows. A negative or wrapped duration makes
run_burst/home_burst skip their pacing loop and report the burst done straight away. The next
command is then sent while the chip is still stepping, homing finishes early and the position count
drifts. Any step_us above roughly 4300 at slow speed triggers this.
Code

devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[R1305-1310]

++long gc_burst_ms(const GcConfig *c, int steps, int chip_speed) {
++    // step_us is calibrated at the chip's speed 10 (period 245); the run
++    // stretches with the period. Rounded up: a deadline set from this must
++    // never expire while the chip is still stepping.
++    long us = (long)steps * c->step_us * gc_period(c, chip_speed) / 245;
++    return (us + 999) / 1000;
Evidence
The config parser accepts step_us up to 20000 and chunk up to 1023. gc_period returns up to 485.
gc_burst_ms multiplies these in long, which is 32-bit on this MIPS target, and both pacing loops
use the result as their deadline.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[1236-1240]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[1295-1311]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[612-629]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[719-733]

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

## Issue description
`gc_burst_ms` multiplies steps × step_us × period in 32-bit `long` on mipsel. This overflows within the accepted config range, so the burst pacing loops end immediately. The interrupted-burst math in `home_burst` (`left_ms * 1000 * 245`) has the same risk.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[1305-1311]
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/majestic-af/0001-gc6153-actuator-and-shim.patch[623-625]
## Recommended Fix
Do the arithmetic in `long long` or `int64_t`, e.g. `int64_t us = (int64_t)steps * c->step_us * gc_period(c, chip_speed) / 245;`, and return the result clamped to LONG_MAX. Change the done-steps calculation in `home_burst` the same way. Regenerate the patch so the hunk counts stay correct.

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



Informational

7. Sensor driver reports a wrong chip ID 🐞 Bug ≡ Correctness
Description
sensor_detect() validates both chip-ID bytes but never stores the high byte in *ident, appending
only the low byte to the zero-initialized value. Detection succeeds, but chip->ident is reported
to logs and callers as 0x84 rather than SENSOR_CHIP_ID (0x1084).
Code

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[R479-481]

++		return -ENODEV;
++
++	*ident = (*ident << 8) | v;
Evidence
The declared chip ID is 0x1084, and the caller initializes the ID value to zero. Neither read
stores the high byte in *ident; the only assignment shifts that zero value and ORs in the low byte
before the result is published.

devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[461-484]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[78-82]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[461-481]
devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[668-711]

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

## Issue description
`sensor_detect()` in the GC1084 driver validates both chip-ID bytes but builds `*ident` from only the low byte, reporting `0x84` instead of `0x1084`.
## Fix Focus Areas
- devices/t23_lite_vstarcam-c8622/general/package/all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch[461-482]
## Recommended Fix
Assign the validated high byte to `*ident` immediately after its check passes, then retain `*ident = (*ident << 8) | v;` after the low-byte check. Update the patch hunk line count to account for the added line.

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


Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@PeterBeklemishev

Copy link
Copy Markdown
Contributor Author

ai agent reply about sensor issues:

2, 3, 4, 7 (gc1084 sensor driver) — the driver follows the shared sensor template from OpenIPC/openingenic (https://github.com/OpenIPC/openingenic) (kernel/sensors/* —
~300 drivers with the same sensor_common_init / set_fps / detect structure); only the GC1084 register table is board-specific, taken from the camera's stock firmware. The
flagged patterns are template-wide, so patching them in this one driver would diverge it from every sibling — if worth fixing, that belongs in openingenic itself, not in a
board-addition PR.

  1. modprobe aic8800 — correct as pinned: at OpenIPC/aic8800@0e218ed6 the fdrv Makefile sets MODULE_NAME = aic8800, so the built module is aic8800.ko (image has
    extra/aic8800_fdrv/aic8800.ko + a matching modules.dep entry). The aic8800_fdrv name in the ssc337de arm predates the upstream rename (daf2e4e). WiFi is now also validated
    on a second C8622 unit: wlan0 associates and gets DHCP.

@openipc-ai

Copy link
Copy Markdown
Contributor

The GC1084 driver and its tuning are now going upstream, so this board no longer needs to carry them:

I pushed bd999de to this branch. It removes all-patches/ingenic-opensdk/0001-add-gc1084-for-t23.patch and the board's gc1084.yaml. Once openingenic has the driver, that patch no longer applies, because it creates the same files. The yaml is the same as firmware's. The board keeps its gc1084-t23.bin: that's the camera's stock tune (the same bytes as Vstarcam's stock T23 firmware), and it overrides the SDK one through the device overlay.

So the merge order is openingenic#58, then firmware#2997, then this PR. Until #58 merges, this branch won't build the sensor module.

I checked that the three build together by doing what builder.sh does by hand: firmware#2997's branch, builder's package/, this board's files at bd999de, and openingenic#58 through INGENIC_OPENSDK_OVERRIDE_SRCDIR:

- firmware.bin: [6528KB/7616KB]
- uImage: [1501KB/2048KB read by the bootloader]
target/etc/sensor/gc1084-t23.bin   (the board's stock tune)
target/etc/sensor/gc1084.yaml
target/lib/modules/3.10.14__isvp_pike_1.0__/ingenic/sensor_gc1084_t23.ko

I also booted that image in qemu-bench's t23 machine with an emulated GC1084, which isn't in qemu-bench yet. load_ingenic detects the sensor, loads the module, and libimp delivers frames on both channels. That covers only the plumbing. It needs a run on your C8622 to confirm video still looks as it did with your patch. The 44 us row time is the one change that could show up in exposure or anti-flicker behaviour.

@openipc-ai

Copy link
Copy Markdown
Contributor

Everything this board needed from upstream is now merged:

With these merged, this PR needs nothing beyond its own device files and the gc6153 package. A board build of the current head should pick up the driver from openingenic master and the yaml from firmware master.

@PeterBeklemishev
PeterBeklemishev force-pushed the vstarcam-c8622 branch 6 times, most recently from f763347 to 050f127 Compare November 29, 2026 10:44
PeterBeklemishev added a commit to PeterBeklemishev/oipc-firmware that referenced this pull request Nov 29, 2026
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, 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; only the aic8800DC entry exists for now, the chip on the one
board that selects this package (Vstarcam C8622, OpenIPC/builder#278),
and further variants join as sibling entries when a board needs them.

Tested on the C8622 through the identical hook carried as a device
override in OpenIPC/builder#278: with the blobs in /lib/firmware the
chip probes, loads fmacfw_patch_8800dc_h_u02.bin and associates. The
stock-package build here selects DC by default and installs the same
19 files.
PeterBeklemishev added a commit to PeterBeklemishev/oipc-firmware that referenced this pull request Nov 29, 2026
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, 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; only the aic8800DC entry exists for now, the chip on the one
board that selects this package (Vstarcam C8622, OpenIPC/builder#278),
and further variants join as sibling entries when a board needs them.

Tested on the C8622 through the identical hook carried as a device
override in OpenIPC/builder#278: with the blobs in /lib/firmware the
chip probes, loads fmacfw_patch_8800dc_h_u02.bin and associates. The
stock-package build here selects DC by default and installs the same
19 files.
PeterBeklemishev added a commit to PeterBeklemishev/oipc-firmware that referenced this pull request Nov 29, 2026
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.

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a0d9e31 together with OpenIPC/firmware#3003. It is much tidier than before: the driver and the tuning come from upstream, the PTZ work has its own branch, and the defconfig is t23_lite plus four lines.

First, a correction to my comment above. It says this board replaces the generic gc1084-t23.bin with the camera's stock tune, and since this push it doesn't.

  1. Video with the SDK tune. The board now ships the generic gc1084-t23.bin from firmware#2997 (Ingenic SDK 1.3.0). The "video-ok" in the README was seen with the stock tune. Please re-check video, day and night, on this head and say so here. If it holds, that is the first camera evidence for firmware#2997's file.
  2. general/overlay/etc/wireless/usb replaces the shared script with a 476-line copy that is already stale.
    • Firmware master has since added rt2800usb-generic and the XM232 ATBM arm, and changed the Xiongmai V200 arm. The builder's cp -af drops all of that for this board, along with every later change.
    • Better to add the arm to the firmware's shared file, for instance in #3003, under a generic name like aic8800-usb. Then remove the copy here.
    • modprobe mac80211 can also go: the driver is FullMAC and needs only cfg80211.
  3. resetd.sh and the rc.local that starts it duplicate the firmware's reset-button package, which reads the same button=58 from gpio.conf. BR2_PACKAGE_RESET_BUTTON=y replaces both files. Its timing is the shared one: 5–15 s reboots, 15–30 s runs firstboot.
  4. aic8800-openipc.mk override: drop it once #3003 merges, as the commit says. Until then it has the same unpinned HEAD as the stock package.
  5. Excludes list: the 22 commented #/etc/sensor/... lines can go. A board build installs only gc1084's yaml and bin, so they could never match anything.

The selector skips drafts, so CI hasn't built this board yet. It will once the PR is marked ready.

Suggested order: #3003 first (pinned, ideally with the Wi-Fi arm), then this PR without the aic8800 override and the wireless/usb copy.

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes, as detailed in my review above (#278 (review)). Blocking: confirm video, day and night, with the generic SDK gc1084-t23.bin this head ships, and drop the stale full copy of /etc/wireless/usb (move the arm to the firmware's shared file instead).

Ingenic T23 + GC1084, AIC8800DC USB wifi, 8MB NOR.

GC1084 support is entirely upstream: the sensor driver from
openingenic HEAD (added for t23 in OpenIPC/openingenic#58), and
gc1084.yaml with the ISP tuning bin from firmware#2997.

IR lamp on GPIO61, white lamp on GPIO50, both gated by the shared
PB17 brightness line that muxes.sh holds high; speaker amp on
GPIO63; reset button on GPIO58.

WiFi builds from openipc/aic8800 through an aic8800-openipc .mk
override that tracks the same HEAD as the stock package and only
adds installing the repo's fw/aic8800DC into /lib/firmware, so no
prebuilt modules or firmware blobs ship in the overlay; the
/etc/wireless/usb arm modprobes the modules and reports wlan0 once
it appears.

Pan/tilt and the IR-cut filter hang off a GC6153F stepper driver
chip this profile does not drive yet; the gc6153 userspace package
and the majestic-af actuator patch are staged on the
vstarcam-c8622-ptz branch.
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.
@PeterBeklemishev

PeterBeklemishev commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

current state:

This branch has not been deployed

No deployments
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