From 25b50bf3323914fe12e07e172526d0d71cb4a751 Mon Sep 17 00:00:00 2001 From: Petr B Date: Sat, 28 Nov 2026 16:32:36 +0000 Subject: [PATCH 1/5] t23_lite_vstarcam-c8622: add the Vstarcam C8622 board 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. --- README.md | 2 +- .../configs/t23_lite_vstarcam-c8622_defconfig | 70 +++ .../general/overlay/etc/rc.local | 17 + .../general/overlay/etc/wireless/usb | 476 ++++++++++++++++++ .../general/overlay/usr/sbin/resetd.sh | 38 ++ .../overlay/usr/share/openipc/customizer.sh | 53 ++ .../overlay/usr/share/openipc/gpio.conf | 19 + .../overlay/usr/share/openipc/muxes.sh | 17 + .../aic8800-openipc/aic8800-openipc.mk | 22 + .../general/scripts/excludes/t23_lite.list | 32 ++ 10 files changed, 745 insertions(+), 1 deletion(-) create mode 100644 devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig create mode 100755 devices/t23_lite_vstarcam-c8622/general/overlay/etc/rc.local create mode 100755 devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb create mode 100755 devices/t23_lite_vstarcam-c8622/general/overlay/usr/sbin/resetd.sh create mode 100755 devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh create mode 100644 devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf create mode 100755 devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh create mode 100644 devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk create mode 100644 devices/t23_lite_vstarcam-c8622/general/scripts/excludes/t23_lite.list diff --git a/README.md b/README.md index c5b8fb909..a2af7ba96 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Vixand IVG-G6S GK7205V300 IMX335 - NOR_16M done Vixand IVG-G6S-W GK7205V300 IMX335 ATBM6032i_USB NOR_16M w/ext wifi board VStarcam C43S(B) SSC333 JXF37 MT7601U_USB NOR_16M in progress VStarcam CS55 T31N GC2053 RTL8188FU_USB NOR_16M in progress -VStarcam C8622 T23N SC2336P AIC8800DL_? NOR_8M **INIT** - in progress +VStarcam C8622 T23N GC1084 AIC8800DC_USB NOR_8M testing, video-ok, ir-ok, speaker-ok, wifi-ok, ptz/ircut - in progress (gc6153) XiongMai 85H50AI HI3516EV300 IMX335 - NOR_16M testing, motorized zoom+focus (pelco-xm) XiongMai HI3516D_N81820 HI3516DV100 IMX291 - NOR_16M testing, motorized zoom+focus (ms41908 SPI) XiongMai IPC_G6S 20X GK7205V300 IMX335 - NOR_16M untested, 20x zoom+focus (pelco-xm), board of Vixand IVG-G6S diff --git a/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig b/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig new file mode 100644 index 000000000..92a050761 --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig @@ -0,0 +1,70 @@ +# Architecture +BR2_mipsel=y +BR2_mips_xburst=y +# BR2_MIPS_SOFT_FLOAT is not set +BR2_MIPS_FP32_MODE_32=y + +# Toolchain +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/toolchain/toolchain.ingenic-t31.tgz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="mipsel-openipc-linux-musl" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t23.tar.gz" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t23.generic.config" +BR2_LINUX_KERNEL_LZMA=y + +# Filesystem +BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config" +BR2_PACKAGE_UBOOT_TOOLS=y +BR2_PACKAGE_ZLIB=y +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y +BR2_PACKAGE_WIREGUARD_TOOLS=y +BR2_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_SQUASHFS=y +BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y + +# OpenIPC +BR2_OPENIPC_SOC_VENDOR="ingenic" +BR2_OPENIPC_SOC_MODEL="t23" +BR2_OPENIPC_SOC_FAMILY="t23" +BR2_OPENIPC_SNS_MODEL="gc1084" +BR2_OPENIPC_VARIANT="lite" +BR2_OPENIPC_FLASH_SIZE="8" + +# Packages +BR2_PACKAGE_BWM_NG=y +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_INGENIC_OSDRV_T23=y +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LIBCURL_OPENIPC=y +BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y +# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set +BR2_PACKAGE_LIBEVENT_OPENIPC=y +BR2_PACKAGE_LIBOGG_OPENIPC=y +BR2_PACKAGE_MAJESTIC_FONTS=y +BR2_PACKAGE_MAJESTIC_WEBUI=y +BR2_PACKAGE_MAJESTIC=y +BR2_PACKAGE_MBEDTLS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_QUIRC_OPENIPC=y +BR2_PACKAGE_AIC8800_OPENIPC=y +BR2_PACKAGE_VTUND_OPENIPC=y +BR2_PACKAGE_YAML_CLI=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/etc/rc.local b/devices/t23_lite_vstarcam-c8622/general/overlay/etc/rc.local new file mode 100755 index 000000000..6434fec32 --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/etc/rc.local @@ -0,0 +1,17 @@ +#!/bin/sh +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + + +(resetd.sh >/dev/null 2>&1) & + +exit 0 diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb b/devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb new file mode 100755 index 000000000..e200e9692 --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/etc/wireless/usb @@ -0,0 +1,476 @@ +#!/bin/sh + +set_gpio() { + [ "$2" -eq 1 ] && gpio set $1 || gpio clear $1 + sleep 1 +} + +# Allwinner USB0 is OTG and can boot as a device. The manager settles on its +# role a few seconds after probe and would undo an earlier switch, so wait. +role=/sys/bus/platform/devices/usbc0/otg_role +if [ -e $role ]; then + i=0 + while [ "$(cat $role)" = null ] && [ $i -lt 10 ]; do + sleep 1 + i=$((i + 1)) + done + echo usb_host > $role +fi + +# Allwinner boards power the radio through sunxi-wlan, on the wlan_regon pin +# of their device tree. Power it once USB0 is a host, and give it time to +# enumerate before the profile loads its driver. +power=/sys/class/misc/sunxi-wlan/rf-ctrl/power_state +if [ -e $power ] && [ "$(cat $power)" = 0 ]; then + echo 1 > $power + sleep 2 +fi + +# Generic MT7601U +if [ "$1" = "mt7601u-generic" ]; then + modprobe mt7601u + exit 0 +fi + +# Generic RTL8188EU +if [ "$1" = "rtl8188eu-generic" ]; then + modprobe 8188eu + exit 0 +fi + +# Generic RTL8188FU +if [ "$1" = "rtl8188fu-generic" ]; then + modprobe 8188fu + exit 0 +fi + +# Generic RTL8733BU +if [ "$1" = "rtl8733bu-generic" ]; then + modprobe 8733bu + exit 0 +fi + +# Generic RTL8811CU +if [ "$1" = "rtl8811cu-generic" ]; then + modprobe 8821cu + exit 0 +fi + +# Generic RTL8812AU +if [ "$1" = "rtl8812au-generic" ]; then + modprobe 88XXau rtw_ht_enable=0 rtw_led_enable=0 + exit 0 +fi + +# Generic ATBM603x: atbm-wifi's module, or atbm603x-comb-openipc's +if [ "$1" = "atbm603x-generic-usb" ]; then + modprobe atbm603x_wifi_usb 2>/dev/null || modprobe atbm603x_comb_wifi_usb + exit 0 +fi + +# Generic ATBM6012B: atbm-wifi's module built for the 6012B. A mask of 0 +# quiets the driver's own log, as on the SDIO arms: left at its default it +# writes an error to the kernel log for every wireless-extensions ioctl it +# does not implement, which is one line per poll of the link (#2815). +if [ "$1" = "atbm6012b-generic-usb" ]; then + modprobe atbm6012b_wifi_usb atbm_printk_mask=0 + exit 0 +fi + +# Generic ATBM606x (Wi-Fi 6: ATBM6062, 6162, 6132-C) +if [ "$1" = "atbm606x-generic-usb" ]; then + modprobe atbm606x_wifi_usb + exit 0 +fi + +# Generic RDA5995 +# rdawfmac waits for its chip at load and fails when none attaches, so its +# status is whether there is a wlan0. +if [ "$1" = "rda5995-generic" ]; then + modprobe rdawfmac + exit $? +fi + +# GK7205V200 CamHi +if [ "$1" = "mt7601u-gk7205v200-camhi" ]; then + set_gpio 9 0 + modprobe mt7601u + exit 0 +fi + +# GK7205V300 CamHi +if [ "$1" = "mt7601u-gk7205v300-camhi" ]; then + devmem 0x100C0080 32 0x530 + set_gpio 7 0 + modprobe mt7601u + exit 0 +fi + +# GK7205V200 CamHi +if [ "$1" = "rtl8733bu-gk7205v200-camhi" ]; then + set_gpio 9 0 + modprobe 8733bu + exit 0 +fi + +# GK7205V200 Kafei +if [ "$1" = "8188fu-gk7205v200-kafei" ]; then + set_gpio 57 0 + modprobe 8188fu + exit 0 +fi + +# GK7205V300 CamHi +if [ "$1" = "rtl8733bu-gk7205v300-camhi" ]; then + devmem 0x100c0080 32 0x0 + set_gpio 7 0 + modprobe 8733bu + exit 0 +fi + +# GK7205V300 XM IVG-G6S +if [ "$1" = "atbm603x-gk7205v300-xm-g6s" ]; then + devmem 0x100C0080 32 0x530 + set_gpio 7 0 + modprobe atbm603x_wifi_usb + exit 0 +fi + +# AK3918EV300L gzhongshi HVT3610S3: an ATBM6012B on USB, powered from GPIO 70 +# (wifi_power in its stock firmware's dev_gpio.cfg) +if [ "$1" = "atbm603x-ak3918ev300l-hvt3610s3" ]; then + set_gpio 70 1 + modprobe atbm603x_wifi_usb 2>/dev/null || modprobe atbm603x_comb_wifi_usb + exit 0 +fi + +# GK7205V300 Vase +if [ "$1" = "rtl8811cu-gk7205v300-vase" ]; then + devmem 0x100c0080 32 0x0 + set_gpio 7 1 + modprobe 8821cu + exit 0 +fi + +# HI3516EV200 CamHi +if [ "$1" = "mt7601u-hi3516ev200-camhi" ]; then + set_gpio 9 0 + modprobe mt7601u + exit 0 +fi + +# HI3516EV300 CamHi +if [ "$1" = "mt7601u-hi3516ev300-camhi" ]; then + devmem 0x100C0080 32 0x530 + set_gpio 7 0 + modprobe mt7601sta + exit 0 +fi + +# HI3518EV100 CamHi +if [ "$1" = "mt7601u-hi3518ev100-camhi" ]; then + modprobe mt7601sta + exit 0 +fi + +# HI3518EV200 LifeSmart +if [ "$1" = "rtl8188fu-hi3518ev200-lifesmart" ]; then + set_gpio 54 1 + modprobe 8188fu + exit 0 +fi + +# HI3518EV200 Switcam HS303 (V1) +if [ "$1" = "rtl8188fu-switcam-hs303" ]; then + set_gpio 3 1 + modprobe 8188fu + exit 0 +fi + +# HI3518EV200 Lenovo Snowman 1080p +if [ "$1" = "rtl8188eus-hi3518ev200-lenovo" ]; then + devmem 0x200f006c 32 0 + modprobe 8188eu + exit 0 +fi + +# HI3518EV200 Qtech QVC-IPC-136W +if [ "$1" = "rtl8188eu-hi3518ev200-qvc-ipc-136w" ]; then + set_gpio 7 1 + modprobe 8188eu + exit 0 +fi + +# HI3518EV200 Switcam HS303 V2 +if [ "$1" = "rtl8188eus-switcam-hs303v2" ]; then + set_gpio 54 1 + modprobe 8188eu + exit 0 +fi + +# HI3518EV300 Unknown1 +if [ "$1" = "rtl8188fu-hi3518ev300-unknown1" ]; then + set_gpio 57 0 + modprobe mac80211 + modprobe 8188fu + exit 0 +fi + +# HI3518EV300 t5810hct-m02 +if [ "$1" = "rtl8188fu-hi3518ev300-t5810hct-m02" ]; then + set_gpio 40 1 + modprobe 8188fu + exit 0 +fi + +# SSC325DE IMOU C22EP-S2 +if [ "$1" = "rtl8188fu-ssc325de-imou-c22ep-s2" ]; then + set_gpio 62 1 + modprobe 8188fu + exit 0 +fi + +# SSC335DE IMOU C22E-S2 V2 +if [ "$1" = "rtl8188fu-ssc335de-imou-c22e-s2-v2" ]; then + set_gpio 14 0 + modprobe 8188fu + exit 0 +fi + +# SSC333 Babysense See HD IP206 +if [ "$1" = "rtl8188fu-babysense-see-hd-ip206" ]; then + set_gpio 14 1 + modprobe 8188fu + exit 0 +fi + +# SSC333 Meari Speed 6S +if [ "$1" = "rtl8188fu-ssc333-meari-speed-6s" ]; then + set_gpio 14 1 + modprobe 8188fu + exit 0 +fi + +# SSC333 Tapo C110 +if [ "$1" = "ssw101b-ssc333-tapo-c110" ]; then + set_gpio 16 1 + modprobe ssw101b_wifi_usb + exit 0 +fi + +# SSC333 Tapo C110 v2.6 +if [ "$1" = "atbm6012b-ssc333-tapo-c110" ]; then + set_gpio 16 1 + modprobe atbm6012b_wifi_usb atbm_printk_mask=0 + exit 0 +fi + +# SSC335DE Uniview C1L-2WN-G +if [ "$1" = "rtl8188fu-ssc335de-uniview-c1l-2wn-g" ]; then + set_gpio 1 0 + modprobe 8188fu + exit 0 +fi + +# SSC337DE BroadbandService +if [ "$1" = "aic8800-ssc337de-broadband" ]; then + modprobe aic8800_fdrv + exit 0 +fi + +# SSC337DE BroadbandService +if [ "$1" = "rtl8188fu-ssc337de-broadband" ]; then + set_gpio 2 0 + modprobe 8188fu + exit 0 +fi + +# SSC337DE Foscam +if [ "$1" = "rtl8188fu-ssc337de-foscam" ]; then + set_gpio 15 0 + modprobe 8188fu + exit 0 +fi + +# SSC377 Dahua +if [ "$1" = "ssv6x5x-ssc377-dahua" ]; then + set_gpio 10 1 + modprobe ssv6x5x + exit 0 +fi + +# T10 NVT +if [ "$1" = "mt7601sta-t10-nvt" ]; then + modprobe cfg80211 + modprobe mt7601sta + exit 0 +fi + +# T21 BJS +if [ "$1" = "rtl8188fu-t21-bjs" ]; then + set_gpio 50 0 + modprobe 8188fu + exit 0 +fi + +# T21 Smartwares +if [ "$1" = "rtl8188fu-t21-smartwares" ]; then + set_gpio 49 1 + modprobe 8188fu + exit 0 +fi + +# T31 Aoni EP01J05 +if [ "$1" = "rtl8188fu-t31-aoni-ep01j05" ]; then + set_gpio 43 1 + modprobe 8188fu + exit 0 +fi + +# T31 Aosu C5L +if [ "$1" = "rtl8188fu-t31-aosu-c5l" ]; then + set_gpio 43 0 + modprobe 8188fu + exit 0 +fi + +# T31 CamHi +# The T31 kernel has the vendor MT7601 STA driver built in +# (CONFIG_MT7601_STA, "wlan0"), so powering the dongle is all this needs: +# there is no mt7601u.ko to load, and mac80211, which this used to load, +# is not the stack that driver uses (#2412). +if [ "$1" = "mt7601u-t31-camhi" ]; then + set_gpio 61 0 + exit 0 +fi + +# T31 Camhipro +if [ "$1" = "rtl8733bu-t31-camhipro" ]; then + set_gpio 61 0 + modprobe 8733bu + exit 0 +fi + +# T31 iFlytek +if [ "$1" = "ssv6155-t31-iflytek" ]; then + set_gpio 10 1 + modprobe ssv6155 + exit 0 +fi + +# T31 iFlytek XFP301-M +if [ "$1" = "rtl8188fu-t31-iflytek-xfp301m" ]; then + set_gpio 10 1 + modprobe 8188fu + exit 0 +fi + +# T31 ZTE K540 +if [ "$1" = "atbm603x-t31-zte-k540" ]; then + set_gpio 51 0 + modprobe atbm603x_wifi_usb + exit 0 +fi + +# T31 Aoni E97VJ62 +if [ "$1" = "rtl8188fu-t31-aoni-e97vj62" ]; then + set_gpio 53 1 + modprobe 8188fu + exit 0 +fi + +# Xiongmai V200 series. The USB host is the vendor's dwc2 and xm_usb0, which +# load_xiongmai only loads after S40network, so the profile loads them. The +# dongle's power pad is cycled as the vendor's wifi_pdn.ko does: output high +# (off) for 2 s, then low (on) for 2 s; pad register 0x10020000 + 4 * pad. +# $1: power pad, 0 for none. $2: driver module. +xm_v200_wifi() { + modprobe dwc2 + modprobe xm_usb0 + if [ "$1" -gt 0 ]; then + pad=$(printf 0x%x $((0x10020000 + $1 * 4))) + devmem "$pad" 32 0xc00 + sleep 2 + devmem "$pad" 32 0x400 + sleep 2 + fi + modprobe "$2" || return 1 + # wlan0 appears once the dongle has enumerated and taken its firmware + i=0 + while [ ! -e /sys/class/net/wlan0 ] && [ $i -lt 10 ]; do + sleep 1 + i=$((i + 1)) + done + [ -e /sys/class/net/wlan0 ] +} + +# XM530V200 X6C-WEQ: ATBM6012B-X +if [ "$1" = "atbm603x-xm530v200-x6c-weq" ]; then + xm_v200_wifi 87 atbm603x_comb_wifi_usb + exit $? +fi + +# XM530V200 X2-WQ2: XM713G +if [ "$1" = "atbm603x-xm530v200-x2-wq2" ]; then + xm_v200_wifi 82 atbm603x_comb_wifi_usb + exit $? +fi + +# XM535D1 X6E-WEQ: ATBM6012B-X +if [ "$1" = "atbm603x-xm535d1-x6e-weq" ]; then + xm_v200_wifi 11 atbm603x_comb_wifi_usb + exit $? +fi + +# XM535D2 X9-WE2Q: ATBM6132CU, no power pad (the vendor passes 255) +if [ "$1" = "atbm606x-xm535d2-x9-we2q" ]; then + xm_v200_wifi 0 atbm606x_wifi_usb + exit $? +fi + +# XM535W1 X2W-WNG: ATBM6012B-X +if [ "$1" = "atbm603x-xm535w1-x2w-wng" ]; then + xm_v200_wifi 163 atbm603x_comb_wifi_usb + exit $? +fi + +# XM530/XM550 AltoBeam ATBM6032 (USB 007a:8888). The power GPIO differs per +# board, so it comes from the wifipdn variable, which the device's customizer +# in OpenIPC/builder sets. A failure here sends S40network to the wired port +# instead of an ifup of a wlan0 that does not exist. +if [ "$1" = "atbm603x-xm530" ]; then + pdn=$(fw_printenv -n wifipdn 2>/dev/null) + if [ -z "$pdn" ]; then + echo "atbm603x-xm530: wifipdn is not set" >&2 + exit 1 + fi + modprobe dwc_otg || exit 1 + modprobe wifi_pdn value="$pdn" || exit 1 + modprobe atbm603x_wifi_usb || exit 1 + # wlan0 appears once the dongle has enumerated and taken its firmware + i=0 + while [ ! -e /sys/class/net/wlan0 ] && [ $i -lt 10 ]; do + sleep 1 + i=$((i + 1)) + done + [ -e /sys/class/net/wlan0 ] + exit $? +fi + +# VStarcam C8622 +if [ "$1" = "aic8800-t23-vstarcam-c8622" ]; then + modprobe cfg80211 || exit 1 + modprobe mac80211 || exit 1 + modprobe aic_load_fw || exit 1 + modprobe aic8800 || exit 1 + # wlan0 appears once the module has enumerated and taken its firmware + i=0 + while [ ! -e /sys/class/net/wlan0 ] && [ $i -lt 10 ]; do + sleep 1 + i=$((i + 1)) + done + [ -e /sys/class/net/wlan0 ] + exit $? +fi + +exit 1 diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/sbin/resetd.sh b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/sbin/resetd.sh new file mode 100755 index 000000000..3a2429941 --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/sbin/resetd.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +if [ -e /usr/share/openipc/gpio.conf ]; then + . /usr/share/openipc/gpio.conf +fi + + +[ -z "$button" ] && echo "GPIO pin for resetd is not set" | logger -t resetd && exit +[ "$button" -lt 0 ] 2>/dev/null && echo "GPIO pin for resetd is not set" | logger -t resetd && exit + +# Counter for button press until reset +count=0 + +# prepare the pin +if [ ! -d /sys/class/gpio/gpio${button} ]; then + echo "${button}" > /sys/class/gpio/export + echo "in" > /sys/class/gpio/gpio${button}/direction +fi + +# continuously monitor current value of reset switch +while [ true ]; do + if [ "$(cat /sys/class/gpio/gpio${button}/value)" -eq 1 ]; then + count=0 + else + count=$((count+1)) + # 20 counts =~ 5 seconds @ 0.25 sleep intervals + if [ $count -eq 20 ]; then + #echo 'SET WIFI' | logger -t resetd + #fw_setenv wlanssid WIFI + #fw_setenv wlanpass 12345678 + for a in $(seq 10) ; do (gpio toggle ${led1} ; sleep 0.3 ; gpio toggle ${led1} ; sleep 0.3) ; done >/dev/null 2>&1 + echo 'RESETTING FIRMWARE' | logger -t resetd + firstboot + fi + fi + # This interval uses 1% CPU. Less sleep = more CPU + sleep 0.25 +done diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..35b95857c --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Perform basic settings on a known IP camera +# +# +# Set custom upgrade url +# +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/t23_lite_vstarcam-c8622-nor.tgz' +# +# AIC8800DC USB wifi +# +fw_setenv wlandev aic8800-t23-vstarcam-c8622 +# +# +# Set custom majestic settings +# +cli -s .video0.codec h264 +cli -s .nightMode.backlightPin 61 +cli -s .nightMode.whiteLightPin 50 +cli -s .nightMode.monitorDelay 5 +cli -s .nightMode.lightMonitor true +cli -s .nightMode.minThreshold 10 +cli -s .nightMode.maxThreshold 100 +cli -s .osd.enabled true +cli -s .osd.template "OpenIPC | %F %T %Z" +cli -s .audio.enabled true +cli -s .audio.codec aac +cli -s .audio.srate 48000 +cli -s .audio.volume 95 +cli -s .audio.gain 25 +cli -s .audio.outputEnabled true +cli -s .audio.outputVolume 80 +cli -s .audio.speakerPin 63 +# +# +# Set sensor (this unit is resoldered to ethernet; wifi stays the default) +# +fw_setenv sensor gc1084 +#fw_setenv wlanssid Router +#fw_setenv wlanpass 12345678 +# +# +# Set osmem and rmem +# +fw_setenv osmem 45M@0x0 +fw_setenv rmem 19M@0x2D00000 +# +# +#adduser viewer -s /bin/false -D -H ; echo viewer:12345678 | chpasswd +# +(sleep 3 ; sync ; reboot -f) & + +exit 0 diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf new file mode 100644 index 000000000..7643e2d5a --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf @@ -0,0 +1,19 @@ +#!/bin/sh + +### board wiring reference (consumed only by resetd.sh's `button`) ### +# ircut lives on the GC6153F chip (i2c 0x10, regs 0x15/0x16/0x17), not on +# GPIO; the lamps are GPIO61 (IR) / GPIO50 (white) with the shared brightness +# line PB17 held high by muxes.sh. +alarm_in=-1 +alarm_out=-1 +button=58 +ircut1=-1 +ircut2=-1 +led1=-1 +led2=-1 +light_ir=61 +light_wl=50 +light_sensor=-1 +mmc_pwr=-1 +speaker=63 +usb=-1 diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh new file mode 100755 index 000000000..b20c1092a --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# VStarcam C8622 lamp lines. S30customizer runs this script on every boot. +# +# PB17 (GPIO49) is the shared brightness line for both lamps: held high, +# GPIO61 (IR) and GPIO50 (white) become plain on/off switches that +# majestic's nightMode drives. Park the lamps off at boot. +# +for p in 49 61 50; do + echo "$p" > /sys/class/gpio/export 2>/dev/null + echo out > "/sys/class/gpio/gpio$p/direction" 2>/dev/null +done +echo 1 > /sys/class/gpio/gpio49/value +echo 0 > /sys/class/gpio/gpio61/value +echo 0 > /sys/class/gpio/gpio50/value + +exit 0 diff --git a/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk b/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk new file mode 100644 index 000000000..75a818ddd --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# aic8800-openipc +# +################################################################################ + +# Device override: install the aic8800DC firmware, which the stock package +# leaves in the source tree. Same source and version as stock; drop once the +# stock package installs it (submitted as an OpenIPC/firmware PR). +AIC8800_OPENIPC_SITE = $(call github,openipc,aic8800,$(AIC8800_OPENIPC_VERSION)) +AIC8800_OPENIPC_VERSION = 0e218ed686ee04a3006bb142ca70450dfa72f4d2 + +AIC8800_OPENIPC_LICENSE = GPL-2.0 + +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 + +$(eval $(kernel-module)) +$(eval $(generic-package)) diff --git a/devices/t23_lite_vstarcam-c8622/general/scripts/excludes/t23_lite.list b/devices/t23_lite_vstarcam-c8622/general/scripts/excludes/t23_lite.list new file mode 100644 index 000000000..760778741 --- /dev/null +++ b/devices/t23_lite_vstarcam-c8622/general/scripts/excludes/t23_lite.list @@ -0,0 +1,32 @@ +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/i2c/algos/i2c-algo-bit.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/i2c/busses/i2c-gpio.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/net/usb/cdc_ether.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/net/usb/rndis_host.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/net/usb/usbnet.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/serial/option.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/serial/usb_wwan.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/serial/usbserial.ko +/lib/modules/3.10.14__isvp_swan_1.0__/kernel/fs/f2fs/f2fs.ko +# +#/etc/sensor/gc2053-t23.bin +#/etc/sensor/gc2053.yaml +#/etc/sensor/imx327-t23.bin +#/etc/sensor/imx327.yaml +#/etc/sensor/jxf23-t23.bin +#/etc/sensor/jxf23.yaml +#/etc/sensor/jxf37pa-t23.bin +#/etc/sensor/jxf37pa.yaml +#/etc/sensor/jxh63p-t23.bin +#/etc/sensor/jxh63p.yaml +#/etc/sensor/sc1346-t23.bin +#/etc/sensor/sc1346.yaml +#/etc/sensor/sc1a4t-t23.bin +#/etc/sensor/sc1a4t.yaml +#/etc/sensor/sc200ai-t23.bin +#/etc/sensor/sc200ai.yaml +#/etc/sensor/sc2310-t23.bin +#/etc/sensor/sc2310.yaml +#/etc/sensor/sc2331-t23.bin +#/etc/sensor/sc2331.yaml +#/etc/sensor/sc301IoT-t23.bin +#/etc/sensor/sc301IoT.yaml From 1c25051d99aacf95a3ec694a76fadfdba14e3f7b Mon Sep 17 00:00:00 2001 From: Petr Beklemishev Date: Mon, 30 Nov 2026 02:21:17 +0700 Subject: [PATCH 2/5] Update gpio.conf to include wifi enable pin --- .../general/overlay/usr/share/openipc/gpio.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf index 7643e2d5a..e708b7b38 100644 --- a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/gpio.conf @@ -16,4 +16,4 @@ light_wl=50 light_sensor=-1 mmc_pwr=-1 speaker=63 -usb=-1 +usb=62 From e1e3a44d1c4e76c540cfe05a9d708b3111b676c2 Mon Sep 17 00:00:00 2001 From: Petr Beklemishev Date: Mon, 30 Nov 2026 02:23:14 +0700 Subject: [PATCH 3/5] Update muxes.sh to include gpio 62 --- .../general/overlay/usr/share/openipc/muxes.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh index b20c1092a..12f6d3285 100755 --- a/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh +++ b/devices/t23_lite_vstarcam-c8622/general/overlay/usr/share/openipc/muxes.sh @@ -2,16 +2,18 @@ # # VStarcam C8622 lamp lines. S30customizer runs this script on every boot. # +# GPIO62 (active low) controls wifi module power. # PB17 (GPIO49) is the shared brightness line for both lamps: held high, # GPIO61 (IR) and GPIO50 (white) become plain on/off switches that # majestic's nightMode drives. Park the lamps off at boot. # -for p in 49 61 50; do +for p in 49 61 62 50; do echo "$p" > /sys/class/gpio/export 2>/dev/null echo out > "/sys/class/gpio/gpio$p/direction" 2>/dev/null done echo 1 > /sys/class/gpio/gpio49/value echo 0 > /sys/class/gpio/gpio61/value +echo 0 > /sys/class/gpio/gpio62/value echo 0 > /sys/class/gpio/gpio50/value exit 0 From 98e5f0a15abcf16de1e542d55524387cc99ef183 Mon Sep 17 00:00:00 2001 From: Petr B Date: Mon, 30 Nov 2026 15:06:36 +0000 Subject: [PATCH 4/5] t23_lite_vstarcam-c8622: use the stock aic8800-openipc firmware install 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. --- .../configs/t23_lite_vstarcam-c8622_defconfig | 1 + .../aic8800-openipc/aic8800-openipc.mk | 22 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk diff --git a/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig b/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig index 92a050761..ad3adaa4e 100644 --- a/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig +++ b/devices/t23_lite_vstarcam-c8622/br-ext-chip-ingenic/configs/t23_lite_vstarcam-c8622_defconfig @@ -65,6 +65,7 @@ BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_QUIRC_OPENIPC=y BR2_PACKAGE_AIC8800_OPENIPC=y +BR2_PACKAGE_AIC8800_OPENIPC_DC=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" diff --git a/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk b/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk deleted file mode 100644 index 75a818ddd..000000000 --- a/devices/t23_lite_vstarcam-c8622/general/package/aic8800-openipc/aic8800-openipc.mk +++ /dev/null @@ -1,22 +0,0 @@ -################################################################################ -# -# aic8800-openipc -# -################################################################################ - -# Device override: install the aic8800DC firmware, which the stock package -# leaves in the source tree. Same source and version as stock; drop once the -# stock package installs it (submitted as an OpenIPC/firmware PR). -AIC8800_OPENIPC_SITE = $(call github,openipc,aic8800,$(AIC8800_OPENIPC_VERSION)) -AIC8800_OPENIPC_VERSION = 0e218ed686ee04a3006bb142ca70450dfa72f4d2 - -AIC8800_OPENIPC_LICENSE = GPL-2.0 - -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 - -$(eval $(kernel-module)) -$(eval $(generic-package)) From af66dfcb62fd109aae08bf656d751c56b52bb0da Mon Sep 17 00:00:00 2001 From: Petr Beklemishev Date: Tue, 1 Dec 2026 01:03:11 +0700 Subject: [PATCH 5/5] Update README.md - include that sd in progress --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2af7ba96..041a09563 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Vixand IVG-G6S GK7205V300 IMX335 - NOR_16M done Vixand IVG-G6S-W GK7205V300 IMX335 ATBM6032i_USB NOR_16M w/ext wifi board VStarcam C43S(B) SSC333 JXF37 MT7601U_USB NOR_16M in progress VStarcam CS55 T31N GC2053 RTL8188FU_USB NOR_16M in progress -VStarcam C8622 T23N GC1084 AIC8800DC_USB NOR_8M testing, video-ok, ir-ok, speaker-ok, wifi-ok, ptz/ircut - in progress (gc6153) +VStarcam C8622 T23N GC1084 AIC8800DC_USB NOR_8M testing, video-ok, ir-ok, speaker-ok, wifi-ok, sd - in progress, ptz/ircut - in progress (gc6153) XiongMai 85H50AI HI3516EV300 IMX335 - NOR_16M testing, motorized zoom+focus (pelco-xm) XiongMai HI3516D_N81820 HI3516DV100 IMX291 - NOR_16M testing, motorized zoom+focus (ms41908 SPI) XiongMai IPC_G6S 20X GK7205V300 IMX335 - NOR_16M untested, 20x zoom+focus (pelco-xm), board of Vixand IVG-G6S